RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cline rules/cline/cline

Cline rules

.clinerules/network.md
Cline rules

Quality

54/100

Scores the file, not the repository.

Length

370 words

7 headings · 5 code blocks

Repository

66k

— · pushed 0 days ago

Last changed

3 days ago

First indexed 3 days ago.
cline/cline/.clinerules/network.mdRawGitHub
1# Networking & Proxy Support
2 
3To 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.
4 
5In 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`.
6 
7Global `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.
8 
9## Guidelines
10 
11### 1. Using `fetch`
12 
13Instead of `fetch(...)`, import the proxy-aware wrapper:
14 
15```typescript
16import { fetch } from '@/shared/net'
17 
18// Usage is identical to global fetch
19const response = await fetch('https://api.example.com/data')
20```
21 
22### 2. Using `axios`
23 
24When using `axios`, you must apply the settings from `getAxiosSettings()`:
25 
26```typescript
27import axios from 'axios'
28import { getAxiosSettings } from '@/shared/net'
29 
30const response = await axios.get('https://api.example.com/data', {
31 headers: { 'Authorization': '...' },
32 ...getAxiosSettings() // <--- CRITICAL: Injects the proxy agent if needed
33})
34```
35 
36### 3. Third-Party Clients (OpenAI, Ollama, etc.)
37 
38Most API client libraries allow you to customize the `fetch` implementation. You **MUST** pass the proxy-aware `fetch` to these clients.
39 
40**Example (OpenAI):**
41```typescript
42import OpenAI from "openai"
43import { fetch } from "@/shared/net"
44 
45this.client = new OpenAI({
46 apiKey: '...',
47 fetch, // <--- CRITICAL: Pass our fetch wrapper
48})
49```
50 
51### 4. Tests
52 
53Use `mockFetchForTesting` to mock the underlying fetch implementation.
54 
55**Example (callback):**
56 
57```
58import { mockFetchForTesting } from "@/shared/net"
59 
60...
61 let mockFetch = ...
62 mockFetchForTesting(mockFetch, () => {
63 // This calls mockFetch
64 fetch('https://foo.example').then(...)
65 })
66 // Original fetch is restored immediately when the call returns.
67```
68 
69**Example (Promise):**
70 
71```
72import { mockFetchForTesting } from "@/shared/net"
73 
74...
75 let mockFetch = ...
76 await mockFetchForTesting(mockFetch, async () => {
77 await ...
78 // This calls mockFetch
79 await fetch('https://foo.example')
80 ...
81 })
82 // Original fetch is restored when the Promise from the callback settles
83```
84 
85## Verification
86 
87If 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 

Sections

  • Networking & Proxy Support
  • Guidelines
  • 1. Using `fetch`
  • 2. Using `axios`
  • 3. Third-Party Clients (OpenAI, Ollama, etc.)
  • 4. Tests
  • Verification

What it covers

code-styletesting-strategydependencies

Stack — with the evidence

typescript

(1.00)

node

(1.00)

vitest

(1.00)

react

(0.70)

nextjs

(0.70)

tailwind

(0.70)

vite

(0.70)

eslint

(0.70)

vercel

(0.70)

desktop-app

(0.70)

javascript

(0.60)

bun

(0.60)

biome

(0.60)

github-actions

(0.60)

Format

Cline rules

A single file or a folder of files, all always-on. The folder form is the simplest way any format here lets you split rules into topics without also learning an activation model.

What the corpus says about it

Repository

Owner
cline
Language
—
License
—
Archived
no

All configs in this repo

Also in cline/cline

Diff this repo’s formats

One 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?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
cline/cline.clinerules/bun-and-node.md · 66kCline rulestypescriptnode+12setuptestmonorepodo-not74/1003 days ago
cline/cline.clinerules/cline-overview.md · 66kCline rulestypescriptnode+12archtypesapi54/1003 days ago
cline/cline.clinerules/debug-harness.md · 66kCline rulestypescriptnode+12buildtesttesting-strategysecurity+185/1003 days ago
cline/cline.clinerules/general.md · 66kCline rulestypescriptnode+12setupbuildstylearch+286/1003 days ago
cline/cline.clinerules/protobuf-development.md · 66kCline rulestypescriptnode+12buildstylearchapi+174/1003 days ago
cline/cline.clinerules/sdk-migration.md · 66kCline rulestypescriptnode+12style59/1003 days ago
cline/cline.clinerules/storage.md · 66kCline rulestypescriptnode+12stylearchdatabasedo-not65/1003 days ago
cline/cline.github/copilot-instructions.md · 66kCopilot instructionstypescriptnode+12buildteststyleapi+175/1003 days ago
cline/clineAGENTS.md · 66kAGENTS.mdtypescriptnode+13buildtestlint-formatstyle+283/1003 days ago
cline/clinesdk/AGENTS.md · 66kAGENTS.mdtypescriptnode+12setupbuildteststyle+589/1003 days ago
cline/clinesdk/packages/llms/AGENTS.md · 66kAGENTS.mdtypescriptnode+12no sections45/1003 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.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
bashdeban/fastmind.clinerules/.project-consistency-keeper2.md · 5Cline rulestypescriptnode+8setupbuildtestlint-format+11100/1003 days ago
JCodesMore/ai-website-cloner-template.clinerules · 31kCline rulestypescriptnode+7buildlint-formatstylearch+397/1002 days ago
BryaanF/LiantPortfolio.clinerules/project-guidelines.md · 0Cline rulesjavascripttailwind+5buildstylearchgit+296/1003 days ago
u9401066/zotero-keeper.clinerules/50-pubmed-project.md · 6Cline rulespytestruff+6testlint-formatstylearch+194/1003 days ago
u9401066/zotero-keepervscode-extension/resources/repo-assets/pubmed-search-mcp/.clinerules/50-pubmed-project.md · 6Cline rulespytestruff+6testlint-formatstylearch+194/1003 days ago
VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1Cline rulestypescriptvite+4setuparchtypesdo-not93/100yesterday
HerringtonDarkholme/megarepo.clinerules/02-development.md · 17Cline rulesnodejavascriptsetupbuildteststyle+392/1003 days ago
blendsdk/codeops-mcp.clinerules/project.md · 0Cline rulestypescriptvitest+3buildteststylearch+791/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack