Cline rules
.clinerules/network.mdCline rules
Quality
54/100
Scores the file, not the repository.Length
370 words
7 headings · 5 code blocksRepository
66k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# Networking & Proxy Support23To ensure Cline works correctly in all environments (VSCode, JetBrains, CLI) and with various network configurations (especially corporate proxies), strictly follow these guidelines for all network activity.45In extension code, do NOT use the global `fetch` or a default `axios` instance. (Note, `shared/net.ts` is exempt from these rules because it sets up the fetch wrappers.) In Webview code, you SHOULD use global `fetch`.67Global `fetch` and default `axios` do not automatically pick up proxy configurations in all environments (specifically JetBrains and CLI). You MUST use the provided utilities in `@/shared/net` which handle proxy agent configuration. In the webview, the browser/embedder handles proxies.89## Guidelines1011### 1. Using `fetch`1213Instead of `fetch(...)`, import the proxy-aware wrapper:1415```typescript16import { fetch } from '@/shared/net'1718// Usage is identical to global fetch19const response = await fetch('https://api.example.com/data')20```2122### 2. Using `axios`2324When using `axios`, you must apply the settings from `getAxiosSettings()`:2526```typescript27import axios from 'axios'28import { getAxiosSettings } from '@/shared/net'2930const response = await axios.get('https://api.example.com/data', {31 headers: { 'Authorization': '...' },32 ...getAxiosSettings() // <--- CRITICAL: Injects the proxy agent if needed33})34```3536### 3. Third-Party Clients (OpenAI, Ollama, etc.)3738Most API client libraries allow you to customize the `fetch` implementation. You **MUST** pass the proxy-aware `fetch` to these clients.3940**Example (OpenAI):**41```typescript42import OpenAI from "openai"43import { fetch } from "@/shared/net"4445this.client = new OpenAI({46 apiKey: '...',47 fetch, // <--- CRITICAL: Pass our fetch wrapper48})49```5051### 4. Tests5253Use `mockFetchForTesting` to mock the underlying fetch implementation.5455**Example (callback):**5657```58import { mockFetchForTesting } from "@/shared/net"5960...61 let mockFetch = ...62 mockFetchForTesting(mockFetch, () => {63 // This calls mockFetch64 fetch('https://foo.example').then(...)65 })66 // Original fetch is restored immediately when the call returns.67```6869**Example (Promise):**7071```72import { mockFetchForTesting } from "@/shared/net"7374...75 let mockFetch = ...76 await mockFetchForTesting(mockFetch, async () => {77 await ...78 // This calls mockFetch79 await fetch('https://foo.example')80 ...81 })82 // Original fetch is restored when the Promise from the callback settles83```8485## Verification8687If you are adding a new network call or integration:881. Check `@/shared/net.ts` is imported.892. Ensure `fetch` or `getAxiosSettings` is being used.903. Verify that third-party clients are configured to use the custom fetch.91
Also in cline/cline
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| cline/cline.clinerules/bun-and-node.md · 66k | Cline rules | setuptestmonorepodo-not | 74/100 | 3 days ago | |
| cline/cline.clinerules/cline-overview.md · 66k | Cline rules | archtypesapi | 54/100 | 3 days ago | |
| cline/cline.clinerules/debug-harness.md · 66k | Cline rules | buildtesttesting-strategysecurity+1 | 85/100 | 3 days ago | |
| cline/cline.clinerules/general.md · 66k | Cline rules | setupbuildstylearch+2 | 86/100 | 3 days ago | |
| cline/cline.clinerules/protobuf-development.md · 66k | Cline rules | buildstylearchapi+1 | 74/100 | 3 days ago | |
| cline/cline.clinerules/sdk-migration.md · 66k | Cline rules | style | 59/100 | 3 days ago | |
| cline/cline.clinerules/storage.md · 66k | Cline rules | stylearchdatabasedo-not | 65/100 | 3 days ago | |
| cline/cline.github/copilot-instructions.md · 66k | Copilot instructions | buildteststyleapi+1 | 75/100 | 3 days ago | |
| cline/clineAGENTS.md · 66k | AGENTS.md | buildtestlint-formatstyle+2 | 83/100 | 3 days ago | |
| cline/clinesdk/AGENTS.md · 66k | AGENTS.md | setupbuildteststyle+5 | 89/100 | 3 days ago | |
| cline/clinesdk/packages/llms/AGENTS.md · 66k | AGENTS.md | no sections | 45/100 | 3 days ago |
Diff against .clinerules/bun-and-node.md Diff against .clinerules/cline-overview.md Diff against .clinerules/debug-harness.md Diff against .clinerules/general.md Diff against .clinerules/protobuf-development.md Diff against .clinerules/sdk-migration.md Diff against .clinerules/storage.md Diff against .github/copilot-instructions.md Diff against AGENTS.md Diff against sdk/AGENTS.md Diff against sdk/packages/llms/AGENTS.md
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bashdeban/fastmind.clinerules/.project-consistency-keeper2.md · 5 | Cline rules | setupbuildtestlint-format+11 | 100/100 | 3 days ago | |
| JCodesMore/ai-website-cloner-template.clinerules · 31k | Cline rules | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| BryaanF/LiantPortfolio.clinerules/project-guidelines.md · 0 | Cline rules | buildstylearchgit+2 | 96/100 | 3 days ago | |
| u9401066/zotero-keeper.clinerules/50-pubmed-project.md · 6 | Cline rules | testlint-formatstylearch+1 | 94/100 | 3 days ago | |
| u9401066/zotero-keepervscode-extension/resources/repo-assets/pubmed-search-mcp/.clinerules/50-pubmed-project.md · 6 | Cline rules | testlint-formatstylearch+1 | 94/100 | 3 days ago | |
| VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1 | Cline rules | setuparchtypesdo-not | 93/100 | yesterday | |
| HerringtonDarkholme/megarepo.clinerules/02-development.md · 17 | Cline rules | setupbuildteststyle+3 | 92/100 | 3 days ago | |
| blendsdk/codeops-mcp.clinerules/project.md · 0 | Cline rules | buildteststylearch+7 | 91/100 | 3 days ago |
