mirror of
https://github.com/cline/cline.git
synced 2026-09-01 23:19:18 +08:00
Compare commits
290 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a79676869 | |||
| 3d5605f5d7 | |||
| 1b48f06898 | |||
| b17631900d | |||
| 3d8d83568d | |||
| 3d95adb0f3 | |||
| 971ac0fdeb | |||
| 2888af54f3 | |||
| 190d4a2c52 | |||
| 4d5ab59923 | |||
| f0ad29accb | |||
| 0ba45084a0 | |||
| 213591a169 | |||
| 70fd35df6d | |||
| bd526cb2d2 | |||
| 2fbebec7ae | |||
| ca1e008714 | |||
| 1ab3de8911 | |||
| 47f75225e8 | |||
| 15f6577cb9 | |||
| 7c5d56a5c1 | |||
| cdc24890ee | |||
| ef5465b667 | |||
| d4ba4fd98a | |||
| 074e5d7002 | |||
| 18e164fe81 | |||
| 82be7c4ed5 | |||
| 702dd75291 | |||
| ce89547f32 | |||
| 275be69932 | |||
| 8eba96582a | |||
| e73364d497 | |||
| 56b8c4a847 | |||
| cd066c4912 | |||
| 59a0d055de | |||
| b0ea2e48a7 | |||
| 9e86ba580b | |||
| 99eccaafd4 | |||
| cc0f695555 | |||
| 96a461668c | |||
| 357f98c707 | |||
| 6d4bea48d3 | |||
| 06cd873a46 | |||
| 34e52757ff | |||
| 43d1bd858c | |||
| 90f07e824e | |||
| 8cc823ce05 | |||
| eeef3f89bd | |||
| b1ab8967ec | |||
| 5a81f8f6d3 | |||
| 55b1b4c125 | |||
| fe8ab85e1a | |||
| a50200aba1 | |||
| 7640ae11ec | |||
| 08d94c450f | |||
| d7a93cd618 | |||
| 49475ad417 | |||
| e6c18ea793 | |||
| 881593beea | |||
| 96198c82f9 | |||
| b45168f6a3 | |||
| 24f10eeee5 | |||
| d594368f05 | |||
| 7177dd00ea | |||
| 8f0352ee01 | |||
| 2ebd92ee94 | |||
| 8806beda20 | |||
| 58ce23663d | |||
| 6dc44b9c7e | |||
| 7e7280d7c5 | |||
| 4b8927c055 | |||
| aea979ff4e | |||
| 714bcf92cf | |||
| a630b8c1a1 | |||
| a9836fb9fc | |||
| 19f055e333 | |||
| 1997ee3e80 | |||
| 89ec9c4277 | |||
| e125540595 | |||
| 9f3628ae19 | |||
| de133c27a0 | |||
| 7a43024b61 | |||
| 982f323162 | |||
| 67ef89a4cb | |||
| c24ba53400 | |||
| 01c4ead155 | |||
| 6f4a4e1ccd | |||
| dc03b3bf1f | |||
| cf52db8f49 | |||
| 26ce4a31b6 | |||
| 06e0973c04 | |||
| 54faddb3ff | |||
| d6935623f9 | |||
| 803574e7f3 | |||
| f676f2be78 | |||
| c88a852344 | |||
| 5709f34479 | |||
| a7eb7defc9 | |||
| a45278bb61 | |||
| 5d75a311f4 | |||
| 0054b21d67 | |||
| ea4433d705 | |||
| 4aaca09389 | |||
| feb92c45ce | |||
| e7c4757271 | |||
| a462a7aded | |||
| 2e729441ed | |||
| c1d7faee1a | |||
| 38d6af3a8d | |||
| 612b8352ff | |||
| d4f26fe1de | |||
| e242825dff | |||
| 8fbccff853 | |||
| 2615ea88b6 | |||
| 61c2943715 | |||
| b176772cd5 | |||
| e6b00527ed | |||
| 2635f5f575 | |||
| 44f370f295 | |||
| 8c49ce56f6 | |||
| 08543e051e | |||
| f4828d3344 | |||
| 385e952935 | |||
| 9a2aaf0881 | |||
| 5d65260611 | |||
| 7098c1a32a | |||
| d46e672990 | |||
| 7b2dddd4a5 | |||
| a6e657e0d1 | |||
| 612a67ee89 | |||
| 383826f7f7 | |||
| b44d3c8793 | |||
| fbc517c9e5 | |||
| 3175e19bd7 | |||
| 8e80c18c52 | |||
| b5be6f57d5 | |||
| 28737ac62a | |||
| 61112aaa03 | |||
| 922cfed632 | |||
| 6d7cca7d38 | |||
| d81fb542a9 | |||
| a16fc09a68 | |||
| 2ec21eda34 | |||
| 88000d4f39 | |||
| 6318eb5948 | |||
| 0fd1c0a3aa | |||
| e0478493a2 | |||
| 9355d3eea4 | |||
| f485d0cc8f | |||
| 79bda976cb | |||
| 94acfec39f | |||
| 0f67508fa3 | |||
| e31bc6147f | |||
| 8d69e63d72 | |||
| 49a678b835 | |||
| 67610b1f87 | |||
| 45f837e1e9 | |||
| d0793e51c4 | |||
| 00740de01d | |||
| 1ffa4085a6 | |||
| 4db5581cfc | |||
| 675cd1779b | |||
| af0f0b3d7c | |||
| 45767b87fd | |||
| 8f4c6038dd | |||
| 9dc021a881 | |||
| 3e2bdf8b12 | |||
| d4a99a4060 | |||
| f4bbb45b07 | |||
| 088deebd63 | |||
| dcc744dd87 | |||
| 9ad8525bd0 | |||
| 8bf6268952 | |||
| 2081bb8dc6 | |||
| ac22b63796 | |||
| 44eb2cc65e | |||
| 2cf1d8628b | |||
| 669e018b85 | |||
| 2aa5156905 | |||
| 51b619e0d5 | |||
| 85fb76a996 | |||
| d73a7cfd06 | |||
| 489dfbc932 | |||
| 314c416788 | |||
| 3b19c2ec95 | |||
| e04cbea504 | |||
| affac119f5 | |||
| 3847a2545c | |||
| 15593bac2a | |||
| 84267efb9e | |||
| 985ce56809 | |||
| cad28c4c0c | |||
| 4a22f7dbd2 | |||
| a430226caa | |||
| 5885a3cc1d | |||
| 759ef873ae | |||
| 782e4ff6e0 | |||
| 4bb00241bf | |||
| c325faf8db | |||
| 20f8f9c9cf | |||
| 5be163f49d | |||
| 7843ab937a | |||
| 5ed4319d21 | |||
| a8971b807a | |||
| 51c4e0aceb | |||
| 1cf62941cd | |||
| cc2472f500 | |||
| 677e544c51 | |||
| d3c8fbbf1d | |||
| 1b06633253 | |||
| 4ab8559fce | |||
| 259368e0a3 | |||
| 9b7839efcd | |||
| 47a2ae83de | |||
| 1b5590e26c | |||
| 9e493341d2 | |||
| 1d4cd3187b | |||
| 32f0f9618c | |||
| 3001f883c2 | |||
| a64e60b8f6 | |||
| 3a0e6a471b | |||
| c10f4e0a66 | |||
| 3e11271cf8 | |||
| 29ae2c286d | |||
| 82aee44a9a | |||
| 031604ddf6 | |||
| f2101e375f | |||
| 8a65f0c68b | |||
| 32b8fa44cb | |||
| 0d067f7470 | |||
| de6166392c | |||
| 5f21a9162a | |||
| 4de991f1b0 | |||
| 6e5d4a3f9e | |||
| 95af95badf | |||
| 61dcbd390c | |||
| 6255ac0a51 | |||
| 616800fcb9 | |||
| df3826a59f | |||
| 873917810d | |||
| e3c966f4e9 | |||
| 7eeb43ab41 | |||
| 7620f177ac | |||
| 67bab94911 | |||
| eb91bfd738 | |||
| b8227c19c3 | |||
| 8fee09f09e | |||
| 1c026c26d2 | |||
| 5bc4e5a4a0 | |||
| 2cfce5734e | |||
| e2045bf5c3 | |||
| 0d933e804f | |||
| 16f73532f4 | |||
| 88bea8eeb4 | |||
| 1a570e98ba | |||
| d86b7dd036 | |||
| 0178c3fa90 | |||
| a107f45c6a | |||
| 3dd2ed9161 | |||
| 9a6603fdfb | |||
| 6d5c3e6aa4 | |||
| 24b9e821bb | |||
| 9960a3c57c | |||
| 88947592f0 | |||
| ef4d11df19 | |||
| 23dec509bc | |||
| 07ab6b19b8 | |||
| 0ddef94d1f | |||
| b9ae83b1cd | |||
| e4eaf34827 | |||
| 6d3ed43c74 | |||
| cbb67b48f2 | |||
| a5f6a97be8 | |||
| f309b062e7 | |||
| 768df130ab | |||
| 9980cb0938 | |||
| aca4f842fa | |||
| 3fc91e2afe | |||
| 5f4700ce95 | |||
| dbaf5e3ee3 | |||
| 576176c24f | |||
| c8abcbfdf9 | |||
| 8e984f2d98 | |||
| 81564faa4e | |||
| f8b5f1fd72 | |||
| 2eb57384ab | |||
| c80bae504a | |||
| 80f955be9e | |||
| 7435ffcd2f | |||
| a05d438612 |
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Fix Ollama connection issue to default endpoint at port 11434
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Optimized Cline for GPT-5 model family with an aligned system prompt
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
REfactoring Tool Executor
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Remove disabled approve / reject buttons from UI.
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Fix Global Rules directory documentation for Linux/WSL systems
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
DeepSeek R1 0528 support under Hugging Face
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
remove duplicate tool registration for claude4-experimental
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"claude-dev": minor
|
||||
---
|
||||
|
||||
Add Huawei Cloud MaaS Provider
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Add "Use custom prompt" option to Ollama provider
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Fix AutoApproveModal overflowing issue
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Dify.ai api integration
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Fixed token counting when using VSCode LM API provider
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": minor
|
||||
---
|
||||
|
||||
support orchestration mode for sap provider
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
fix: only focus on editor panel that is visible and active to stop input field stealing issue
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"claude-dev": minor
|
||||
---
|
||||
|
||||
Add Cerebras Qwen 3 235B instruct
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
trim input value for URL fields
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Prompt changes for deep-planning in windows/powershell
|
||||
@@ -6,28 +6,14 @@ Analyze the current branch's changes against main to provide informed insights a
|
||||
## Step 1: Gather Git Information
|
||||
<important>Do not return any text or conversation other than what is necessary to run these commands</important>
|
||||
|
||||
**First, check the expected output size:**
|
||||
```shell
|
||||
(git branch --show-current && echo "=== STATUS ===" && git status --porcelain | cat && echo "=== COMMIT MESSAGES ===" && git log main..HEAD --oneline | cat && echo "=== CHANGED FILES ===" && git diff main --name-only | cat && echo "=== FULL DIFF ===" && git diff main | cat) | wc -l
|
||||
```
|
||||
**Run the following command to get the latest changes (bash):**
|
||||
```bash
|
||||
B=$(for c in main master origin/main origin/master; do git rev-parse --verify -q "$c" >/dev/null && echo "$c" && break; done); B=${B:-HEAD}; r(){ git branch --show-current; printf "=== STATUS ===\n"; git status --porcelain | cat; printf "=== COMMIT MESSAGES ===\n"; git log "$B"..HEAD --oneline | cat; printf "=== CHANGED FILES ===\n"; git diff "$B" --name-only | cat; printf "=== FULL DIFF ===\n"; git diff "$B" | cat; }; L=$(r | wc -l); if [ "$L" -gt 500 ]; then r > cline-git-analysis.temp && echo "::OUTPUT_FILE=cline-git-analysis.temp"; else r; fi
|
||||
```
|
||||
|
||||
**If the expected line count is greater than 500 lines, use the file-based approach:**
|
||||
```shell
|
||||
git branch --show-current > cline-git-analysis.temp && echo "=== STATUS ===" >> cline-git-analysis.temp && git status --porcelain >> cline-git-analysis.temp && echo "=== COMMIT MESSAGES ===" >> cline-git-analysis.temp && git log main..HEAD --oneline >> cline-git-analysis.temp && echo "=== CHANGED FILES ===" >> cline-git-analysis.temp && git diff main --name-only >> cline-git-analysis.temp && echo "=== FULL DIFF ===" >> cline-git-analysis.temp && git diff main >> cline-git-analysis.temp
|
||||
```
|
||||
|
||||
Then, read the file using the read_file tool. After you have read the file but before you proceed with subsequent steps, delete it:
|
||||
```shell
|
||||
rm cline-git-analysis.temp
|
||||
```
|
||||
|
||||
**If the expected line count is 500 lines or fewer, use the direct approach:**
|
||||
```shell
|
||||
git branch --show-current && echo "=== STATUS ===" && git status --porcelain | cat && echo "=== COMMIT MESSAGES ===" && git log main..HEAD --oneline | cat && echo "=== CHANGED FILES ===" && git diff main --name-only | cat && echo "=== FULL DIFF ===" && git diff main | cat
|
||||
```
|
||||
|
||||
<important>If using the direct approach, pipe outputs through `cat` to avoid interactive terminals. If the user's shell is not bash/zsh, adjust the command and chaining
|
||||
syntax accordingly.</important>
|
||||
```powershell
|
||||
$B=$null;foreach($c in 'main','master','origin/main','origin/master'){git rev-parse --verify -q $c *> $null;if($LASTEXITCODE -eq 0){$B=$c;break}};if(-not $B){$B='HEAD'};function r([string]$b){git rev-parse --abbrev-ref HEAD; '=== STATUS ==='; git status --porcelain | cat; '=== COMMIT MESSAGES ==='; git log "$b"..HEAD --oneline | cat; '=== CHANGED FILES ==='; git diff "$b" --name-only | cat; '=== FULL DIFF ==='; git diff "$b" | cat};$out=r $B|Out-String;$lines=($out -split "`r?`n").Count;if($lines -gt 500){$out|Set-Content -NoNewline cline-git-analysis.temp; '::OUTPUT_FILE=cline-git-analysis.temp'}else{$out}
|
||||
```
|
||||
|
||||
## Step 2: Silent, Structured Analysis Phase
|
||||
- Analyze all git output without providing commentary or narration
|
||||
|
||||
@@ -219,6 +219,9 @@ EOF
|
||||
|
||||
## Basic PR Commands
|
||||
```bash
|
||||
# Get current PR number
|
||||
gh pr view --json number -q .number
|
||||
|
||||
# List open PRs
|
||||
gh pr list
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
[codespell]
|
||||
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
|
||||
skip = .git*,*.svg,package-lock.json,*.css,.codespellrc,locales
|
||||
check-hidden = true
|
||||
ignore-regex = (\b(optIn|isTaller)\b|https://\S+)
|
||||
# ignore-words-list =
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": ["@typescript-eslint", "eslint-rules"],
|
||||
"rules": {
|
||||
"@typescript-eslint/naming-convention": [
|
||||
"warn",
|
||||
{
|
||||
"selector": "import",
|
||||
"format": ["camelCase", "PascalCase"]
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/semi": "off",
|
||||
"curly": "warn",
|
||||
"eqeqeq": "warn",
|
||||
"no-throw-literal": "warn",
|
||||
"semi": "off",
|
||||
"react-hooks/exhaustive-deps": "off",
|
||||
"eslint-rules/no-direct-vscode-api": "warn",
|
||||
"no-restricted-syntax": [
|
||||
"error",
|
||||
{
|
||||
"selector": "VariableDeclarator[id.type=\"ObjectPattern\"][init.object.name=\"process\"][init.property.name=\"env\"]",
|
||||
"message": "Use process.env.VARIABLE_NAME directly instead of destructuring"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ignorePatterns": ["out", "dist", "**/*.d.ts"]
|
||||
}
|
||||
+3
-1
@@ -1 +1,3 @@
|
||||
* @saoudrizwan @ocasta181 @NightTrek @pashpashpash @dcbartlett @saito-sv @Garoth
|
||||
/docs/
|
||||
/.github/ @saoudrizwan @dcbartlett
|
||||
/README.md @saoudrizwan @nickbaumann98
|
||||
@@ -1,28 +0,0 @@
|
||||
# Codespell configuration is within .codespellrc
|
||||
---
|
||||
name: Codespell
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
codespell:
|
||||
if: false
|
||||
name: Check for spelling errors
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Annotate locations with typos
|
||||
uses: codespell-project/codespell-problem-matcher@v1
|
||||
- name: Codespell
|
||||
uses: codespell-project/actions-codespell@v2
|
||||
with:
|
||||
only_warn: 1
|
||||
@@ -97,13 +97,13 @@ jobs:
|
||||
CLINE_ENVIRONMENT: production
|
||||
run: |
|
||||
# Required to generate the .vsix
|
||||
vsce package --out "cline-${{ steps.get_version.outputs.version }}.vsix"
|
||||
vsce package --allow-package-secrets sendgrid --out "cline-${{ steps.get_version.outputs.version }}.vsix"
|
||||
|
||||
if [ "${{ github.event.inputs.release-type }}" = "pre-release" ]; then
|
||||
npm run publish:marketplace:prerelease
|
||||
echo "Successfully published pre-release version ${{ steps.get_version.outputs.version }} to VS Code Marketplace and Open VSX Registry"
|
||||
else
|
||||
npm run publish:marketplace
|
||||
ovsx publish
|
||||
echo "Successfully published release version ${{ steps.get_version.outputs.version }} to VS Code Marketplace and Open VSX Registry"
|
||||
fi
|
||||
|
||||
|
||||
+15
-24
@@ -71,13 +71,7 @@ jobs:
|
||||
- name: Install xvfb on Linux
|
||||
if: runner.os == 'Linux'
|
||||
run: sudo apt-get update && sudo apt-get install -y xvfb
|
||||
|
||||
- name: Install local modules on windows
|
||||
if: runner.os == 'Windows' && steps.root-cache.outputs.cache-hit == 'true'
|
||||
run: |
|
||||
npm install eslint-plugin-eslint-rules
|
||||
cd webview-ui/ && npm install eslint-plugin-eslint-rules
|
||||
|
||||
|
||||
- name: Set up NPM on Windows
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
@@ -86,26 +80,25 @@ jobs:
|
||||
- name: Type Check
|
||||
run: npm run check-types
|
||||
|
||||
- name: ESLint Check
|
||||
- name: Lint Check
|
||||
run: npm run lint
|
||||
|
||||
- name: Prettier / Format Check
|
||||
- name: Format Check
|
||||
run: npm run format
|
||||
|
||||
# Build the extension before running tests
|
||||
- name: Build Tests and Extension
|
||||
run: npm run pretest
|
||||
|
||||
# Unit Tests disabled due to module system conflicts between backend and webview-ui
|
||||
# - name: Unit Tests
|
||||
# run: npm run test:unit
|
||||
- name: Unit Tests
|
||||
run: npm run test:unit
|
||||
|
||||
# Run extension tests with coverage
|
||||
- name: Extension Tests with Coverage
|
||||
- name: Extension Integration Tests with Coverage
|
||||
id: extension_coverage
|
||||
continue-on-error: true
|
||||
run: |
|
||||
node ./scripts/test-ci.js > extension_coverage.txt 2>&1
|
||||
node ./scripts/test-ci.js 2>&1 | tee extension_coverage.txt
|
||||
# Default the encoding to UTF-8 - It's not the default on Windows
|
||||
PYTHONUTF8=1 PYTHONPATH=.github/scripts python -m coverage_check extract-coverage extension_coverage.txt --type=extension --github-output --verbose
|
||||
|
||||
@@ -117,7 +110,7 @@ jobs:
|
||||
cd webview-ui
|
||||
# Ensure coverage dependency is installed
|
||||
npm install --no-save @vitest/coverage-v8
|
||||
npm run test:coverage > webview_coverage.txt 2>&1
|
||||
npm run test:coverage 2>&1 | tee webview_coverage.txt
|
||||
cd ..
|
||||
# Default the encoding to UTF-8 - It's not the default on Windows
|
||||
PYTHONUTF8=1 PYTHONPATH=.github/scripts python -m coverage_check extract-coverage webview-ui/webview_coverage.txt --type=webview --github-output --verbose
|
||||
@@ -132,21 +125,19 @@ jobs:
|
||||
path: |
|
||||
extension_coverage.txt
|
||||
webview-ui/webview_coverage.txt
|
||||
retention-period: workflow # Artifacts are automatically deleted when the workflow completes
|
||||
|
||||
# Set the check as failed if any of the tests failed
|
||||
- name: Print test results and check for failures
|
||||
- name: Check for test failures
|
||||
run: |
|
||||
echo "Extension Tests Result: ${{ steps.extension_coverage.outcome }}"
|
||||
cat extension_coverage.txt
|
||||
|
||||
echo "Webview Tests Result: ${{ steps.webview_coverage.outcome }}"
|
||||
cat webview-ui/webview_coverage.txt
|
||||
|
||||
# Check if any of the test steps failed
|
||||
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#steps-context
|
||||
if [ "${{ steps.extension_coverage.outcome }}" != "success" ]; then
|
||||
echo "Extension Integration Tests failed, see previous step for test output."
|
||||
fi
|
||||
if [ "${{ steps.webview_coverage.outcome }}" != "success" ]; then
|
||||
echo "Webview Tests failed, see previous step for test output."
|
||||
fi
|
||||
if [ "${{ steps.extension_coverage.outcome }}" != "success" ] || [ "${{ steps.webview_coverage.outcome }}" != "success" ]; then
|
||||
echo "Tests failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -32,3 +32,6 @@ webview-ui/src/services/grpc-client.ts
|
||||
|
||||
# E2E Tests
|
||||
test-results
|
||||
|
||||
## CLI pre-release ##
|
||||
/cli
|
||||
|
||||
Executable → Regular
+1
-17
@@ -1,17 +1 @@
|
||||
echo "Running pre-commit checks..."
|
||||
|
||||
# Run ESLint
|
||||
echo "Running ESLint..."
|
||||
npm run lint || {
|
||||
echo "❌ ESLint check failed. Please fix the errors and try committing again."
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Run Prettier
|
||||
echo "Running Prettier..."
|
||||
npx lint-staged --verbose || {
|
||||
echo "❌ Prettier failed. Please fix the errors and try committing again."
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "✅ All checks passed!"
|
||||
lint-staged --no-stash
|
||||
|
||||
+11
-3
@@ -1,6 +1,14 @@
|
||||
{
|
||||
"extension": ["ts"],
|
||||
"spec": ["src/**/__tests__/*.ts", "eslint-rules/__tests__/**/*.test.ts"],
|
||||
"require": ["ts-node/register", "source-map-support/register", "./src/test/requires.ts"],
|
||||
"extension": [
|
||||
"ts"
|
||||
],
|
||||
"spec": [
|
||||
"src/**/__tests__/*.ts"
|
||||
],
|
||||
"require": [
|
||||
"ts-node/register",
|
||||
"source-map-support/register",
|
||||
"./src/test/requires.ts"
|
||||
],
|
||||
"recursive": true
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
dist/
|
||||
node_modules
|
||||
webview-ui/build/
|
||||
*.md
|
||||
package-lock.json
|
||||
src/core/prompts/system.ts
|
||||
src/core/prompts/model_prompts/claude4.ts
|
||||
evals/
|
||||
docs/
|
||||
out/
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"tabWidth": 4,
|
||||
"useTabs": true,
|
||||
"printWidth": 130,
|
||||
"semi": false,
|
||||
"bracketSameLine": true,
|
||||
"endOfLine": "lf"
|
||||
}
|
||||
Vendored
+2
-2
@@ -2,9 +2,9 @@
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"dbaeumer.vscode-eslint",
|
||||
"connor4312.esbuild-problem-matchers",
|
||||
"ms-vscode.extension-test-runner",
|
||||
"bradlc.vscode-tailwindcss"
|
||||
"bradlc.vscode-tailwindcss",
|
||||
"biomejs.biome"
|
||||
]
|
||||
}
|
||||
|
||||
Vendored
+37
-10
@@ -9,8 +9,14 @@
|
||||
"name": "Run Extension (production)",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--disable-workspace-trust", "${workspaceFolder}"],
|
||||
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"--disable-workspace-trust",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "${defaultBuildTask}",
|
||||
"env": {
|
||||
"IS_DEV": "true",
|
||||
@@ -22,8 +28,14 @@
|
||||
"name": "Run Extension (staging)",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--disable-workspace-trust", "${workspaceFolder}"],
|
||||
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"--disable-workspace-trust",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "${defaultBuildTask}",
|
||||
"env": {
|
||||
"IS_DEV": "true",
|
||||
@@ -35,8 +47,14 @@
|
||||
"name": "Run Extension (local)",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"args": ["--extensionDevelopmentPath=${workspaceFolder}", "--disable-workspace-trust", "${workspaceFolder}"],
|
||||
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"--disable-workspace-trust",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "${defaultBuildTask}",
|
||||
"env": {
|
||||
"IS_DEV": "true",
|
||||
@@ -57,7 +75,9 @@
|
||||
"--extensionDevelopmentPath=${workspaceFolder}",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "clean-tmp-user",
|
||||
"internalConsoleOptions": "openOnSessionStart",
|
||||
"postDebugTask": "stop",
|
||||
@@ -72,11 +92,18 @@
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Run cline-core service",
|
||||
"skipFiles": ["<node_internals>/**"],
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"sourceMaps": true,
|
||||
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"],
|
||||
"resolveSourceMapLocations": [
|
||||
"${workspaceFolder}/**",
|
||||
"!**/node_modules/**"
|
||||
],
|
||||
"cwd": "${workspaceFolder}/dist-standalone",
|
||||
"outFiles": ["${workspaceFolder}/dist-standalone/**/*.js"],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/dist-standalone/**/*.js"
|
||||
],
|
||||
"preLaunchTask": "compile-standalone",
|
||||
"env": {
|
||||
// Turns on grpc debug log.
|
||||
|
||||
Vendored
+21
-2
@@ -6,12 +6,31 @@
|
||||
},
|
||||
"search.exclude": {
|
||||
"out": true, // set this to false to include "out" folder in search results
|
||||
"dist": true // set this to false to include "dist" folder in search results
|
||||
"dist": true, // set this to false to include "dist" folder in search results,
|
||||
"node_modules": true,
|
||||
"dist-standalone": true
|
||||
},
|
||||
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
|
||||
"typescript.tsc.autoDetect": "off",
|
||||
"typescript.preferences.quoteStyle": "double",
|
||||
// Protobuf settings
|
||||
"protoc": {
|
||||
"options": ["--proto_path=proto"]
|
||||
"options": [
|
||||
"--proto_path=proto"
|
||||
]
|
||||
},
|
||||
// Enable Lint and format using Biome
|
||||
"biome.enabled": true,
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
},
|
||||
"[typescriptreact]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
},
|
||||
"[jsonc]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
},
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "biomejs.biome"
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+36
-10
@@ -30,7 +30,13 @@
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
"dependsOn": ["npm: protos", "npm: build:webview", "npm: dev:webview", "npm: watch:tsc", "npm: watch:esbuild"],
|
||||
"dependsOn": [
|
||||
"npm: protos",
|
||||
"npm: build:webview",
|
||||
"npm: dev:webview",
|
||||
"npm: watch:tsc",
|
||||
"npm: watch:esbuild"
|
||||
],
|
||||
"presentation": {
|
||||
"reveal": "always"
|
||||
},
|
||||
@@ -60,7 +66,9 @@
|
||||
"problemMatcher": [],
|
||||
"isBackground": true,
|
||||
"label": "npm: build:webview",
|
||||
"dependsOn": ["npm: protos"],
|
||||
"dependsOn": [
|
||||
"npm: protos"
|
||||
],
|
||||
"presentation": {
|
||||
"group": "watch",
|
||||
"reveal": "always"
|
||||
@@ -78,7 +86,9 @@
|
||||
"problemMatcher": [],
|
||||
"isBackground": true,
|
||||
"label": "npm: build:webview:test",
|
||||
"dependsOn": ["npm: protos"],
|
||||
"dependsOn": [
|
||||
"npm: protos"
|
||||
],
|
||||
"presentation": {
|
||||
"group": "watch",
|
||||
"reveal": "always"
|
||||
@@ -113,7 +123,9 @@
|
||||
],
|
||||
"isBackground": true,
|
||||
"label": "npm: dev:webview",
|
||||
"dependsOn": ["npm: protos"],
|
||||
"dependsOn": [
|
||||
"npm: protos"
|
||||
],
|
||||
"presentation": {
|
||||
"group": "watch",
|
||||
"reveal": "always"
|
||||
@@ -149,7 +161,9 @@
|
||||
},
|
||||
"isBackground": true,
|
||||
"label": "npm: watch:esbuild",
|
||||
"dependsOn": ["npm: protos"],
|
||||
"dependsOn": [
|
||||
"npm: protos"
|
||||
],
|
||||
"presentation": {
|
||||
"group": "watch",
|
||||
"reveal": "always"
|
||||
@@ -185,7 +199,9 @@
|
||||
},
|
||||
"isBackground": true,
|
||||
"label": "npm: watch:esbuild:test",
|
||||
"dependsOn": ["npm: protos"],
|
||||
"dependsOn": [
|
||||
"npm: protos"
|
||||
],
|
||||
"presentation": {
|
||||
"group": "watch",
|
||||
"reveal": "always"
|
||||
@@ -204,7 +220,9 @@
|
||||
"problemMatcher": "$tsc-watch",
|
||||
"isBackground": true,
|
||||
"label": "npm: watch:tsc",
|
||||
"dependsOn": ["npm: protos"],
|
||||
"dependsOn": [
|
||||
"npm: protos"
|
||||
],
|
||||
"presentation": {
|
||||
"group": "watch",
|
||||
"reveal": "always"
|
||||
@@ -215,7 +233,9 @@
|
||||
"script": "watch-tests",
|
||||
"problemMatcher": "$tsc-watch",
|
||||
"isBackground": true,
|
||||
"dependsOn": ["npm: protos"],
|
||||
"dependsOn": [
|
||||
"npm: protos"
|
||||
],
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"group": "watchers"
|
||||
@@ -224,7 +244,11 @@
|
||||
},
|
||||
{
|
||||
"label": "tasks: watch-tests",
|
||||
"dependsOn": ["npm: protos", "npm: watch", "npm: watch-tests"],
|
||||
"dependsOn": [
|
||||
"npm: protos",
|
||||
"npm: watch",
|
||||
"npm: watch-tests"
|
||||
],
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
@@ -235,7 +259,9 @@
|
||||
{
|
||||
"label": "clean-tmp-user",
|
||||
"type": "shell",
|
||||
"dependsOn": ["watch"],
|
||||
"dependsOn": [
|
||||
"watch"
|
||||
],
|
||||
"command": "rm -rf ${workspaceFolder}/dist/tmp/user && mkdir -p ${workspaceFolder}/dist/tmp/user"
|
||||
}
|
||||
],
|
||||
|
||||
+1
-1
@@ -61,6 +61,6 @@ old_docs/**
|
||||
!assets/icons/**
|
||||
|
||||
# Ignore E2E build files
|
||||
e2e-build.js
|
||||
e2e-build.mjs
|
||||
e2e.vsix
|
||||
test-results/
|
||||
|
||||
+163
@@ -1,5 +1,168 @@
|
||||
# Changelog
|
||||
|
||||
## [3.26.6]
|
||||
|
||||
- Add free Grok Coder model to Cline provider for users looking for a fast, free coding model option
|
||||
- Fix GPT-5 models not respecting auto-compact setting when enabled, improving context window management
|
||||
- Fix provider retry attempts not showing proper user feedback during rate limiting scenarios
|
||||
- Improve markdown and code block styling to automatically adapt when switching VS Code themes
|
||||
|
||||
## [3.26.5]
|
||||
|
||||
- fix (provider/vercel-ai-gateway): reduce model list load frequency in settings view
|
||||
- Fix OVSX publish command to resolve deployment failure
|
||||
|
||||
## [3.26.4]
|
||||
|
||||
- Update nebius ai studio models
|
||||
- Update sap provider - support reasoning effort for open ai models
|
||||
- Fix Claude 4 image input in SAP AI Core Provider
|
||||
|
||||
## [3.26.3]
|
||||
|
||||
- Add compact system prompt option for LM Studio and Ollama models, optimized for smaller context windows (8k or less)
|
||||
- Add token usage tracking for LM Studio models to better monitor API consumption
|
||||
- Add "Use compact prompt" checkbox in LM Studio provider settings
|
||||
- Fix "Unexpected API Response" bug with gpt-5
|
||||
|
||||
## [3.26.2]
|
||||
|
||||
- Improve OpenRouter model parsing to show reasoning budget sliders for all models that support thinking, not just Claude models
|
||||
- Fix OpenRouter context window error handling to properly extract error codes from error messages, resolving "Unexpected API Response" errors with GPT-5 on Cline provider
|
||||
- Fix GPT-5 context window configuration for OpenAI/OpenRouter/Cline providers to use correct 272K limit
|
||||
- Remove max tokens configuration from Sonic Alpha model
|
||||
- Add Go language support to deep-planning feature (Thanks @yuvalman!)
|
||||
- Fix typo in Focus Chain settings page (Thanks @joyceerhl!)
|
||||
|
||||
## [3.26.1]
|
||||
|
||||
- Add Vercel AI Gateway as a new API provider option (Thanks @joshualipman123!)
|
||||
- Improve SAP AI Core provider to show deployed and undeployed models in the UI (Thanks @yuvalman!)
|
||||
- Fix Fireworks provider configuration and functionality (Thanks @ershang-fireworks!)
|
||||
- Add telemetry tracking for MCP tool usage to help improve the extension
|
||||
- Improve telemetry tracking for rules and workflow usage analytics
|
||||
- Set Plan mode to use strict mode by default for better planning results
|
||||
|
||||
## [3.26.0]
|
||||
|
||||
- Add Z AI as a new API provider with GLM-4.5 and GLM-4.5 Air models, offering competitive performance with cost-effective pricing especially for Chinese language tasks (Thanks @jues!)
|
||||
- Add Cline Sonic Alpha model - experimental advanced model with 262K context window for complex coding tasks
|
||||
- Add support for LM Studio local models from v0 API endpoint with configurable max tokens
|
||||
- Fix Ollama context window configuration not being used in requests
|
||||
|
||||
## [3.25.3]
|
||||
|
||||
- Fix bug where 'Enable checkpoints' and 'Disable MCP Marketplace' settings would be reset to default on reload
|
||||
- Move the position of the focus chain edit button when a scrollbar is present. Make the pencil icon bigger and better centered.
|
||||
|
||||
## [3.25.2]
|
||||
|
||||
- Fix attempt_completion showing twice in chat due to partial logic not being handled correctly
|
||||
- Fix OpenRouter showing cline credits error after 402 response
|
||||
|
||||
## [3.25.1]
|
||||
|
||||
- Fix attempt_completion command showing twice in chat view when updating progress checklist
|
||||
- Fix bug where announcement banner could not be dismissed
|
||||
- Add GPT-OSS models to AWS Bedrock
|
||||
|
||||
## [3.25.0]
|
||||
|
||||
- **Focus Chain:** Automatically creates and maintains todo lists as you work with Cline, breaking down complex tasks into manageable steps with real-time progress tracking
|
||||
- **Auto Compact:** Intelligently manages conversation context to prevent token limit errors by automatically compacting older messages while preserving important context
|
||||
- **Deep Planning:** New `/deep-planning` slash command for structured 4-step implementation planning that integrates with Focus Chain for automatic progress tracking
|
||||
- Add support for 200k context window for Claude Sonnet 4 in OpenRouter and Cline providers
|
||||
- Add option to configure custom base URL for Requesty provider
|
||||
|
||||
## [3.24.0]
|
||||
|
||||
- Add OpenAI GPT-5 Chat(gpt-5-chat-latest)
|
||||
- Add custom browser arguments setting to allow passing flags to the Chrome executable for better headless compatibility.
|
||||
- Add 1m context window model support for claude sonnet 4
|
||||
- Fis the API Keys URL for Requesty
|
||||
- Set gpt5 max tokens to 8_192 to fix 'context window exceeded' error
|
||||
- Fix issue where fallback request to retrieve cost was not using correct auth token
|
||||
- Add OpenAI context window exceeded error handling
|
||||
- Calibrate input token counts when using anthropic models of sap ai core provider
|
||||
|
||||
## [3.23.0]
|
||||
|
||||
- Add caching support for Bedrock inferences using SAP AI Core and minor refactor
|
||||
- Improve visibility for mode switch background color on different themes
|
||||
- Fix terminal commands putting webview in blocked state
|
||||
|
||||
## [3.22.0]
|
||||
|
||||
- Implemented a retry strategy for Cerebras to handle rate limit issues due to its generation speed
|
||||
- Add support for GPT-5 models to SAP AI Core Provider
|
||||
- Support sending context to active webview when editor panels are opened.
|
||||
- Fix bug where running out of credits on Cline accounts would show '402 empty body' response instead of 'buy credits' component
|
||||
- Fix LiteLLM Proxy Provider Cost Tracking
|
||||
|
||||
## [3.21.0]
|
||||
|
||||
- Add support for GPT-5 model family including GPT-5, GPT-5 Mini, and GPT-5 Nano with prompt caching support and set GPT-5 as the new default model
|
||||
- Add "Take a Tour" button for new users to easily access the VSCode walkthrough and improve onboarding experience
|
||||
- Enhance plan mode response handling with better exploration parameter support
|
||||
|
||||
## [3.20.13]
|
||||
|
||||
- Fix prompt caching support for Opus 4.1 on OpenRouter/Cline
|
||||
|
||||
## [3.20.12]
|
||||
|
||||
- Add Claude Opus 4.1 model support to AWS Bedrock provider (Thanks @omercelik!)
|
||||
- Fix prompt caching and extended thinking support for Claude Opus 4.1 in Anthropic provider
|
||||
|
||||
## [3.20.11]
|
||||
|
||||
Add gpt-oss-120b as a Cerebras model
|
||||
Add Opus 4.1 through Claude Code
|
||||
|
||||
## [3.20.10]
|
||||
|
||||
- Add OpenAI's new open-source models (GPT-OSS-120B and GPT-OSS-20B) to Hugging Face and Groq providers
|
||||
|
||||
## [3.20.9]
|
||||
|
||||
- Add support for Claude Opus 4.1 model in Anthropic provider
|
||||
- Add Baseten as a new API provider with support for DeepSeek, Llama, and Kimi K2 models (Thanks @AlexKer!)
|
||||
- Fix error messages not clearing from UI when retrying failed tasks
|
||||
- Fix chat input box positioning issues
|
||||
|
||||
## [3.20.8]
|
||||
|
||||
- Add navbar tooltips on hover
|
||||
|
||||
## [3.20.7]
|
||||
|
||||
- Fix circular dependency that affect the github workflow Tests / test (pull_request)
|
||||
|
||||
## [3.20.6]
|
||||
|
||||
- Fix login check on extension restart
|
||||
|
||||
## [3.20.5]
|
||||
|
||||
- Fix authentication persistence issues that could cause users to be logged out unexpectedly
|
||||
|
||||
## [3.20.4]
|
||||
|
||||
- Add new Cerebras models
|
||||
- Update rate limits for existing Cerebras models
|
||||
- Fix for delete task dialog
|
||||
|
||||
## [3.20.3]
|
||||
|
||||
- Add Huawei Cloud MaaS Provider (Thanks @ddling!)
|
||||
- Add Cerebras Qwen 3 235B instruct model (Thanks @kevint-cerebras!)
|
||||
- Add DeepSeek R1 0528 support under Hugging Face (Thanks @0ne0rZer0!)
|
||||
- Fix Global Rules directory documentation for Linux/WSL systems
|
||||
- Fix token counting when using VSCode LM API provider
|
||||
- Fix input field stealing focus issue by only focusing on visible and active editor panels
|
||||
- Fix duplicate tool registration for claude4-experimental
|
||||
- Trim input value for URL fields
|
||||
|
||||
## [3.20.2]
|
||||
|
||||
- Fixed issue with sap ai core client credentials storage
|
||||
|
||||
+1
-1
@@ -147,7 +147,7 @@ Anyone can contribute code to Cline, but we ask that you follow these guidelines
|
||||
- Run `npm run lint` to check code style
|
||||
- Run `npm run format` to automatically format code
|
||||
- All PRs must pass CI checks which include both linting and formatting
|
||||
- Address any ESLint warnings or errors before submitting
|
||||
- Address any warnings or errors from linter before submitting
|
||||
- Follow TypeScript best practices and maintain type safety
|
||||
|
||||
3. **Testing**
|
||||
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.1.4/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
"useIgnoreFile": true,
|
||||
"defaultBranch": "main"
|
||||
},
|
||||
"assist": {
|
||||
"enabled": true,
|
||||
"actions": {
|
||||
"source": {
|
||||
"organizeImports": "on",
|
||||
"useSortedAttributes": "on"
|
||||
}
|
||||
}
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"domains": {
|
||||
"react": "recommended"
|
||||
},
|
||||
// Ideally we would want to turn on all the rules that are currently off,
|
||||
// keeping them off currently to make sure only changes on the migrations
|
||||
// are included in the initial PR before we apply the format and lint changes.
|
||||
// TODO: turn on all rules that are currently off if applicable.
|
||||
// TODO: Remove --diagnostic-level=error from CI commands.
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"correctness": {
|
||||
"useExhaustiveDependencies": "off",
|
||||
"noUndeclaredVariables": "off",
|
||||
"noEmptyPattern": "off",
|
||||
"useJsxKeyInIterable": "off",
|
||||
"noInnerDeclarations": "off",
|
||||
"useHookAtTopLevel": "off",
|
||||
"useYield": "off",
|
||||
"noConstructorReturn": "off",
|
||||
"noInvalidPositionAtImportRule": "off",
|
||||
"noSwitchDeclarations": "off"
|
||||
},
|
||||
"a11y": "off",
|
||||
"style": {
|
||||
"useNodejsImportProtocol": "off",
|
||||
"useImportType": "off",
|
||||
"useBlockStatements": "warn",
|
||||
"useNamingConvention": "off",
|
||||
"useThrowOnlyError": "info",
|
||||
"useConsistentArrayType": "off",
|
||||
"noParameterAssign": "off",
|
||||
"useAsConstAssertion": "off",
|
||||
"useDefaultParameterLast": "off",
|
||||
"noNonNullAssertion": "off",
|
||||
"useEnumInitializers": "off",
|
||||
"useSelfClosingElements": "off",
|
||||
"useSingleVarDeclarator": "off",
|
||||
"useNumberNamespace": "off",
|
||||
"noInferrableTypes": "off",
|
||||
"useTemplate": "off",
|
||||
"noUselessElse": "off"
|
||||
},
|
||||
"suspicious": {
|
||||
"noDoubleEquals": "warn",
|
||||
"noImplicitAnyLet": "info",
|
||||
"noThenProperty": "off",
|
||||
"noAsyncPromiseExecutor": "off",
|
||||
"noImportAssign": "off",
|
||||
"noExplicitAny": "off",
|
||||
"noControlCharactersInRegex": "off",
|
||||
"noShadowRestrictedNames": "off",
|
||||
"noArrayIndexKey": "info",
|
||||
"noAssignInExpressions": "warn"
|
||||
},
|
||||
"complexity": {
|
||||
"noUselessConstructor": "off",
|
||||
"useOptionalChain": "off",
|
||||
"noBannedTypes": "off",
|
||||
"useLiteralKeys": "off",
|
||||
"noUselessCatch": "off",
|
||||
"noUselessSwitchCase": "off",
|
||||
"noStaticOnlyClass": "off"
|
||||
},
|
||||
"security": {
|
||||
"noDangerouslySetInnerHtml": "warn"
|
||||
}
|
||||
}
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "tab",
|
||||
"indentWidth": 4,
|
||||
"lineWidth": 130,
|
||||
"lineEnding": "lf",
|
||||
"formatWithErrors": true
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"semicolons": "asNeeded",
|
||||
"arrowParentheses": "always",
|
||||
"bracketSameLine": true,
|
||||
"bracketSpacing": true,
|
||||
"jsxQuoteStyle": "double",
|
||||
"quoteProperties": "asNeeded",
|
||||
"trailingCommas": "all"
|
||||
}
|
||||
},
|
||||
"json": {
|
||||
"formatter": {
|
||||
"trailingCommas": "none",
|
||||
"expand": "always"
|
||||
}
|
||||
},
|
||||
"files": {
|
||||
"includes": [
|
||||
"**",
|
||||
"!**/dist/**",
|
||||
"!**/dist-*/**",
|
||||
"!**/out/**",
|
||||
"!**/evals/**",
|
||||
"!**/playwright/**",
|
||||
"!**/test-results/**",
|
||||
"!**/node_modules/**",
|
||||
"!**/webview-ui/build/**",
|
||||
"!**/generated/**",
|
||||
"!**/proto/**"
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
"src/dev/grit/process-env.grit"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"includes": [
|
||||
"**",
|
||||
"!**/hosts/vscode/**",
|
||||
"!**/test/**",
|
||||
"!src/extension.ts"
|
||||
],
|
||||
"plugins": [
|
||||
"src/dev/grit/vscode-api.grit"
|
||||
]
|
||||
},
|
||||
{
|
||||
"includes": [
|
||||
"**",
|
||||
"!src/core/storage/state-migrations.ts",
|
||||
"!src/core/storage/FileContextTracker.ts",
|
||||
"!src/core/context/context-tracking/FileContextTracker.ts",
|
||||
"!src/common.ts",
|
||||
"!src/core/storage/utils/state-helpers.ts",
|
||||
"!src/extension.ts"
|
||||
],
|
||||
"plugins": [
|
||||
"src/dev/grit/use-cache-service.grit"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+50
-14
@@ -57,18 +57,26 @@
|
||||
{
|
||||
"group": "Getting Started",
|
||||
"pages": [
|
||||
"getting-started/for-new-coders",
|
||||
"getting-started/installing-cline",
|
||||
"getting-started/installing-dev-essentials",
|
||||
"getting-started/what-is-cline",
|
||||
"getting-started/model-selection-guide",
|
||||
"getting-started/installing-cline",
|
||||
"getting-started/task-management",
|
||||
"getting-started/understanding-context-management",
|
||||
"getting-started/what-is-cline"
|
||||
{
|
||||
"group": "For New Coders",
|
||||
"pages": [
|
||||
"getting-started/for-new-coders",
|
||||
"getting-started/installing-dev-essentials"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Improving Your Prompting Skills",
|
||||
"pages": ["prompting/prompt-engineering-guide", "prompting/cline-memory-bank"]
|
||||
"pages": [
|
||||
"prompting/prompt-engineering-guide",
|
||||
"prompting/cline-memory-bank"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Features",
|
||||
@@ -79,6 +87,8 @@
|
||||
"features/drag-and-drop",
|
||||
"features/plan-and-act",
|
||||
"features/slash-commands/workflows",
|
||||
"features/focus-chain",
|
||||
"features/auto-compact",
|
||||
"features/editing-messages",
|
||||
{
|
||||
"group": "@ Mentions",
|
||||
@@ -97,7 +107,8 @@
|
||||
"features/slash-commands/new-task",
|
||||
"features/slash-commands/new-rule",
|
||||
"features/slash-commands/smol",
|
||||
"features/slash-commands/report-bug"
|
||||
"features/slash-commands/report-bug",
|
||||
"features/slash-commands/deep-planning"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -146,21 +157,32 @@
|
||||
"pages": [
|
||||
"provider-config/anthropic",
|
||||
"provider-config/claude-code",
|
||||
"provider-config/aws-bedrock-with-apikey-authentication",
|
||||
"provider-config/aws-bedrock-with-credentials-authentication",
|
||||
"provider-config/aws-bedrock-with-profile-authentication",
|
||||
{
|
||||
"group": "AWS Bedrock",
|
||||
"pages": [
|
||||
"provider-config/aws-bedrock/api-key",
|
||||
"provider-config/aws-bedrock/iam-credentials",
|
||||
"provider-config/aws-bedrock/cli-profile"
|
||||
]
|
||||
},
|
||||
"provider-config/gcp-vertex-ai",
|
||||
"provider-config/litellm-and-cline-using-codestral",
|
||||
"provider-config/vscode-language-model-api",
|
||||
"provider-config/xai-grok",
|
||||
"provider-config/mistral-ai",
|
||||
"provider-config/deepseek",
|
||||
"provider-config/groq",
|
||||
"provider-config/cerebras",
|
||||
"provider-config/doubao",
|
||||
"provider-config/fireworks",
|
||||
"provider-config/zai",
|
||||
"provider-config/ollama",
|
||||
"provider-config/openai",
|
||||
"provider-config/openai-compatible",
|
||||
"provider-config/openrouter",
|
||||
"provider-config/requesty",
|
||||
"provider-config/sap-aicore"
|
||||
"provider-config/sap-aicore",
|
||||
"provider-config/vercel-ai-gateway",
|
||||
"provider-config/requesty"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -173,11 +195,16 @@
|
||||
},
|
||||
{
|
||||
"group": "Troubleshooting",
|
||||
"pages": ["troubleshooting/terminal-quick-fixes", "troubleshooting/terminal-integration-guide"]
|
||||
"pages": [
|
||||
"troubleshooting/terminal-quick-fixes",
|
||||
"troubleshooting/terminal-integration-guide"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "More Info",
|
||||
"pages": ["more-info/telemetry"]
|
||||
"pages": [
|
||||
"more-info/telemetry"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -188,10 +215,19 @@
|
||||
"discord": "https://discord.gg/cline"
|
||||
}
|
||||
},
|
||||
"anchors": [
|
||||
{
|
||||
"name": "What is Cline",
|
||||
"icon": "house",
|
||||
"url": "getting-started/what-is-cline"
|
||||
}
|
||||
],
|
||||
"search": {
|
||||
"prompt": "Search Cline documentation..."
|
||||
},
|
||||
"contextual": {
|
||||
"options": ["copy"]
|
||||
"options": [
|
||||
"copy"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
---
|
||||
title: "Automatic Context Summarization"
|
||||
sidebarTitle: "Auto Compact"
|
||||
---
|
||||
|
||||
When your conversation approaches the model's context window limit, Cline automatically summarizes it to free up space and keep working.
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/condensing.png"
|
||||
alt="Auto-compact feature condensing conversation context"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
## How It Works
|
||||
|
||||
Cline monitors token usage during your conversation. When you're getting close to the limit, he:
|
||||
|
||||
1. Creates a comprehensive summary of everything that's happened
|
||||
2. Preserves all the technical details, code changes, and decisions
|
||||
3. Replaces the conversation history with the summary
|
||||
4. Continues exactly where he left off
|
||||
|
||||
You'll see a summarization tool call when this happens, showing the total cost like any other api call in the chat view.
|
||||
|
||||
## Why This Matters
|
||||
|
||||
Previously, Cline would truncate older messages when hitting context limits. This meant losing important context from earlier in the conversation.
|
||||
|
||||
Now with summarization:
|
||||
- All technical decisions and code patterns are preserved
|
||||
- File changes and project context remain intact
|
||||
- Cline remembers everything he's done
|
||||
- You can work on much larger projects without interruption
|
||||
|
||||
<Tip>
|
||||
Context Summarization synergizes beautifully with [Focus Chain](/features/focus-chain). When Focus Chain is enabled, todo lists persist across summarizations. This means Cline can work on long-horizon tasks that span multiple context windows while staying on track with the todo list guiding him through each reset.
|
||||
</Tip>
|
||||
|
||||
## Technical Details
|
||||
|
||||
The summarization happens through your configured API provider using the same model you're already using. It leverages prompt caching to minimize costs.
|
||||
|
||||
1. Cline uses a [summarization prompt](https://github.com/cline/cline/blob/main/src/core/prompts/contextManagement.ts) to request a summary of the conversation.
|
||||
|
||||
2. Once the summary is generated, Cline replaces the conversation history with a [continuation prompt](https://github.com/cline/cline/blob/main/src/core/prompts/contextManagement.ts#L69) that asks Cline to keep working and provides the summary as context.
|
||||
|
||||
Different models have different context window thresholds for when auto-summarization kicks in. You can see how thresholds are determined in [context-window-utils.ts](https://github.com/cline/cline/blob/main/src/core/context/context-management/context-window-utils.ts).
|
||||
|
||||
## Cost Considerations
|
||||
|
||||
Summarization leverages your existing prompt cache from the conversation, so it costs about the same as any other tool call.
|
||||
|
||||
Since most input tokens are already cached, you're primarily paying for the summary generation (output tokens), making it very cost-effective.
|
||||
|
||||
## Restoring Context with Checkpoints
|
||||
|
||||
You can use [checkpoints](/features/checkpoints) to restore your task state from before a summarization occurred. This means you never truly lose context - you can always roll back to previous versions of your conversation.
|
||||
|
||||
<Note>
|
||||
Editing a message before a summarization tool call will work similarly to a checkpoint, allowing you to restore the conversation to that point.
|
||||
</Note>
|
||||
|
||||
## Next Generation Model Support
|
||||
|
||||
Auto Compact uses advanced LLM-based summarization which we've found works significantly better for next-generation models. We currently support this feature for the following models:
|
||||
|
||||
- **Claude 4 series**
|
||||
- **Gemini 2.5 series**
|
||||
- **GPT-5**
|
||||
- **Grok 4**
|
||||
|
||||
<Note>
|
||||
When using other models, Cline automatically falls back to the standard rule-based context truncation method, even if Auto Compact is enabled in settings.
|
||||
</Note>
|
||||
@@ -5,10 +5,28 @@ sidebarTitle: "Drag & Drop"
|
||||
|
||||
Dragging and dropping files into Cline is a quick way to add images, code, and other files to your conversations.
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/dran-n-drop.gif"
|
||||
alt="Dragging and dropping files into Cline chat"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
<Note>Due to VS Code quirks, to drag and drop files into the Cline chat input, you need to hold `Shift` while dragging.</Note>
|
||||
|
||||
Dragging and dropping workspace files into Cline will automatically create a [file mention](/features/at-mentions/file-mentions). This allows you to reference the file in your conversation without needing to type out the path.
|
||||
|
||||
### Dragging from Finder/File Explorer
|
||||
|
||||
You can drag files directly from your system's file manager into Cline:
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/drag-n-drop-finder.gif"
|
||||
alt="Dragging files from Finder into Cline"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
### Supported File Types
|
||||
|
||||
Cline supports dragging external images from your file system, as well as files from your workspace.
|
||||
Cline supports dragging external images, pdfs, csv, excel, and other text files from your file system, as well as files from your workspace.
|
||||
|
||||
@@ -0,0 +1,303 @@
|
||||
---
|
||||
title: "Focus Chain"
|
||||
sidebarTitle: "Focus Chain"
|
||||
---
|
||||
|
||||
Focus Chain is a task management enhancement feature in Cline that provides automatic todo list management with real-time progress tracking throughout your tasks.
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/2dos.gif"
|
||||
alt="Focus Chain todo list management with real-time progress tracking"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
This enables Cline to work on long-horizon tasks, seamlessly managing the context sent to LLMs, and keeping Cline on track across many context window resets.
|
||||
|
||||
<Tip>
|
||||
Focus Chain works particularly well with Cline's [Deep Planning slash command](/features/slash-commands/deep-planning), providing seamless progress tracking for implementation tasks created through the [planning process](/features/plan-and-act).
|
||||
</Tip>
|
||||
|
||||
## Key Features
|
||||
|
||||
### Automatic Todo List Generation
|
||||
|
||||
Cline analyzes your task and automatically creates a comprehensive todo list with:
|
||||
- Clear, actionable items in markdown checklist format
|
||||
- Logical breakdown of complex tasks into manageable steps
|
||||
- Real-time updates as work progresses
|
||||
|
||||
### User-Editable Todo Lists
|
||||
|
||||
Todo lists are stored as editable markdown files:
|
||||
- Direct editing through your preferred markdown editor
|
||||
- Automatic detection of changes you make
|
||||
- Seamless integration back into Cline's workflow
|
||||
- Quick access through the edit button in the task header
|
||||
|
||||
### Visual Progress Tracking
|
||||
|
||||
The task header displays clear progress indicators:
|
||||
- **Step counters** showing current progress (e.g., "3/8")
|
||||
- **Completed items** clearly marked with checkmarks
|
||||
- **Current work** highlighted with indicators
|
||||
- **Expandable view** to see the full todo list
|
||||
|
||||
### Smart Reminder System
|
||||
|
||||
Configurable reminders ensure todo lists stay current:
|
||||
- Default reminder every 6 messages (customizable 1-100)
|
||||
- Automatic prompts when switching from Plan Mode to Act Mode
|
||||
- User-triggered updates when todo lists are manually edited
|
||||
|
||||
|
||||
## Getting Started
|
||||
|
||||
<Steps>
|
||||
<Step title="Open Cline Settings">
|
||||
- Click the gear icon in the Cline sidebar
|
||||
- Navigate to the "Features" section
|
||||
</Step>
|
||||
<Step title="Enable Focus Chain">
|
||||
- Check "Enable Focus Chain"
|
||||
- Optionally adjust "Remind Cline Interval" (default: 6 messages)
|
||||
</Step>
|
||||
<Step title="Start a New Task">
|
||||
- Begin a new task
|
||||
- Cline will automatically start creating and managing todo lists
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
| Setting | Default | Range | Description |
|
||||
|---------|---------|-------|-------------|
|
||||
| Enable Focus Chain | Disabled | On/Off | Enables enhanced task progress tracking |
|
||||
| Remind Cline Interval | 6 | 1-100 messages | How often Cline updates the todo list |
|
||||
|
||||
## Usage Examples
|
||||
|
||||
#### 1. Task Initiation
|
||||
|
||||
When you start a new task with Focus Chain enabled:
|
||||
|
||||
``` markdown User Request
|
||||
User: "Create a user authentication system for my React app"
|
||||
|
||||
Cline: [Analyzes request and creates todo list]
|
||||
```
|
||||
|
||||
#### 2. Todo List Created
|
||||
|
||||
Cline creates a comprehensive plan for the task, stored in a markdown file:
|
||||
|
||||
```markdown Todo List Created
|
||||
- [ ] Set up project structure
|
||||
- [ ] Install authentication dependencies
|
||||
- [ ] Create user registration component
|
||||
- [ ] Implement login functionality
|
||||
- [ ] Add password validation
|
||||
- [ ] Set up user database schema
|
||||
- [ ] Write authentication tests
|
||||
- [ ] Deploy to staging environment
|
||||
```
|
||||
|
||||
#### 3. Progress Tracking
|
||||
|
||||
As Cline works, the task header shows real-time progress:
|
||||
|
||||
```markdown Todo List Header
|
||||
[3/8] Implement login functionality ⌄
|
||||
```
|
||||
|
||||
Click to expand and see the full list:
|
||||
|
||||
```markdown Full Todo List
|
||||
✓ Set up project structure
|
||||
✓ Install authentication dependencies
|
||||
✓ Create user registration component
|
||||
○ Implement login functionality ← Currently working
|
||||
○ Add password validation
|
||||
○ Set up user database schema
|
||||
○ Write authentication tests
|
||||
○ Deploy to staging environment
|
||||
```
|
||||
|
||||
#### 4. User Editing
|
||||
|
||||
Need to tweak the todo list? No problem.
|
||||
|
||||
<Steps>
|
||||
<Step title="Open the todo list">
|
||||
Click the edit button in the expanded todo view
|
||||
</Step>
|
||||
<Step title="Edit the markdown file">
|
||||
A markdown file opens in your editor:
|
||||
|
||||
```markdown Editing Todo List
|
||||
# Focus Chain Todo List for Task abc123
|
||||
|
||||
<!-- Edit this markdown file to update your focus chain todo list -->
|
||||
<!-- Use - [ ] for incomplete items and - [x] for completed items -->
|
||||
|
||||
- [x] Set up project structure
|
||||
- [x] Install authentication dependencies (e.g., Firebase Auth)
|
||||
- [x] Create user registration component
|
||||
- [ ] Implement login functionality
|
||||
- [ ] Add password reset feature
|
||||
- [ ] Set up protected routes
|
||||
- [ ] Implement logout functionality
|
||||
- [ ] Add user profile page
|
||||
- [ ] Write authentication tests
|
||||
- [ ] Deploy to staging environment
|
||||
|
||||
<!-- Save this file to update the task's todo list -->
|
||||
```
|
||||
</Step>
|
||||
<Step title="Make your changes">
|
||||
Add, remove, or reorder items as needed
|
||||
</Step>
|
||||
<Step title="Save the file">
|
||||
Cline automatically detects and uses your updates
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## File Structure
|
||||
|
||||
### Todo List Storage
|
||||
|
||||
Todo lists are stored as markdown files in your task directory:
|
||||
|
||||
``` markdown
|
||||
<VSCode Global Storage>/
|
||||
tasks/
|
||||
<taskId>/
|
||||
focus_chain_taskid_<taskId>.md
|
||||
... other task files
|
||||
```
|
||||
|
||||
### Markdown Format
|
||||
|
||||
Todo files use standard markdown checklist syntax:
|
||||
|
||||
```markdown Example Todo Syntax
|
||||
# Focus Chain Todo List for Task abc123
|
||||
|
||||
<!-- Edit this markdown file to update your focus chain todo list -->
|
||||
<!-- Use the format: - [ ] for incomplete items and - [x] for completed items -->
|
||||
|
||||
- [x] Set up project structure
|
||||
- [x] Install authentication dependencies
|
||||
- [ ] Create user registration component
|
||||
- [ ] Implement login functionality
|
||||
- [ ] Add password validation
|
||||
- [ ] Set up user database schema
|
||||
- [ ] Write authentication tests
|
||||
- [ ] Deploy to staging environment
|
||||
|
||||
<!-- Save this file and the todo list will be updated in the task -->
|
||||
```
|
||||
|
||||
|
||||
## Integration with Plan/Act Mode
|
||||
|
||||
Focus Chain works seamlessly with Cline's [Plan/Act mode](/features/plan-and-act):
|
||||
|
||||
- **Plan Mode**: Optional todo lists for presenting concrete steps
|
||||
- **Act Mode**: Automatic todo creation when switching from Plan Mode
|
||||
|
||||
<Tip>
|
||||
For complex projects, start in Plan Mode to discuss and refine your approach before switching to Act Mode for implementation.
|
||||
</Tip>
|
||||
|
||||
## Best Practices
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="For Effective Todo Lists">
|
||||
1. **Start with Clear Requests**
|
||||
- Provide detailed initial task descriptions
|
||||
- Include specific requirements and constraints
|
||||
- Mention any preferred technologies or approaches
|
||||
|
||||
2. **Review Generated Lists**
|
||||
- Check that Cline's breakdown aligns with your expectations
|
||||
- Verify that all important steps are included
|
||||
- Ensure the order makes sense for your project
|
||||
|
||||
3. **Edit When Needed**
|
||||
- Add missing steps you identify
|
||||
- Remove unnecessary items
|
||||
- Reorder steps for better workflow
|
||||
- Add more specific details to general items
|
||||
</Accordion>
|
||||
<Accordion title="For Complex Projects">
|
||||
1. **Use Plan Mode First**
|
||||
- Discuss the approach before implementation
|
||||
- Refine requirements through conversation
|
||||
- Switch to Act Mode when ready to begin work
|
||||
|
||||
2. **Break Down Large Tasks**
|
||||
- Split complex projects into smaller, manageable tasks
|
||||
- Create separate todo lists for different components
|
||||
- Focus on one major area at a time
|
||||
|
||||
3. **Regular Reviews**
|
||||
- Check progress periodically during long tasks
|
||||
- Update todo lists as requirements evolve
|
||||
- Communicate changes to Cline through edits
|
||||
</Accordion>
|
||||
<Accordion title="For Collaboration">
|
||||
1. **Share Todo Files**
|
||||
- Todo markdown files can be shared with team members
|
||||
- Include in version control for project documentation
|
||||
- Use as basis for project planning discussions
|
||||
|
||||
2. **Consistent Format**
|
||||
- Follow the standard markdown checklist format
|
||||
- Keep item descriptions clear and actionable
|
||||
- Use consistent terminology across todo lists
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Having issues? Try these quick fixes:
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Todo list not updating?">
|
||||
- Check that Focus Chain is enabled in settings
|
||||
- Focus Chain may not work as well with smaller, less capable models
|
||||
- Ensure file permissions are correct in the task directory
|
||||
</Accordion>
|
||||
<Accordion title="Can't edit todo file?">
|
||||
- Verify your editor supports markdown
|
||||
- Check VSCode has write permissions for the directory
|
||||
</Accordion>
|
||||
<Accordion title="Progress not displaying?">
|
||||
- Ensure todo items use correct syntax (`- [ ]` and `- [x]`)
|
||||
- Verify the markdown file is properly formatted
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
Still stuck? Use the [/reportbug](/features/slash-commands/report-bug) command in Cline to get help.
|
||||
|
||||
## Technical Details (for the curious)
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="File Monitoring">
|
||||
- Real-time file watching detects changes to todo markdown files
|
||||
- Automatic synchronization between file edits and UI updates
|
||||
- Graceful handling of file creation, modification, and deletion
|
||||
</Accordion>
|
||||
<Accordion title="Progress Calculation">
|
||||
- Dynamic counting of completed vs. total todo items
|
||||
- Support for both `- [x]` and `- [X]` completion syntax
|
||||
- Unicode symbols (✓, ○) for enhanced visual display
|
||||
</Accordion>
|
||||
<Accordion title="Privacy Considerations">
|
||||
- Todo lists stored locally in VSCode workspace
|
||||
- No todo content transmitted to external services
|
||||
- Usage telemetry (can be disabled in settings)
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
Focus Chain turns Cline into your personal project manager, keeping you on track and your tasks organized. Give it a try on your next project!
|
||||
@@ -0,0 +1,160 @@
|
||||
---
|
||||
title: "Deep Planning Command"
|
||||
sidebarTitle: "/deep-planning"
|
||||
---
|
||||
|
||||
`/deep-planning` transforms Cline into a meticulous architect who investigates your codebase, asks clarifying questions, and creates a comprehensive implementation plan before writing a single line of code.
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/deep-planning.png"
|
||||
alt="Deep Planning command in action showing investigation and planning process"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
When you use `/deep-planning`, Cline follows a four-step process that mirrors how senior developers approach complex features: thorough investigation, discussion & clarification of requirements, detailed planning, and structured task creation with progress tracking.
|
||||
|
||||
## The Four-Step Process
|
||||
|
||||
### Step 1: Silent Investigation
|
||||
|
||||
Cline becomes a detective, silently exploring your codebase to understand its structure, patterns, and constraints. He examines source files, analyzes import patterns, discovers class hierarchies, and identifies technical debt markers. No commentary, no narration - just focused research.
|
||||
|
||||
During this phase, Cline runs commands like:
|
||||
- Finding all class and function definitions across your codebase
|
||||
- Analyzing import patterns to understand dependencies
|
||||
- Discovering project structure and file organization
|
||||
- Identifying TODOs and technical debt
|
||||
|
||||
### Step 2: Discussion and Questions
|
||||
|
||||
Once Cline understands your codebase, he asks targeted questions that will shape the implementation. These aren't generic questions - they're specific to your project and the feature you're building.
|
||||
|
||||
Questions might cover:
|
||||
- Clarifying ambiguous requirements
|
||||
- Choosing between equally valid implementation approaches
|
||||
- Confirming assumptions about system behavior
|
||||
- Understanding preferences for technical decisions
|
||||
|
||||
### Step 3: Implementation Plan Document
|
||||
|
||||
Cline creates a structured markdown document (`implementation_plan.md`) that serves as your implementation blueprint. This isn't a vague outline - it's a detailed specification with exact file paths, function signatures, and implementation order.
|
||||
|
||||
The plan includes eight comprehensive sections:
|
||||
- **Overview**: The goal and high-level approach
|
||||
- **Types**: Complete type definitions and data structures
|
||||
- **Files**: Exact files to create, modify, or delete
|
||||
- **Functions**: New and modified functions with signatures
|
||||
- **Classes**: Class modifications and inheritance details
|
||||
- **Dependencies**: Package requirements and versions
|
||||
- **Testing**: Validation strategies and test requirements
|
||||
- **Implementation Order**: Step-by-step execution sequence
|
||||
|
||||
### Step 4: Implementation Task Creation
|
||||
|
||||
Cline creates a new task that references the plan document and includes trackable implementation steps. The task comes with specific commands to read each section of the plan, ensuring the implementing agent (whether that's you or Cline in Act Mode) can navigate the blueprint efficiently.
|
||||
|
||||
<Tip>
|
||||
Deep Planning works beautifully with [Focus Chain](/features/focus-chain). The implementation steps automatically become a todo list with real-time progress tracking, keeping complex projects organized and on track.
|
||||
</Tip>
|
||||
|
||||
## Using Deep Planning
|
||||
|
||||
Start a deep planning session by typing `/deep-planning` followed by your feature description:
|
||||
|
||||
```
|
||||
/deep-planning Add user authentication with JWT tokens and role-based access control
|
||||
```
|
||||
|
||||
Cline will begin his investigation immediately. You'll see him reading files and running commands to understand your codebase. Once he's gathered enough context, he'll engage you in discussion before creating the plan.
|
||||
|
||||
## Example Workflow
|
||||
|
||||
Here's how I use `/deep-planning` for a real feature:
|
||||
|
||||
<Steps>
|
||||
<Step title="Initiate Planning">
|
||||
I type `/deep-planning implement a caching layer for API responses`
|
||||
</Step>
|
||||
<Step title="Silent Investigation">
|
||||
Cline explores my codebase, examining:
|
||||
- Current API structure and endpoints
|
||||
- Existing data flow patterns
|
||||
- Database queries and performance bottlenecks
|
||||
- Configuration and environment setup
|
||||
</Step>
|
||||
<Step title="Targeted Discussion">
|
||||
Cline asks me:
|
||||
- "Should we use Redis or in-memory caching?"
|
||||
- "What's the acceptable cache staleness for user data?"
|
||||
- "Do you need cache invalidation webhooks?"
|
||||
</Step>
|
||||
<Step title="Plan Creation">
|
||||
Cline generates `implementation_plan.md` with:
|
||||
- Cache service class specifications
|
||||
- Redis connection configuration
|
||||
- Modified API endpoints with caching logic
|
||||
- Cache key generation strategies
|
||||
- TTL configurations for different data types
|
||||
</Step>
|
||||
<Step title="Task Generation">
|
||||
Cline creates a new task with:
|
||||
- Reference to the implementation plan
|
||||
- Commands to read specific sections
|
||||
- Trackable todo items for each implementation step
|
||||
- Request to switch to Act Mode for execution
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Integration with Plan/Act Mode
|
||||
|
||||
Deep Planning is designed to work seamlessly with [Plan/Act Mode](/features/plan-and-act):
|
||||
|
||||
- Use `/deep-planning` in Plan Mode for the investigation and planning phases
|
||||
- The generated task requests switching to Act Mode for implementation
|
||||
- Focus Chain automatically tracks progress through the implementation steps
|
||||
|
||||
This separation ensures planning stays focused on architecture while implementation stays focused on execution.
|
||||
|
||||
## Best Practices
|
||||
|
||||
### When to Use Deep Planning
|
||||
|
||||
Use `/deep-planning` for:
|
||||
- Features touching multiple parts of your codebase
|
||||
- Architectural changes requiring careful coordination
|
||||
- Complex integrations with external services
|
||||
- Refactoring efforts that need systematic execution
|
||||
- Any feature where you'd normally spend time whiteboarding
|
||||
|
||||
### Making the Most of Investigation
|
||||
|
||||
Let Cline complete his investigation thoroughly. The quality of the plan directly correlates with how well he understands your codebase. If you have specific areas he should examine, mention them in your initial request.
|
||||
|
||||
### Reviewing the Plan
|
||||
|
||||
Always review `implementation_plan.md` before starting implementation. The plan is comprehensive but not immutable - you can edit it directly if needed. Think of it as a collaborative document between you and Cline.
|
||||
|
||||
### Tracking Progress
|
||||
|
||||
With Focus Chain enabled, your implementation progress displays in the task header. Each completed step gets checked off automatically as Cline works through the plan, giving you real-time visibility into complex implementations.
|
||||
|
||||
## Inspiration
|
||||
|
||||
I use `/deep-planning` whenever I'm about to build something that would normally require a design document. Recent examples from my workflow:
|
||||
|
||||
- **Migrating authentication systems**: Deep Planning mapped every endpoint, identified all authentication touchpoints, and created a migration plan that avoided breaking changes.
|
||||
|
||||
- **Adding real-time features**: The plan covered WebSocket integration, event handling, state synchronization, and fallback mechanisms for disconnections.
|
||||
|
||||
- **Database schema refactoring**: Cline identified all affected queries, created migration scripts, and planned the rollout to minimize downtime.
|
||||
|
||||
- **API versioning implementation**: The plan detailed route changes, backward compatibility layers, deprecation notices, and client migration paths.
|
||||
|
||||
The power of `/deep-planning` is that it forces thoughtful architecture before implementation. It's like having a senior developer review your approach before you write code, except that developer has perfect knowledge of your entire codebase.
|
||||
|
||||
<Note>
|
||||
Deep Planning requires models with strong reasoning capabilities. It works best with the latest generation of models, like GPT-5, Claude 4, Gemini 2.5, or Grok 4. Smaller models may struggle with the comprehensive analysis required.
|
||||
</Note>
|
||||
|
||||
For simpler tasks that don't require extensive planning, consider using [/newtask](/features/slash-commands/new-task) to create focused tasks with context, or jump straight into implementation if the path forward is clear.
|
||||
@@ -3,9 +3,9 @@ title: "For New Coders"
|
||||
description: "Welcome to Cline, your AI-powered coding companion! This guide will help you quickly set up your development environment and begin your coding journey with ease."
|
||||
---
|
||||
|
||||
> 💡 **Tip:** If you're completely new to coding, take your time with each step. There's no rush — Cline is here to guide you!
|
||||
> **Tip:** If you're completely new to coding, take your time with each step. There's no rush — Cline is here to guide you!
|
||||
|
||||
### 🚀 Getting Started
|
||||
### Getting Started
|
||||
|
||||
Before you jump into coding, make sure you have these essentials ready:
|
||||
|
||||
@@ -15,9 +15,9 @@ A popular, free, and powerful code editor.
|
||||
|
||||
- [<u>Download VS Code</u>](https://code.visualstudio.com/)
|
||||
|
||||
📺 **Recommended YouTube Tutorial:** [<u>How to Install VS Code</u>](https://www.youtube.com/watch?v=MlIzFUI1QGA)
|
||||
**Recommended YouTube Tutorial:** [<u>How to Install VS Code</u>](https://www.youtube.com/watch?v=MlIzFUI1QGA)
|
||||
|
||||
> ✅ **Pro Tip:** Install VS Code in your Applications folder (macOS) or Program Files (Windows) for easy access from your dock or start menu.
|
||||
> **Pro Tip:** Install VS Code in your Applications folder (macOS) or Program Files (Windows) for easy access from your dock or start menu.
|
||||
|
||||
#### 2. **Organize Your Projects**
|
||||
|
||||
@@ -31,7 +31,7 @@ Inside your `Cline` folder, structure projects clearly:
|
||||
- `Documents/Cline/workout-app` _(e.g., for a fitness tracking app)_
|
||||
- `Documents/Cline/portfolio-website` _(e.g., to showcase your work)_
|
||||
|
||||
> 💡 **Tip:** Keeping your projects organized from the start will save you time and confusion later!
|
||||
> **Tip:** Keeping your projects organized from the start will save you time and confusion later!
|
||||
|
||||
#### 3. **Install the Cline VS Code Extension**
|
||||
|
||||
@@ -39,9 +39,9 @@ Enhance your coding workflow by installing the Cline extension directly within V
|
||||
|
||||
- Get Started with Cline Extension Tutorial
|
||||
|
||||
📺 **Recommended YouTube Tutorial:** [<u>How To Install Extensions in VS Code</u>](https://www.youtube.com/watch?v=E7trgwZa-mk)
|
||||
**Recommended YouTube Tutorial:** [<u>How To Install Extensions in VS Code</u>](https://www.youtube.com/watch?v=E7trgwZa-mk)
|
||||
|
||||
> ✅ **Pro Tip:** After installing, reload VS Code to ensure the extension is activated properly.
|
||||
> **Pro Tip:** After installing, reload VS Code to ensure the extension is activated properly.
|
||||
|
||||
#### 4. **Essential Development Tools**
|
||||
|
||||
@@ -51,9 +51,9 @@ Basic software required for coding efficiently:
|
||||
- Node.js
|
||||
- Git
|
||||
|
||||
👉 [<u>Follow our detailed guide on Installing Essential Development Tools with step-by-step help from Cline.</u>](https://docs.cline.bot/getting-started/installing-dev-essentials#installing-dev-essentials)
|
||||
[<u>Follow our detailed guide on Installing Essential Development Tools with step-by-step help from Cline.</u>](https://docs.cline.bot/getting-started/installing-dev-essentials#installing-dev-essentials)
|
||||
|
||||
📺 **Recommended YouTube Tutorials for Manual Installation:**
|
||||
**Recommended YouTube Tutorials for Manual Installation:**
|
||||
|
||||
- **For macOS:**
|
||||
- [<u>Install Homebrew on Mac</u>](https://www.youtube.com/watch?v=hwGNgVbqasc)
|
||||
@@ -63,6 +63,6 @@ Basic software required for coding efficiently:
|
||||
- [<u>Install Git on Windows 10/11 (2024)</u>](https://www.youtube.com/watch?v=yjxv1HuRQy0)
|
||||
- [<u>Install Node.js in Windows 10/11</u>](https://www.youtube.com/watch?v=uCgAuOYpJd0)
|
||||
|
||||
> ⚠️ **Note:** If you run into permission issues during installation, try running your terminal or command prompt as an administrator.
|
||||
> **Note:** If you run into permission issues during installation, try running your terminal or command prompt as an administrator.
|
||||
|
||||
🎉 You're all set! Dive in and start coding smarter and faster with **Cline**.
|
||||
You're all set! Dive in and start coding smarter and faster with **Cline**.
|
||||
|
||||
@@ -9,13 +9,13 @@ description: "Cline is a VS Code extension that brings AI-powered coding assista
|
||||
- **VS Code Marketplace (Recommended):** Fastest method for standard VS Code and Cursor users.
|
||||
- **Open VSX Registry:** For VS Code-compatible editors like VSCodium.
|
||||
|
||||
### 🛠️ VS Code Marketplace: Step-by-Step Setup
|
||||
### VS Code Marketplace: Step-by-Step Setup
|
||||
|
||||
Follow these steps to get Cline up and running:
|
||||
|
||||
1. **Open VS Code:** Launch the VS Code application.
|
||||
|
||||
> ⚠️ **Note:** If VS Code shows "Running extensions might...", click "Allow".
|
||||
> **Note:** If VS Code shows "Running extensions might...", click "Allow".
|
||||
|
||||
2. **Open Your Cline Folder:** In VS Code, open the Cline folder you created in Documents.
|
||||
3. **Navigate to Extensions:** Click on the Extensions icon in the Activity Bar on the side of VS Code (`Ctrl + Shift + X` or `Cmd + Shift + X`).
|
||||
@@ -34,9 +34,9 @@ Follow these steps to get Cline up and running:
|
||||
- Or, use the command palette (`Ctrl/Cmd + Shift + P`) and type "Cline: Open In New Tab" for a better view.
|
||||
3. **Troubleshooting:** If you don't see the Cline icon, try restarting VS Code.
|
||||
|
||||
> ✅ **Pro Tip:** You should see the Cline chat window appear in your VS Code editor!
|
||||
> **Pro Tip:** You should see the Cline chat window appear in your VS Code editor!
|
||||
|
||||
### 🌐 Open VSX Registry
|
||||
### Open VSX Registry
|
||||
|
||||
For VS Code-compatible editors without Marketplace access (like VSCodium and Windsurf):
|
||||
|
||||
@@ -46,7 +46,7 @@ For VS Code-compatible editors without Marketplace access (like VSCodium and Win
|
||||
4. Select "Cline" by saoudrizwan and click **Install**.
|
||||
5. Reload if prompted.
|
||||
|
||||
### 👤 Creating Your Cline Account
|
||||
### Creating Your Cline Account
|
||||
|
||||
Now that you have Cline installed, let's get you set up with your account:
|
||||
|
||||
@@ -61,7 +61,7 @@ Now that you have Cline installed, let's get you set up with your account:
|
||||
- Google Gemini 2.0 Flash
|
||||
- And more — all through your Cline account.
|
||||
|
||||
### 💻 Your First Interaction with Cline
|
||||
### Your First Interaction with Cline
|
||||
|
||||
You're ready to start building! Copy and paste this prompt into the Cline chat window:
|
||||
|
||||
@@ -69,15 +69,15 @@ You're ready to start building! Copy and paste this prompt into the Cline chat w
|
||||
Hey Cline! Could you help me create a new project folder called "hello-world" in my Cline directory and make a simple webpage that says "Hello World" in big blue text?
|
||||
```
|
||||
|
||||
> ✅ **Pro Tip:** Cline will help you create the project folder and set up your first webpage!
|
||||
> **Pro Tip:** Cline will help you create the project folder and set up your first webpage!
|
||||
|
||||
### 🧩 Tips for Working with Cline
|
||||
### Tips for Working with Cline
|
||||
|
||||
- **Ask Questions:** If you're unsure about something, ask Cline!
|
||||
- **Use Screenshots:** Cline can understand images — show him what you're working on.
|
||||
- **Copy and Paste Errors:** Share error messages in the chat for solutions.
|
||||
- **Speak Plainly:** Use your own words — Cline will translate them into code.
|
||||
|
||||
### 🫂 Still Struggling?
|
||||
### Still Struggling?
|
||||
|
||||
Join our Discord community and engage with our team and other Cline users directly.
|
||||
|
||||
@@ -6,7 +6,7 @@ description: >-
|
||||
guided way.
|
||||
---
|
||||
|
||||
### 🧰 The Essential Tools
|
||||
### The Essential Tools
|
||||
|
||||
Here are the core tools you'll need for development:
|
||||
|
||||
@@ -17,9 +17,9 @@ Here are the core tools you'll need for development:
|
||||
- Chocolatey for Windows
|
||||
- apt/yum for Linux
|
||||
|
||||
> 💡 **Tip:** These tools are the foundation of your developer toolkit. Installing them properly will set you up for success!
|
||||
> **Tip:** These tools are the foundation of your developer toolkit. Installing them properly will set you up for success!
|
||||
|
||||
### 🚀 Let Cline Install Everything
|
||||
### Let Cline Install Everything
|
||||
|
||||
Copy one of these prompts based on your operating system and paste it into **Cline**:
|
||||
|
||||
@@ -41,9 +41,9 @@ Hello Cline! I need help setting up my Windows PC for software development. Coul
|
||||
Hello Cline! I need help setting up my Linux system for software development. Could you please help me install the essential development tools like Node.js, Git, and any other core utilities that are commonly needed for coding? I'd like you to guide me through the process step-by-step.
|
||||
```
|
||||
|
||||
> ✅ **Pro Tip:** Cline will show you each command before running it. You stay in control the entire time!
|
||||
> **Pro Tip:** Cline will show you each command before running it. You stay in control the entire time!
|
||||
|
||||
### 🔍 What Will Happen
|
||||
### What Will Happen
|
||||
|
||||
Cline will guide you through the following steps:
|
||||
|
||||
@@ -52,9 +52,9 @@ Cline will guide you through the following steps:
|
||||
3. Showing you the exact command before it runs (you approve each step!)
|
||||
4. Verifying each installation is successful
|
||||
|
||||
> ⚠️ **Note:** You might need to enter your computer's password for some installations. This is normal!
|
||||
> **Note:** You might need to enter your computer's password for some installations. This is normal!
|
||||
|
||||
### 💡 Why These Tools Are Important
|
||||
### Why These Tools Are Important
|
||||
|
||||
- **Node.js & npm:**
|
||||
- Build websites with frameworks like React or Next.js
|
||||
@@ -68,15 +68,15 @@ Cline will guide you through the following steps:
|
||||
- Quickly install and update development tools
|
||||
- Keep your environment organized and up to date
|
||||
|
||||
### 🧩 Notes
|
||||
### Notes
|
||||
|
||||
> 💡 **Tip:** The installation process is interactive — Cline will guide you step by step!
|
||||
> **Tip:** The installation process is interactive — Cline will guide you step by step!
|
||||
|
||||
- All commands are shown to you for approval before they run.
|
||||
- If you run into any issues, Cline will help troubleshoot them.
|
||||
- You may need to enter your computer's password for certain steps.
|
||||
|
||||
### 🧑💻 Additional Tips for New Coders
|
||||
### Additional Tips for New Coders
|
||||
|
||||
#### Understanding the Terminal
|
||||
|
||||
|
||||
@@ -1,126 +1,79 @@
|
||||
---
|
||||
title: "Model Selection Guide"
|
||||
description: "Last updated: Feb 5, 2025."
|
||||
description: "Last updated: August 20, 2025."
|
||||
---
|
||||
|
||||
## Understanding Context Windows
|
||||
New models drop constantly, so this guide focuses on what's working well with Cline right now. We'll keep it updated as the landscape shifts.
|
||||
|
||||
Think of a context window as your AI assistant's working memory - similar to RAM in a computer. It determines how much information the model can "remember" and process at once during your conversation. This includes:
|
||||
## Current Top Models
|
||||
|
||||
- Your code files and conversations
|
||||
- The assistant's responses
|
||||
- Any documentation or additional context provided
|
||||
| Model | Context Window | Input Price* | Output Price* | Best For |
|
||||
|-------|---------------|--------------|---------------|----------|
|
||||
| **Claude Sonnet 4** | 1M tokens | $3-6 | $15-22.50 | Reliable tool usage, complex codebases |
|
||||
| **Qwen3 Coder** | 256K tokens | $0.20 | $0.80 | Coding tasks, open source flexibility |
|
||||
| **Gemini 2.5 Pro** | 1M+ tokens | TBD | TBD | Large codebases, document analysis |
|
||||
| **GPT-5** | 400K tokens | $1.25 | $10 | Latest OpenAI tech, three modes |
|
||||
|
||||
Context windows are measured in tokens (roughly 3/4 of a word in English). Different models have different context window sizes:
|
||||
*Per million tokens
|
||||
|
||||
- Claude 3.5 Sonnet: 200K tokens
|
||||
- DeepSeek Models: 128K tokens
|
||||
- Gemini Flash 2.0: 1M tokens
|
||||
- Gemini 1.5 Pro: 2M tokens
|
||||
## Budget Options
|
||||
|
||||
When you reach the limit of your context window, older information needs to be removed to make room for new information - just like clearing RAM to run new programs. This is why sometimes AI assistants might seem to "forget" earlier parts of your conversation.
|
||||
| Model | Context Window | Input Price* | Output Price* | Notes |
|
||||
|-------|---------------|--------------|---------------|-------|
|
||||
| **DeepSeek V3** | 128K tokens | $0.14 | $0.28 | Great value for daily coding |
|
||||
| **DeepSeek R1** | 128K tokens | $0.55 | $2.19 | Budget reasoning champion |
|
||||
| **Qwen3 32B** | 128K tokens | Varies | Varies | Open source, multiple providers |
|
||||
| **Z AI GLM 4.5** | 128K tokens | TBD | TBD | MIT licensed, hybrid reasoning |
|
||||
|
||||
Cline helps you manage this limitation with its Context Window Progress Bar, which shows:
|
||||
*Per million tokens
|
||||
|
||||
- Input tokens (what you've sent to the model)
|
||||
- Output tokens (what the model has generated)
|
||||
- A visual representation of how much of your context window you've used
|
||||
- The total capacity for your chosen model
|
||||
|
||||
<Frame caption="Visual representation of the context window usage in Cline">
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/image%20(11).png"
|
||||
alt="Context window progress bar example"
|
||||
/>
|
||||
</Frame>
|
||||
## Context Window Guide
|
||||
|
||||
This visibility helps you work more effectively with Cline by letting you know when you might need to start fresh or break tasks into smaller chunks.
|
||||
| Size | Word Count | Use Case |
|
||||
|------|------------|----------|
|
||||
| 32K tokens | ~24,000 words | Single files, small projects |
|
||||
| 128K tokens | ~96,000 words | Most coding projects |
|
||||
| 200K tokens | ~150,000 words | Large codebases |
|
||||
| 400K+ tokens | ~300,000+ words | Entire applications |
|
||||
|
||||
### Model Comparison
|
||||
**Performance note**: Most models start dropping in quality around 400-500K tokens, even if they claim higher limits.
|
||||
|
||||
## LLM Model Comparison for Cline (Feb 2025)
|
||||
## Open Source vs Closed Source
|
||||
|
||||
| Model | Input Cost\* | Output Cost\* | Context Window | Best For |
|
||||
| ----------------- | ------------ | ------------- | -------------- | ----------------------------------- |
|
||||
| Claude 3.5 Sonnet | $3.00 | $15.00 | 200K | Best code implementation & tool use |
|
||||
| DeepSeek R1 | $0.55 | $2.19 | 128K | Planning & reasoning champion |
|
||||
| DeepSeek V3 | $0.14 | $0.28 | 128K | Value code implementation |
|
||||
| o3-mini | $1.10 | $4.40 | 200K | Flexible use, strong planning |
|
||||
| Gemini Flash 2.0 | $0.00 | $0.00 | 1M | Strong all-rounder |
|
||||
| Gemini 1.5 Pro | $0.00 | $0.00 | 2M | Large context processing |
|
||||
### Open Source Advantages
|
||||
- **Multiple providers** compete to host them
|
||||
- **Cheaper pricing** due to competition
|
||||
- **Provider choice** - switch if one goes down
|
||||
- **Faster innovation** cycles
|
||||
|
||||
\*Costs per million tokens
|
||||
### Open Source Models Available
|
||||
- **Qwen3 Coder** (Apache 2.0)
|
||||
- **Z AI GLM 4.5** (MIT)
|
||||
- **Kimi K2** (Open source)
|
||||
- **DeepSeek series** (Various licenses)
|
||||
|
||||
### Top Picks for 2025
|
||||
## Quick Decision Matrix
|
||||
|
||||
1. **Claude 3.5 Sonnet**
|
||||
- Best overall code implementation
|
||||
- Most reliable tool usage
|
||||
- Expensive but worth it for critical code
|
||||
2. **DeepSeek R1**
|
||||
- Exceptional planning & reasoning
|
||||
- Great value pricing
|
||||
3. **o3-mini**
|
||||
- Strong for planning with adjustable reasoning
|
||||
- Three reasoning modes for different needs
|
||||
- Requires OpenAI Tier 3 API access
|
||||
- 200K context window
|
||||
4. **DeepSeek V3**
|
||||
- Reliable code implementation
|
||||
- Great for daily coding
|
||||
- Cost-effective for implementation
|
||||
5. **Gemini Flash 2.0**
|
||||
- Massive 1M context window
|
||||
- Improved speed and performance
|
||||
- Good all-around capabilities
|
||||
| If you want... | Use this |
|
||||
|----------------|----------|
|
||||
| Something that just works | Claude Sonnet 4 |
|
||||
| To save money | DeepSeek V3 or Qwen3 variants |
|
||||
| Huge context windows | Gemini 2.5 Pro or Claude Sonnet 4 |
|
||||
| Open source | Qwen3 Coder, Z AI GLM 4.5, or Kimi K2 |
|
||||
| Latest tech | GPT-5 |
|
||||
| Speed | Qwen3 Coder on Cerebras (fastest available) |
|
||||
|
||||
### Best Models by Mode (Plan or Act)
|
||||
## What Others Are Using
|
||||
|
||||
#### Planning
|
||||
Check [OpenRouter's Cline usage stats](https://openrouter.ai/apps?url=https%3A%2F%2Fcline.bot%2F) to see real usage patterns from the community.
|
||||
|
||||
1. **DeepSeek R1**
|
||||
- Best reasoning capabilities in class
|
||||
- Excellent at breaking down complex tasks
|
||||
- Strong math/algorithm planning
|
||||
- MoE architecture helps with reasoning
|
||||
2. **o3-mini (high reasoning)**
|
||||
- Three reasoning levels:
|
||||
- High: Complex planning
|
||||
- Medium: Daily tasks
|
||||
- Low: Quick ideas
|
||||
- 200K context helps with large projects
|
||||
3. **Gemini Flash 2.0**
|
||||
- Massive context window for complex planning
|
||||
- Strong reasoning capabilities
|
||||
- Good with multi-step tasks
|
||||
## Context Management
|
||||
|
||||
#### Acting (coding)
|
||||
Cline automatically handles context limits with [auto-compact](/features/auto-compact). When you approach your model's limit, Cline summarizes the conversation to keep working. You don't need to micromanage this.
|
||||
|
||||
1. **Claude 3.5 Sonnet**
|
||||
- Best code quality
|
||||
- Most reliable with Cline tools
|
||||
- Worth the premium for critical code
|
||||
2. **DeepSeek V3**
|
||||
- Nearly Sonnet-level code quality
|
||||
- Better API stability than R1
|
||||
- Great for daily coding
|
||||
- Strong tool usage
|
||||
3. **Gemini 1.5 Pro**
|
||||
- 2M context window
|
||||
- Good with complex codebases
|
||||
- Reliable API
|
||||
- Strong multi-file understanding
|
||||
## The Bottom Line
|
||||
|
||||
### A Note on Local Models
|
||||
Start with **Claude Sonnet 4** if you want reliability. Experiment with **open source options** once you're comfortable to find the best fit for your workflow and budget.
|
||||
|
||||
While running models locally might seem appealing for cost savings, we currently don't recommend any local models for use with Cline. [Local models are significantly less reliable](https://docs.cline.bot/running-models-locally/read-me-first) at using Cline's essential tools and typically retain only 1-26% of the original model's capabilities. The full cloud version of DeepSeek-R1, for example, is 671B parameters - local versions are drastically simplified copies that struggle with complex tasks and tool usage. Even with high-end hardware (RTX 3070+, 32GB+ RAM), you'll experience slower responses, less reliable tool execution, and reduced capabilities. For the best development experience, we recommend sticking with the cloud models listed above.
|
||||
|
||||
### Key Takeaways
|
||||
|
||||
1. **Plan vs Act Matters**: Choose models based on task type
|
||||
2. **Real Performance > Benchmarks**: Focus on actual Cline performance
|
||||
3. **Mix & Match**: Use different models for planning and implementation
|
||||
4. **Cost vs Quality**: Premium models worth it for critical code
|
||||
5. **Keep Backups**: Have alternatives ready for API issues
|
||||
|
||||
_\*Note: Based on real usage patterns and community feedback rather than just benchmarks. Your experience may vary. This is not an exhaustive list of all the models available for use within Cline._
|
||||
The landscape moves fast - these recommendations reflect what's working now, but keep an eye on new releases.
|
||||
|
||||
@@ -3,7 +3,7 @@ title: "Context Management"
|
||||
description: "Context is key to getting the most out of Cline"
|
||||
---
|
||||
|
||||
> 💡 **Quick Reference**
|
||||
> **Quick Reference**
|
||||
>
|
||||
> - Context = The information Cline knows about your project
|
||||
> - Context Window = How much information Cline can hold at once
|
||||
@@ -38,7 +38,7 @@ Cline actively builds context in two ways:
|
||||
- Guide focus areas
|
||||
- Share design thoughts and requirements
|
||||
|
||||
💡 **Key Point**: Cline isn't passive - it actively seeks to understand your project. You can either let it explore or guide its focus, especially in [Plan](https://docs.cline.bot/features/plan-and-act) mode.
|
||||
**Key Point**: Cline isn't passive - it actively seeks to understand your project. You can either let it explore or guide its focus, especially in [Plan Mode](/features/plan-and-act).
|
||||
|
||||
### Context & Context Windows
|
||||
|
||||
@@ -53,12 +53,13 @@ Think of context like a whiteboard you and Cline share:
|
||||
- **Context Window** is the size of the whiteboard itself:
|
||||
- Measured in tokens (1 token ≈ 3/4 of an English word)
|
||||
- Each model has a fixed size:
|
||||
- Claude 3.5 Sonnet: 200,000 tokens
|
||||
- DeepSeek: 64,000 tokens
|
||||
- When the whiteboard is full, you need to erase (clear context) to write more
|
||||
- [How Cline manages context under the hood](https://cline.bot/blog/understanding-the-new-context-window-progress-bar-in-cline)
|
||||
- Claude Sonnet 4: 1,000,000 tokens
|
||||
- Qwen3 Coder: 256,000 tokens
|
||||
- Gemini 2.5 Pro: 1,000,000+ tokens
|
||||
- GPT-5: 400,000 tokens
|
||||
- When the whiteboard is full, Cline automatically summarizes the conversation to free up space
|
||||
|
||||
⚠️ **Important**: Having a large context window (like Claude's 200k tokens) doesn't mean you should fill it completely. Just like a cluttered whiteboard, too much information can make it harder to focus on what's important.
|
||||
**Important**: Having a large context window doesn't mean you should fill it completely. Models start degrading around 400-500K tokens even if they claim higher limits. Just like a cluttered whiteboard, too much information can make it harder to focus on what's important.
|
||||
|
||||
## Understanding the Context Window Progress Bar
|
||||
|
||||
@@ -76,7 +77,7 @@ Cline provides a visual way to monitor your context window usage through a progr
|
||||
- ↑ shows input tokens (what you've sent to the LLM)
|
||||
- ↓ shows output tokens (what the LLM has generated)
|
||||
- The progress bar visualizes how much of your context window you've used
|
||||
- The total shows your model's maximum capacity (e.g., 200k for Claude 3.5-Sonnet)
|
||||
- The total shows your model's maximum capacity (e.g., 1M for Claude Sonnet 4)
|
||||
|
||||
### When to Watch the Bar
|
||||
|
||||
@@ -85,7 +86,33 @@ Cline provides a visual way to monitor your context window usage through a progr
|
||||
- Before starting complex tasks
|
||||
- When Cline seems to lose context
|
||||
|
||||
💡 **Tip**: Consider starting a fresh session when usage reaches 70-80% to maintain optimal performance.
|
||||
**Tip**: With [Auto Compact](/features/auto-compact), Cline can now handle long conversations automatically. When combined with [Focus Chain](/features/focus-chain), you can work on complex projects that span multiple context windows without losing progress.
|
||||
|
||||
## Automatic Context Management
|
||||
|
||||
Cline includes intelligent features to manage context automatically:
|
||||
|
||||
### Default Settings You Should Keep On
|
||||
|
||||
**Focus Chain** - Enabled by default in v3.25. Cline generates a todo list at task start and keeps it in context so the thread doesn't drift. You can edit the markdown to add or reorder steps and Cline will adapt. [Learn more about Focus Chain](/features/focus-chain).
|
||||
|
||||
**Auto Compact** - Always on. As the context window reaches its limit, Cline creates a comprehensive summary, replaces the bloated history, and continues where it left off. Decisions, code changes, and state are preserved. [Learn more about Auto Compact](/features/auto-compact).
|
||||
|
||||
## Advanced Context Tools
|
||||
|
||||
When you need more control over context management:
|
||||
|
||||
### Deep Planning (`/deep-planning`)
|
||||
For substantial features, refactors, or integrations. Cline investigates your codebase, asks targeted questions, then writes `implementation_plan.md`. It creates a fresh task with distilled, high-value context. [Learn more about Deep Planning](/features/slash-commands/deep-planning).
|
||||
|
||||
### New Task (`/newtask`)
|
||||
At natural transition points, packages only what matters into a fresh task. Clean slate for implementation after research, or crisp handoff between teammates. [Learn more about New Task](/features/slash-commands/new-task).
|
||||
|
||||
### Smol (`/smol`)
|
||||
Compress the conversation in place to keep momentum. Ideal during debugging or exploratory work when you don't want to break flow. [Learn more about Smol](/features/slash-commands/smol).
|
||||
|
||||
### Memory Bank + .clinerules
|
||||
For non-trivial projects. The Memory Bank captures project knowledge as Markdown in your repo. `.clinerules` are version-controlled instructions that align Cline's behavior with your team. [Learn more about Memory Bank](/prompting/cline-memory-bank) and [Cline Rules](/features/cline-rules).
|
||||
|
||||
## Working with Context Files
|
||||
|
||||
@@ -93,12 +120,12 @@ Context files help maintain understanding across sessions. They serve as documen
|
||||
|
||||
#### Approaches to Context Files
|
||||
|
||||
1. **Evergreen Project Context (i.e.** [**Memory Bank**](https://docs.cline.bot/prompting/cline-memory-bank)**)**
|
||||
1. **Evergreen Project Context (Memory Bank)**
|
||||
- Living documentation that evolves with your project
|
||||
- Updated as architecture and patterns emerge
|
||||
- Example: The Memory Bank pattern maintains files like `techContext.md` and `systemPatterns.md`
|
||||
- Useful for long-running projects and teams
|
||||
2. **Task-Specific Context (i.e.** [**Structured Approach**](https://cline.bot/blog/building-advanced-software-with-cline-a-structured-approach)**)**
|
||||
2. **Task-Specific Context**
|
||||
|
||||
- Created for specific implementation tasks
|
||||
- Document requirements, constraints, and decisions
|
||||
@@ -151,9 +178,19 @@ Context files help maintain understanding across sessions. They serve as documen
|
||||
- Use Plan mode for complex discussions
|
||||
- Start fresh sessions when needed
|
||||
3. **Team Projects**
|
||||
- Share common context files (consider using [.clinerules](https://docs.cline.bot/features/cline-rules) files in project roots)
|
||||
- Share common context files (consider using [.clinerules](/features/cline-rules) files in project roots)
|
||||
- Document architectural decisions
|
||||
- Maintain consistent patterns
|
||||
- Keep documentation current
|
||||
|
||||
Remember: The goal is to help Cline maintain consistent understanding of your project across sessions.
|
||||
## Bonus Context Tips
|
||||
|
||||
- You can @ links and have the webpage's context added to Cline (docs, blogs, etc.)
|
||||
- Utilize MCP servers to pull in context from your external knowledge bases
|
||||
- Screenshots can be used as context for models that support image inputs
|
||||
|
||||
## The Bottom Line
|
||||
|
||||
Cline already does a lot of context work for you - [Focus Chain](/features/focus-chain), [Auto Compact](/features/auto-compact), and the planning flow are designed to keep the thread intact across long horizons. The goal is to help Cline maintain consistent understanding of your project across sessions.
|
||||
|
||||
Remember: The goal is to keep only what matters in view, at every step.
|
||||
|
||||
@@ -3,6 +3,70 @@ title: "What is Cline?"
|
||||
description: "An introduction to Cline, your AI-powered development assistant in VS Code."
|
||||
---
|
||||
|
||||
Cline is an AI development assistant which integrates with Microsoft Visual Studio Code. It provides an interface between your IDE and LLMs facilitating code development, increasing productivity and lowering the barrier to entry for new coders. Depending on permissions, Cline can read/write files, execute commands, use your web browser, and expand its capabilities with Model Context Protocol servers.
|
||||
Cline is an open source AI coding agent that brings frontier AI models directly to your VS Code editor. Unlike autocomplete tools, Cline is a true coding agent that can understand entire codebases, plan complex changes, and execute multi-step tasks.
|
||||
|
||||
What makes Cline distinctive is its thoughtful approach to code generation and its extensive integration capabilities. Rather than simply generating code snippets, Cline collaborates with developers by planning solutions step-by-step, maintaining awareness of the entire development environment, and requiring explicit approval for all changes. It can understand large codebases, accelerate onboarding for new engineers, and connect with hundreds of tools through its Model Context Protocol Marketplace, enabling everything from streamlined project deployments to automated incident response—all through natural language commands.
|
||||
## Open Source AI Coding, Uncompromised
|
||||
|
||||
Cline gives you direct, transparent access to frontier AI with no limits, no surprises, and no model ecosystem lock-in. See every decision. Choose any model. Control your costs.
|
||||
|
||||
### Complete Transparency
|
||||
|
||||
Watch in real-time as Cline reads files, considers approaches, and proposes changes. Every decision is visible, every edit reviewable before it's made. This isn't just "explainable AI" - it's complete transparency.
|
||||
|
||||
### Your Models, Your Control
|
||||
|
||||
Use Claude for complex reasoning, Gemini for massive contexts, or Qwen3 Coder for efficiency. Switch instantly as new models launch. Your API keys, your choice. No gatekeeping innovation.
|
||||
|
||||
### Built for Real Engineering
|
||||
|
||||
Cline can:
|
||||
- **Read and write files** across your entire codebase
|
||||
- **Execute terminal commands** and debug errors
|
||||
- **Plan complex features** before writing code
|
||||
- **Connect to external systems** through MCP servers
|
||||
- **Understand large codebases** with intelligent context management
|
||||
|
||||
## Plan & Act Mode
|
||||
|
||||
Cline explores your codebase and works with you to create comprehensive plans before writing a single line of code, ensuring it understands the full context of your project.
|
||||
|
||||
**Plan Mode** for complex tasks - Cline explores, asks questions, and creates detailed implementation plans.
|
||||
|
||||
**Act Mode** for execution - Cline implements the plan with full transparency and control.
|
||||
|
||||
## Zero Trust by Design
|
||||
|
||||
Your code never touches our servers. Cline runs entirely client-side with your API keys, making it the only option for enterprises with strict security requirements.
|
||||
|
||||
**Open source** means your security team can review every line. See exactly how Cline works, what it sends to AI providers, and how decisions are made.
|
||||
|
||||
## Key Features
|
||||
|
||||
### Focus Chain
|
||||
Automatic todo list management with real-time progress tracking throughout your tasks. Keeps Cline on track across long projects.
|
||||
|
||||
### Auto Compact
|
||||
When conversations get long, Cline automatically summarizes to preserve context while freeing up space to continue working.
|
||||
|
||||
### Deep Planning
|
||||
For complex features, Cline investigates your codebase, asks clarifying questions, and creates comprehensive implementation plans.
|
||||
|
||||
### MCP Integration
|
||||
Connect to databases, APIs, and documentation through the Model Context Protocol. Cline becomes your bridge to any external system.
|
||||
|
||||
### .clinerules
|
||||
Define project-specific instructions that Cline follows including coding standards, architecture patterns, or team conventions.
|
||||
|
||||
## Why Developers Choose Cline
|
||||
|
||||
**100% Open Source** - Every line of code on GitHub. 48k+ stars from developers who've read it, improved it, and trust it with their work.
|
||||
|
||||
**No Inference Games** - We don't profit from AI usage. While others limit context or route to cheaper models, we give you unrestricted access to any model's full capabilities.
|
||||
|
||||
**Future-Proof by Design** - New model released? Use it immediately. Cline works with any AI provider, any model.
|
||||
|
||||
**True Visibility** - See every file read, every decision considered, every token used.
|
||||
|
||||
## Getting Started
|
||||
|
||||
Ready to experience AI coding without limits? [Install Cline](/getting-started/installing-cline) and start with our [Model Selection Guide](/getting-started/model-selection-guide) to choose the right AI model for your needs.
|
||||
|
||||
Generated
+11649
File diff suppressed because it is too large
Load Diff
@@ -16,6 +16,7 @@ description: "Learn how to configure and use Anthropic Claude models with Cline.
|
||||
|
||||
Cline supports the following Anthropic Claude models:
|
||||
|
||||
- `claude-opus-4-1-20250805`
|
||||
- `claude-opus-4-20250514`
|
||||
- `claude-opus-4-20250514:thinking` (Extended Thinking variant)
|
||||
- `claude-sonnet-4-20250514` (Recommended)
|
||||
|
||||
+7
-6
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "AWS Bedrock"
|
||||
description: "Learn how to set up AWS Bedrock with Cline using credentials authentication. This guide covers AWS environment setup, regional access verification, and secure integration with the Cline VS Code extension."
|
||||
title: "API Key (Simple Setup)"
|
||||
sidebarTitle: "API Key"
|
||||
description: "Set up AWS Bedrock with Cline using Bedrock API Keys. Simplest setup for individual developers to access frontier models."
|
||||
---
|
||||
|
||||
### Overview
|
||||
@@ -121,14 +122,14 @@ You can create a custom IAM policy with these permissions and attach it to your
|
||||
|
||||
### Conclusion
|
||||
|
||||
By following these steps, your enterprise team can securely integrate AWS Bedrock with the Cline VS Code extension to accelerate development:
|
||||
By following these steps, you can quickly integrate AWS Bedrock with the Cline VS Code extension to accelerate development:
|
||||
|
||||
1. **Prepare Your AWS Environment:** Create or use a secure IAM role/user, attach the `AmazonBedrockLimitedAccess` policy, and ensure necessary permissions.
|
||||
1. **Prepare Your AWS Environment:** Create a Bedrock API Key with the necessary permissions.
|
||||
2. **Verify Region and Model Access:** Confirm that your selected region supports your required models.
|
||||
3. **Configure Cline in VS Code:** Install and set up Cline with your AWS credentials and choose an appropriate model.
|
||||
3. **Configure Cline in VS Code:** Install and set up Cline with your AWS API Key and choose an appropriate model.
|
||||
4. **Implement Security and Monitoring:** Use best practices for IAM, network security, monitoring, and cost management.
|
||||
|
||||
For further details, consult the [AWS Bedrock Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html) and coordinate with your internal cloud team. Happy coding!
|
||||
For further details, consult the [AWS Bedrock Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html). Happy coding!
|
||||
|
||||
---
|
||||
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "AWS Bedrock w/ Profile Authentication"
|
||||
description: "Learn how to configure AWS Bedrock to use AWS Profiles for authentication with Cline, focusing on SSO/Federated roles for secure access."
|
||||
title: "CLI Profile (SSO)"
|
||||
sidebarTitle: "CLI Profile (SSO)"
|
||||
description: "Configure AWS Bedrock to use AWS CLI profiles for authentication with Cline. Best for SSO/federated roles and secure enterprise access."
|
||||
---
|
||||
|
||||
### Overview
|
||||
+3
-2
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: "AWS Bedrock"
|
||||
description: "Learn how to set up AWS Bedrock with Cline using credentials authentication. This guide covers AWS environment setup, regional access verification, and secure integration with the Cline VS Code extension."
|
||||
title: "IAM Credentials"
|
||||
sidebarTitle: "IAM Credentials"
|
||||
description: "Set up AWS Bedrock with Cline using IAM Access Key and Secret Key credentials. Best for enterprise environments with established IAM policies."
|
||||
---
|
||||
|
||||
### Overview
|
||||
@@ -0,0 +1,96 @@
|
||||
---
|
||||
title: "Cerebras"
|
||||
description: "Learn how to configure and use Cerebras's ultra-fast inference with Cline. Experience up to 2,600 tokens per second with wafer-scale chip architecture and real-time reasoning models."
|
||||
---
|
||||
|
||||
Cerebras delivers the world's fastest AI inference through their revolutionary wafer-scale chip architecture. Unlike traditional GPUs that shuttle model weights from external memory, Cerebras stores entire models on-chip, eliminating bandwidth bottlenecks and achieving speeds up to 2,600 tokens per second—often 20x faster than GPUs.
|
||||
|
||||
**Website:** [https://cloud.cerebras.ai/](https://cloud.cerebras.ai/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [Cerebras Cloud](https://cloud.cerebras.ai/) and create an account or sign in.
|
||||
2. **Navigate to API Keys:** Access the API keys section in your dashboard.
|
||||
3. **Create a Key:** Generate a new API key. Give it a descriptive name (e.g., "Cline").
|
||||
4. **Copy the Key:** Copy the API key immediately. Store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following Cerebras models:
|
||||
|
||||
- `qwen-3-coder-480b-free` (Free tier) - High-performance coding model at no cost
|
||||
- `qwen-3-coder-480b` - Flagship 480B parameter coding model
|
||||
- `qwen-3-235b-a22b-instruct-2507` - Advanced instruction-following model
|
||||
- `qwen-3-235b-a22b-thinking-2507` - Reasoning model with step-by-step thinking
|
||||
- `llama-3.3-70b` - Meta's Llama 3.3 model optimized for speed
|
||||
- `qwen-3-32b` - Compact yet powerful model for general tasks
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Cerebras" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Cerebras API key into the "Cerebras API Key" field.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
5. **(Optional) Custom Base URL:** Most users won't need to adjust this setting.
|
||||
|
||||
### Cerebras's Wafer-Scale Advantage
|
||||
|
||||
Cerebras has fundamentally reimagined AI hardware architecture to solve the inference speed problem:
|
||||
|
||||
#### Wafer-Scale Architecture
|
||||
Traditional GPUs use separate chips for compute and memory, forcing them to constantly shuttle model weights back and forth. Cerebras built the world's largest AI chip—a wafer-scale engine that stores entire models on-chip. No external memory, no bandwidth bottlenecks, no waiting.
|
||||
|
||||
#### Revolutionary Speed
|
||||
- **Up to 2,600 tokens per second** - often 20x faster than GPUs
|
||||
- **Single-second reasoning** - what used to take minutes now happens instantly
|
||||
- **Real-time applications** - reasoning models become practical for interactive use
|
||||
- **No bandwidth limits** - entire models stored on-chip eliminate memory bottlenecks
|
||||
|
||||
#### The Cerebras Scaling Law
|
||||
Cerebras discovered that **faster inference enables smarter AI**. Modern reasoning models generate thousands of tokens as "internal monologue" before answering. On traditional hardware, this takes too long for real-time use. Cerebras makes reasoning models fast enough for everyday applications.
|
||||
|
||||
#### Quality Without Compromise
|
||||
Unlike other speed optimizations that sacrifice accuracy, Cerebras maintains full model quality while delivering unprecedented speed. You get the intelligence of frontier models with the responsiveness of lightweight ones.
|
||||
|
||||
Learn more about Cerebras's technology in their blog posts:
|
||||
- [The Cerebras Scaling Law: Faster Inference Is Smarter AI](https://www.cerebras.ai/blog/the-cerebras-scaling-law-faster-inference-is-smarter-ai)
|
||||
- [Introducing Cerebras Code](https://www.cerebras.ai/blog/introducing-cerebras-code)
|
||||
|
||||
### Cerebras Code Plans
|
||||
|
||||
Cerebras offers specialized plans for developers:
|
||||
|
||||
#### Code Pro ($50/month)
|
||||
- Access to Qwen3-Coder with fast, high-context completions
|
||||
- Up to 24 million tokens per day
|
||||
- Ideal for indie developers and weekend projects
|
||||
- 3-4 hours of uninterrupted coding per day
|
||||
|
||||
#### Code Max ($200/month)
|
||||
- Heavy coding workflow support
|
||||
- Up to 120 million tokens per day
|
||||
- Perfect for full-time development and multi-agent systems
|
||||
- No weekly limits, no IDE lock-in
|
||||
|
||||
### Special Features
|
||||
|
||||
#### Free Tier
|
||||
The `qwen-3-coder-480b-free` model provides access to high-performance inference at no cost—unique among speed-focused providers.
|
||||
|
||||
#### Real-Time Reasoning
|
||||
Reasoning models like `qwen-3-235b-a22b-thinking-2507` can complete complex multi-step reasoning in under a second, making them practical for interactive development workflows.
|
||||
|
||||
#### Coding Specialization
|
||||
Qwen3-Coder models are specifically optimized for programming tasks, delivering performance comparable to Claude Sonnet 4 and GPT-4.1 in coding benchmarks.
|
||||
|
||||
#### No IDE Lock-In
|
||||
Works with any OpenAI-compatible tool—Cursor, Continue.dev, Cline, or any other editor that supports OpenAI endpoints.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Speed Advantage:** Cerebras excels at making reasoning models practical for real-time use. Perfect for agentic workflows that require multiple LLM calls.
|
||||
- **Free Tier:** Start with the free model to experience Cerebras speed before upgrading to paid plans.
|
||||
- **Context Windows:** Models support context windows ranging from 64K to 128K tokens for including substantial code context.
|
||||
- **Rate Limits:** Generous rate limits designed for development workflows. Check your dashboard for current limits.
|
||||
- **Pricing:** Competitive pricing with significant speed advantages. Visit [Cerebras Cloud](https://cloud.cerebras.ai/) for current rates.
|
||||
- **Real-Time Applications:** Ideal for applications where AI response time matters—code generation, debugging, and interactive development.
|
||||
@@ -52,6 +52,7 @@ If you're not sure where Claude Code is installed:
|
||||
The Claude Code provider supports these models:
|
||||
|
||||
- `claude-sonnet-4-20250514` (Recommended)
|
||||
- `claude-opus-4-1-20250805`
|
||||
- `claude-opus-4-20250514`
|
||||
- `claude-3-7-sonnet-20250219`
|
||||
- `claude-3-5-sonnet-20241022`
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
title: "Doubao"
|
||||
description: "Learn how to configure and use ByteDance's Doubao AI models with Cline. Experience advanced reasoning, multimodal capabilities, and cost-effective inference with Chinese language optimization."
|
||||
---
|
||||
|
||||
Doubao is ByteDance's flagship AI model series, featuring innovative sparse Mixture-of-Experts (MoE) architecture that delivers performance equivalent to much larger models while maintaining cost efficiency. With over 13 million users and advanced multimodal capabilities, Doubao offers competitive alternatives to Western AI systems with particular strength in Chinese language processing.
|
||||
|
||||
**Website:** [https://www.volcengine.com/](https://www.volcengine.com/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Visit the [Volcano Engine Console](https://console.volcengine.com/). Create an account or sign in.
|
||||
2. **Navigate to Model Service:** Access the AI model service section in the console.
|
||||
3. **Create API Key:** Generate a new API key for the Doubao service.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely. You may not be able to view it again.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following Doubao models:
|
||||
|
||||
- `doubao-seed-1-6-250615` (Default) - General purpose model with balanced performance
|
||||
- `doubao-seed-1-6-thinking-250715` - Enhanced reasoning model with step-by-step thinking
|
||||
- `doubao-seed-1-6-flash-250715` - Speed-optimized model for fast inference
|
||||
|
||||
All models feature:
|
||||
- **128,000 token context window** for extensive document processing
|
||||
- **32,768 max output tokens** for comprehensive responses
|
||||
- **Image input support** for multimodal applications
|
||||
- **Prompt caching** with 80% discount on cached reads
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Doubao" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Doubao API key into the "Doubao API Key" field.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
**Note:** Doubao uses the base URL `https://ark.cn-beijing.volces.com/api/v3` and servers are located in Beijing, China.
|
||||
|
||||
### ByteDance's AI Innovation
|
||||
|
||||
Doubao represents ByteDance's strategic entry into the AI model space with several key innovations:
|
||||
|
||||
#### Sparse Mixture-of-Experts Architecture
|
||||
Doubao 1.5 Pro employs an innovative sparse MoE framework where 20 billion activated parameters deliver performance equivalent to a 140-billion-parameter dense model. This architecture significantly reduces operational costs while maintaining high performance standards.
|
||||
|
||||
#### Extended Context Processing
|
||||
With context windows ranging from 32,000 to 256,000 tokens, Doubao excels at processing long-form content including legal documents, academic research, market reports, and creative content generation.
|
||||
|
||||
#### Multimodal Excellence
|
||||
- **Advanced Visual Processing:** Enhanced visual reasoning, document recognition, and fine-grained information understanding
|
||||
- **Integrated Speech:** Seamless speech and text token integration with superior emotional continuity
|
||||
- **Document Analysis:** Comprehensive document summarization and content processing capabilities
|
||||
|
||||
#### Chinese Language Optimization
|
||||
Doubao was specifically trained for Chinese language fluency and cultural relevance, providing significant advantages for Chinese-speaking users and applications requiring deep cultural context understanding.
|
||||
|
||||
#### Cost Efficiency
|
||||
Doubao maintains pricing approximately **half the cost of comparable OpenAI offerings**, making advanced AI more accessible while establishing competitive market positioning.
|
||||
|
||||
### Special Features
|
||||
|
||||
#### Reasoning Models
|
||||
The `doubao-seed-1-6-thinking-250715` model offers enhanced reasoning capabilities with step-by-step thinking processes, making it ideal for complex problem-solving tasks.
|
||||
|
||||
#### Multimodal Capabilities
|
||||
Unlike traditional cascaded approaches, Doubao integrates speech and text processing seamlessly, enabling more natural voice interactions and comprehensive document analysis.
|
||||
|
||||
#### Prompt Caching
|
||||
All models support prompt caching with significant cost savings (80% discount on cached reads), making repeated queries more economical.
|
||||
|
||||
#### ByteDance Ecosystem Integration
|
||||
Doubao integrates vertically with ByteDance properties including TikTok (Douyin), Toutiao, and Feishu, enabling seamless workflow integration across the ecosystem.
|
||||
|
||||
### Performance and Benchmarks
|
||||
|
||||
Doubao-1.5 Pro-AS1 Preview has demonstrated superior performance compared to OpenAI's O1-preview on specific benchmarks, including surpassing O1 models on AIME tests. The model continues to improve through reinforcement learning, with performance expected to enhance over time.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Regional Advantage:** Optimized for Chinese language and cultural contexts, making it ideal for Chinese-speaking users and markets.
|
||||
- **Cost Effectiveness:** Approximately 50% lower cost than comparable Western AI models while maintaining competitive performance.
|
||||
- **Context Windows:** Large context windows (up to 256K tokens) enable processing of extensive documents and codebases.
|
||||
- **Multimodal Applications:** Strong visual and speech processing capabilities make it suitable for diverse multimedia applications.
|
||||
- **Server Location:** Servers located in Beijing, China - consider latency implications for global users.
|
||||
- **Ecosystem Benefits:** Integration with ByteDance services provides additional workflow advantages for users of TikTok, Toutiao, and Feishu.
|
||||
- **Pricing:** Check the Volcano Engine console for current pricing information and regional availability.
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
title: "Fireworks AI"
|
||||
description: "Learn how to configure and use Fireworks AI models with Cline. Access high-performance open-source language models with fast, cost-effective APIs."
|
||||
---
|
||||
|
||||
Cline supports accessing models through the Fireworks AI platform, which offers fast, cost-effective access to a wide range of state-of-the-art open-source language models. Built for speed and reliability, Fireworks AI provides serverless deployment options with OpenAI-compatible APIs and context windows up to 256,000 tokens.
|
||||
|
||||
**Website:** [https://fireworks.ai/](https://fireworks.ai/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [Fireworks AI](https://fireworks.ai/) and create an account or sign in.
|
||||
2. **Navigate to API Keys:** After logging in, go to the [API Keys page](https://app.fireworks.ai/settings/users/api-keys) in the account settings.
|
||||
3. **Create a Key:** Click "Create API key" and give your key a descriptive name (e.g., "Cline").
|
||||
4. **Copy the Key:** **Important:** Copy the API key _immediately_. You will not be able to see it again. Store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following Fireworks AI models:
|
||||
|
||||
- `accounts/fireworks/models/kimi-k2-instruct` (Default)
|
||||
- `accounts/fireworks/models/qwen3-235b-a22b-instruct-2507`
|
||||
- `accounts/fireworks/models/qwen3-coder-480b-a35b-instruct`
|
||||
- `accounts/fireworks/models/deepseek-r1-0528`
|
||||
- `accounts/fireworks/models/deepseek-v3`
|
||||
|
||||
**Model Details:**
|
||||
|
||||
| Model | Context Window | Best For | Pricing (per 1M tokens) |
|
||||
|-------|----------------|----------|-------------------------|
|
||||
| Kimi K2 | 128K | General tasks, agentic capabilities | \$0.60 input, \$2.50 output |
|
||||
| Qwen3 235B | 256K | Cost-effective general use | \$0.22 input, \$0.88 output |
|
||||
| Qwen3 Coder | 256K | Code generation and debugging | \$0.45 input, \$1.80 output |
|
||||
| DeepSeek R1 | 160K | Complex reasoning, function calling | \$3.00 input, \$8.00 output |
|
||||
| DeepSeek V3 | 128K | Strong general performance | \$0.90 input, \$0.90 output |
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Fireworks AI" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Fireworks AI API key into the "Fireworks AI API Key" field.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown. The default model is Kimi K2.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Cost-Effective:** Fireworks AI offers significantly lower pricing than proprietary models while maintaining competitive performance.
|
||||
- **Large Context Windows:** Most models support 128K-256K tokens, suitable for processing large documents and maintaining extended conversations.
|
||||
- **OpenAI Compatibility:** The provider uses an OpenAI-compatible API format with streaming support and usage tracking.
|
||||
- **Rate Limits:** Fireworks AI has usage-based rate limits. Monitor your usage in the dashboard and consider upgrading your plan if needed.
|
||||
- **API Keys:** Stored locally on your machine for security.
|
||||
- **Pricing:** See the [Fireworks AI pricing page](https://fireworks.ai/pricing) for current rates. Prices shown are per million tokens.
|
||||
@@ -0,0 +1,131 @@
|
||||
---
|
||||
title: "Fireworks AI"
|
||||
description: "Learn how to configure and use Fireworks AI's lightning-fast inference platform with Cline. Experience up to 4x faster inference speeds with optimized models and competitive pricing."
|
||||
---
|
||||
|
||||
Fireworks AI is a leading infrastructure platform for generative AI that focuses on delivering exceptional performance through optimized inference capabilities. With up to 4x faster inference speeds than alternative platforms and support for over 40 different AI models, Fireworks eliminates the operational complexity of running AI models at scale.
|
||||
|
||||
**Website:** [https://fireworks.ai/](https://fireworks.ai/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [Fireworks AI](https://fireworks.ai/) and create an account or sign in.
|
||||
2. **Navigate to API Keys:** Access the API keys section in your dashboard.
|
||||
3. **Create a Key:** Generate a new API key. Give it a descriptive name (e.g., "Cline").
|
||||
4. **Copy the Key:** Copy the API key immediately. Store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Fireworks AI supports a wide variety of models across different categories. Popular models include:
|
||||
|
||||
**Text Generation Models:**
|
||||
- Llama 3.1 series (8B, 70B, 405B)
|
||||
- Mixtral 8x7B and 8x22B
|
||||
- Qwen 2.5 series
|
||||
- DeepSeek models with reasoning capabilities
|
||||
- Code Llama models for programming tasks
|
||||
|
||||
**Vision Models:**
|
||||
- Llama 3.2 Vision models
|
||||
- Qwen 2-VL models
|
||||
|
||||
**Embedding Models:**
|
||||
- Various text embedding models for semantic search
|
||||
|
||||
The platform curates, optimizes, and deploys models with custom kernels and inference optimizations for maximum performance.
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Fireworks" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Fireworks API key into the "Fireworks API Key" field.
|
||||
4. **Enter Model ID:** Specify the model you want to use (e.g., "accounts/fireworks/models/llama-v3p1-70b-instruct").
|
||||
5. **Configure Tokens:** Optionally set max completion tokens and context window size.
|
||||
|
||||
### Fireworks AI's Performance Focus
|
||||
|
||||
Fireworks AI's competitive advantages center on performance optimization and developer experience:
|
||||
|
||||
#### Lightning-Fast Inference
|
||||
- **Up to 4x faster inference** than alternative platforms
|
||||
- **250% higher throughput** compared to open source inference engines
|
||||
- **50% faster speed** with significantly reduced latency
|
||||
- **6x lower cost** than HuggingFace Endpoints with 2.5x generation speed
|
||||
|
||||
#### Advanced Optimization Technology
|
||||
- **Custom kernels** and inference optimizations increase throughput per GPU
|
||||
- **Multi-LoRA architecture** enables efficient resource sharing
|
||||
- **Hundreds of fine-tuned model variants** can run on shared base model infrastructure
|
||||
- **Asset-light model** focuses on optimization software rather than expensive GPU ownership
|
||||
|
||||
#### Comprehensive Model Support
|
||||
- **40+ different AI models** curated and optimized for performance
|
||||
- **Multiple GPU types** supported: A100, H100, H200, B200, AMD MI300X
|
||||
- **Pay-per-GPU-second billing** with no extra charges for start-up times
|
||||
- **OpenAI API compatibility** for seamless integration
|
||||
|
||||
### Pricing Structure
|
||||
|
||||
Fireworks AI uses a usage-based pricing model with competitive rates:
|
||||
|
||||
#### Text and Vision Models (2025)
|
||||
| Parameter Count | Price per 1M Input Tokens |
|
||||
|---|---|
|
||||
| Less than 4B parameters | $0.10 |
|
||||
| 4B - 16B parameters | $0.20 |
|
||||
| More than 16B parameters | $0.90 |
|
||||
| MoE 0B - 56B parameters | $0.50 |
|
||||
|
||||
#### Fine-Tuning Services
|
||||
| Base Model Size | Price per 1M Training Tokens |
|
||||
|---|---|
|
||||
| Up to 16B parameters | $0.50 |
|
||||
| 16.1B - 80B parameters | $3.00 |
|
||||
| DeepSeek R1 / V3 | $10.00 |
|
||||
|
||||
#### Dedicated Deployments
|
||||
| GPU Type | Price per Hour |
|
||||
|---|---|
|
||||
| A100 80GB | $2.90 |
|
||||
| H100 80GB | $5.80 |
|
||||
| H200 141GB | $6.99 |
|
||||
| B200 180GB | $11.99 |
|
||||
| AMD MI300X | $4.99 |
|
||||
|
||||
### Special Features
|
||||
|
||||
#### Fine-Tuning Capabilities
|
||||
Fireworks offers sophisticated fine-tuning services accessible through CLI interface, supporting JSON-formatted data from databases like MongoDB Atlas. Fine-tuned models cost the same as base models for inference.
|
||||
|
||||
#### Developer Experience
|
||||
- **Browser playground** for direct model interaction
|
||||
- **REST API** with OpenAI compatibility
|
||||
- **Comprehensive cookbook** with ready-to-use recipes
|
||||
- **Multiple deployment options** from serverless to dedicated GPUs
|
||||
|
||||
#### Enterprise Features
|
||||
- **HIPAA and SOC 2 Type II compliance** for regulated industries
|
||||
- **Self-serve onboarding** for developers
|
||||
- **Enterprise sales** for larger deployments
|
||||
- **Post-paid billing options** and Business tier
|
||||
|
||||
#### Reasoning Model Support
|
||||
Advanced support for reasoning models with `<think>` tag processing and reasoning content extraction, making complex multi-step reasoning practical for real-time applications.
|
||||
|
||||
### Performance Advantages
|
||||
|
||||
Fireworks AI's optimization delivers measurable improvements:
|
||||
- **250% higher throughput** vs open source engines
|
||||
- **50% faster speed** with reduced latency
|
||||
- **6x cost reduction** compared to alternatives
|
||||
- **2.5x generation speed** improvement per request
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Model Selection:** Choose models based on your specific use case - smaller models for speed, larger models for complex reasoning.
|
||||
- **Performance Focus:** Fireworks excels at making AI inference fast and cost-effective through advanced optimizations.
|
||||
- **Fine-Tuning:** Leverage fine-tuning capabilities to improve model accuracy with your proprietary data.
|
||||
- **Compliance:** HIPAA and SOC 2 Type II compliance enables use in regulated industries.
|
||||
- **Pricing Model:** Usage-based pricing scales with your success rather than traditional seat-based models.
|
||||
- **Developer Resources:** Extensive documentation and cookbook recipes accelerate implementation.
|
||||
- **GPU Options:** Multiple GPU types available for dedicated deployments based on performance needs.
|
||||
@@ -0,0 +1,80 @@
|
||||
---
|
||||
title: "Groq"
|
||||
description: "Learn how to configure and use Groq's lightning-fast inference with Cline. Access models from OpenAI, Meta, DeepSeek, and more on Groq's purpose-built LPU architecture."
|
||||
---
|
||||
|
||||
Groq provides ultra-fast AI inference through their custom LPU™ (Language Processing Unit) architecture, purpose-built for inference rather than adapted from training hardware. Groq hosts open-source models from various providers including OpenAI, Meta, DeepSeek, Moonshot AI, and others.
|
||||
|
||||
**Website:** [https://groq.com/](https://groq.com/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [Groq](https://groq.com/) and create an account or sign in.
|
||||
2. **Navigate to Console:** Go to the [Groq Console](https://console.groq.com/) to access your dashboard.
|
||||
3. **Create a Key:** Navigate to the API Keys section and create a new API key. Give your key a descriptive name (e.g., "Cline").
|
||||
4. **Copy the Key:** Copy the API key immediately. You will not be able to see it again. Store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following Groq models:
|
||||
|
||||
- `llama-3.3-70b-versatile` (Meta) - Balanced performance with 131K context
|
||||
- `llama-3.1-8b-instant` (Meta) - Fast inference with 131K context
|
||||
- `openai/gpt-oss-120b` (OpenAI) - Featured flagship model with 131K context
|
||||
- `openai/gpt-oss-20b` (OpenAI) - Featured compact model with 131K context
|
||||
- `moonshotai/kimi-k2-instruct` (Moonshot AI) - 1 trillion parameter model with prompt caching
|
||||
- `deepseek-r1-distill-llama-70b` (DeepSeek/Meta) - Reasoning-optimized model
|
||||
- `qwen/qwen3-32b` (Alibaba Cloud) - Enhanced for Q&A tasks
|
||||
- `meta-llama/llama-4-maverick-17b-128e-instruct` (Meta) - Latest Llama 4 variant
|
||||
- `meta-llama/llama-4-scout-17b-16e-instruct` (Meta) - Latest Llama 4 variant
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Groq" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Groq API key into the "Groq API Key" field.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Groq's Speed Revolution
|
||||
|
||||
Groq's LPU architecture delivers several key advantages over traditional GPU-based inference:
|
||||
|
||||
#### LPU Architecture
|
||||
Unlike GPUs that are adapted from training workloads, Groq's LPU is purpose-built for inference. This eliminates architectural bottlenecks that create latency in traditional systems.
|
||||
|
||||
#### Unmatched Speed
|
||||
- **Sub-millisecond latency** that stays consistent across traffic, regions, and workloads
|
||||
- **Static scheduling** with pre-computed execution graphs eliminates runtime coordination delays
|
||||
- **Tensor parallelism** optimized for low-latency single responses rather than high-throughput batching
|
||||
|
||||
#### Quality Without Tradeoffs
|
||||
- **TruePoint numerics** reduce precision only in areas that don't affect accuracy
|
||||
- **100-bit intermediate accumulation** ensures lossless computation
|
||||
- **Strategic precision control** maintains quality while achieving 2-4× speedup over BF16
|
||||
|
||||
#### Memory Architecture
|
||||
- **SRAM as primary storage** (not cache) with hundreds of megabytes on-chip
|
||||
- **Eliminates DRAM/HBM latency** that plagues traditional accelerators
|
||||
- **Enables true tensor parallelism** by splitting layers across multiple chips
|
||||
|
||||
Learn more about Groq's technology in their [LPU architecture blog post](https://groq.com/blog/inside-the-lpu-deconstructing-groq-speed).
|
||||
|
||||
### Special Features
|
||||
|
||||
#### Prompt Caching
|
||||
The Kimi K2 model supports prompt caching, which can significantly reduce costs and latency for repeated prompts.
|
||||
|
||||
#### Vision Support
|
||||
Select models support image inputs and vision capabilities. Check the model details in the Groq Console for specific capabilities.
|
||||
|
||||
#### Reasoning Models
|
||||
Some models like DeepSeek variants offer enhanced reasoning capabilities with step-by-step thought processes.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Model Selection:** Choose models based on your specific use case and performance requirements.
|
||||
- **Speed Advantage:** Groq excels at single-request latency rather than high-throughput batch processing.
|
||||
- **OSS Model Provider:** Groq hosts open-source models from multiple providers (OpenAI, Meta, DeepSeek, etc.) on their fast infrastructure.
|
||||
- **Context Windows:** Most models offer large context windows (up to 131K tokens) for including substantial code and context.
|
||||
- **Pricing:** Groq offers competitive pricing with their speed advantages. Check the [Groq Pricing](https://groq.com/pricing) page for current rates.
|
||||
- **Rate Limits:** Groq has generous rate limits, but check their documentation for current limits based on your usage tier.
|
||||
@@ -43,7 +43,6 @@ While the "OpenAI Compatible" provider type allows connecting to various endpoin
|
||||
- `o1`
|
||||
- `o1-preview`
|
||||
- `o1-mini`
|
||||
- `gpt-4.5-preview`
|
||||
- `gpt-4o`
|
||||
- `gpt-4o-mini`
|
||||
|
||||
|
||||
@@ -26,7 +26,6 @@ Cline is compatible with a variety of OpenAI models, including but not limited t
|
||||
- `o1`
|
||||
- `o1-preview`
|
||||
- `o1-mini`
|
||||
- `gpt-4.5-preview`
|
||||
- `gpt-4o`
|
||||
- `gpt-4o-mini`
|
||||
- 'gpt-4.1'
|
||||
|
||||
@@ -10,7 +10,7 @@ Cline supports accessing models through the [Requesty](https://www.requesty.ai/)
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to the [Requesty website](https://www.requesty.ai/) and create an account or sign in.
|
||||
2. **Get API Key:** You can get an API key from the [API Management](https://app.requesty.ai/manage-api) section of your Requesty dashboard.
|
||||
2. **Get API Key:** You can get an API key from the [API Management](https://app.requesty.ai/api-keys) section of your Requesty dashboard.
|
||||
|
||||
### Supported Models
|
||||
|
||||
@@ -26,7 +26,7 @@ Requesty provides access to a wide range of models. Cline will automatically fet
|
||||
### Tips and Notes
|
||||
|
||||
- **Optimizations**: Requesty offers a range of in-flight cost optimizations to lower your costs.
|
||||
- **Unified and simplified billing**: Unrestricted access to all providers and models, automatic balance top ups and more via a single [API key](https://app.requesty.ai/manage-api).
|
||||
- **Unified and simplified billing**: Unrestricted access to all providers and models, automatic balance top ups and more via a single [API key](https://app.requesty.ai/api-keys).
|
||||
- **Cost tracking**: Track cost per model, coding language, changed file, and more via the [Cost dashboard](https://app.requesty.ai/cost-management) or the [Requesty VS Code extension](https://marketplace.visualstudio.com/items?itemName=Requesty.requesty).
|
||||
- **Stats and logs**: See your [coding stats dashboard](https://app.requesty.ai/usage-stats) or go through your [LLM interaction logs](https://app.requesty.ai/logs).
|
||||
- **Fallback policies**: Keep your LLM working for you with fallback policies when providers are down.
|
||||
|
||||
@@ -7,12 +7,13 @@ SAP AI Core and the generative AI hub help you to integrate LLMs and AI into new
|
||||
|
||||
**Website:** [SAP Help Portal](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/what-is-sap-ai-core)
|
||||
|
||||
### Getting a Service Binding
|
||||
|
||||
> 💡 **Information**
|
||||
>
|
||||
> SAP AI Core, and Generative AI Hub, are offerings from SAP BTP.
|
||||
> You need an active SAP BTP contract and a existing subaccount with a SAP AI Core instance to perform these steps.
|
||||
> You need an active SAP BTP contract and a existing subaccount with a SAP AI Core instance with the `extended` service plan (For more details about SAP AI Core service plans and their capabilities, see the [Service Plans documentation](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/service-plans)) to perform these steps.
|
||||
|
||||
### Getting a Service Binding
|
||||
|
||||
1. **Access:** Go to your subaccount via [BTP Cloud Cockpit](cockpit.btp.cloud.sap/cockpit)
|
||||
2. **Create a Service Binding:** Go to "Instances and Subscriptions", select your SAP AI Core service instance and click on Service Bindings > Create.
|
||||
@@ -32,8 +33,44 @@ Refer to the [Generative AI Hub Supported Models page](https://me.sap.com/notes/
|
||||
5. **Enter Base URL:** Add the `.serviceurls.AI_API_URL` field from the service binding into the "AI Core Base URL" field.
|
||||
6. **Enter Auth URL:** Add the `.url` field from the service binding into the "AI Core Auth URL" field.
|
||||
7. **Enter Resource Group:** Add the resource group where you have your model deployments. See [Create a Deployment for a Generative AI Model](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-generative-ai-model-in-sap-ai-core).
|
||||
8. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
8. **Configure Orchestration Mode:** If you have an `extended` service plan, the "Orchestration Mode" checkbox will automatically appear.
|
||||
9. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Orchestration Mode vs Native API
|
||||
|
||||
**Orchestration Mode:**
|
||||
- **Simplified usage:** Provides access to all available models without requiring individual deployments using the [Harmonized API](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/harmonized-api)
|
||||
|
||||
**Native API Mode:**
|
||||
- **Manual deployments:** Requires manual model deployment and management in your SAP AI Core service instance
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Model Selection:** SAP AI Core offers a wide range of models. You won't be able to use the model, even if selected, if a deployment doesn't exist in the provided resource group.
|
||||
- **Service Plan Requirement:** You must have the SAP AI Core `extended` service plan to use LLMs with Cline. Other service plans do not provide access to Generative AI Hub.
|
||||
|
||||
- **Orchestration Mode (Recommended):** Keep Orchestration Mode enabled for the simplest setup. It provides automatic access to all available models without requiring manual deployments.
|
||||
|
||||
- **Native API Mode:** Only disable Orchestration Mode if you have specific requirements that necessitate direct AI Core API access or need features not supported by the orchestration mode.
|
||||
|
||||
- **When using Native API Mode:**
|
||||
- **Model Selection:** The model dropdown displays models in two separate lists:
|
||||
- **Deployed Models:** These models are already deployed in your specified resource group and are ready to use immediately.
|
||||
- **Not Deployed Models:** These models don't have active deployments in your specified resource group. You won't be able to use these models until you create deployments for them in SAP AI Core.
|
||||
- **Creating Deployments:** To use a model that has not been deployed yet, you'll need to create a deployment in your SAP AI Core service instance. See [Create a Deployment for a Generative AI Model](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/create-deployment-for-generative-ai-model-in-sap-ai-core) for instructions.
|
||||
|
||||
#### Configuring Reasoning Effort for OpenAI Models
|
||||
|
||||
When using OpenAI reasoning models (such as o1, o3, o3-mini, o4-mini) through SAP AI Core, you can control the reasoning effort to balance performance and cost:
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Navigate to Features:** Go to the "Features" section in the settings.
|
||||
3. **Find OpenAI Reasoning Effort:** Locate the "OpenAI Reasoning Effort" setting.
|
||||
4. **Choose Effort Level:** Select between:
|
||||
- **Low:** Faster responses with lower token usage, suitable for simpler tasks
|
||||
- **Medium:** Balanced performance and token usage for most tasks
|
||||
- **High:** More thorough analysis with higher token usage, better for complex reasoning tasks
|
||||
|
||||
> 💡 **Note**
|
||||
>
|
||||
> This setting only applies when using OpenAI reasoning models (o1, o3, o3-mini, o4-mini, gpt-5, etc.) deployed through SAP AI Core. Other models will ignore this setting.
|
||||
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
---
|
||||
title: "Vercel AI Gateway"
|
||||
description: "Use Vercel AI Gateway in Cline to reach 100+ models from one endpoint with routing, retries, and spend observability."
|
||||
---
|
||||
|
||||
Vercel AI Gateway gives you a single API to access models from many providers. You switch by model id without swapping SDKs or juggling multiple keys. Cline integrates directly so you can pick a Gateway model in the dropdown, use it like any other provider, and see token and cache usage in the stream.
|
||||
|
||||
Useful links:
|
||||
- Team dashboard: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai
|
||||
- Models catalog: https://vercel.com/ai-gateway/models
|
||||
- Docs: https://vercel.com/docs/ai-gateway
|
||||
|
||||
## What you get
|
||||
|
||||
- One endpoint for 100+ models with a single key
|
||||
- Automatic retries and fallbacks that you configure on the dashboard
|
||||
- Spend monitoring with requests by model, token counts, cache usage, latency percentiles, and cost
|
||||
- OpenAI-compatible surface so existing clients work
|
||||
|
||||
## Getting an API Key
|
||||
|
||||
1. Sign in at https://vercel.com
|
||||
2. Dashboard → AI Gateway → API Keys → Create key
|
||||
3. Copy the key
|
||||
|
||||
For more on authentication and OIDC options, see https://vercel.com/docs/ai-gateway/authentication
|
||||
|
||||
## Configuration in Cline
|
||||
|
||||
1. Open Cline settings
|
||||
2. Select **Vercel AI Gateway** as the API Provider
|
||||
3. Paste your Gateway API Key
|
||||
4. Pick a model from the list. Cline fetches the catalog automatically. You can also paste an exact id
|
||||
|
||||
Notes:
|
||||
- Model ids often follow `provider/model`. Copy the exact id from the catalog
|
||||
Examples:
|
||||
- `openai/gpt-5`
|
||||
- `anthropic/claude-sonnet-4`
|
||||
- `google/gemini-2.5-pro`
|
||||
- `groq/llama-3.1-70b`
|
||||
- `deepseek/deepseek-v3`
|
||||
|
||||
## Observability you can act on
|
||||
|
||||
<Frame>
|
||||
<img src="https://assets.vercel.com/image/upload/v1753121283/gateway-overhead-dark_zhqwwj.svg" alt="Vercel AI Gateway observability with requests by model, tokens, cache, latency, and cost." />
|
||||
</Frame>
|
||||
|
||||
What to watch:
|
||||
- Requests by model - confirm routing and adoption
|
||||
- Tokens - input vs output, including reasoning if exposed
|
||||
- Cache - cached input and cache creation tokens
|
||||
- Latency - p75 duration and p75 time to first token
|
||||
- Cost - per project and per model
|
||||
|
||||
Use it to:
|
||||
- Compare output tokens per request before and after a model change
|
||||
- Validate cache strategy by tracking cache reads and write creation
|
||||
- Catch TTFT regressions during experiments
|
||||
- Align budgets with real usage
|
||||
|
||||
## Supported models
|
||||
|
||||
The gateway supports a large and changing set of models. Cline pulls the list from the Gateway API and caches it locally. For the current catalog, see https://vercel.com/ai-gateway/models
|
||||
|
||||
## Tips
|
||||
|
||||
<Tip>
|
||||
Use separate gateway keys per environment (dev, staging, prod). It keeps dashboards clean and budgets isolated.
|
||||
</Tip>
|
||||
|
||||
<Note>
|
||||
Pricing is pass-through at provider list price. Bring-your-own key has 0% markup. You still pay provider and processing fees.
|
||||
</Note>
|
||||
|
||||
<Info>
|
||||
Vercel does not add rate limits. Upstream providers may. New accounts receive $5 credits every 30 days until the first payment.
|
||||
</Info>
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- 401 - send the Gateway key to the Gateway endpoint, not an upstream URL
|
||||
- 404 model - copy the exact id from the Vercel catalog
|
||||
- Slow first token - check p75 TTFT in the dashboard and try a model optimized for streaming
|
||||
- Cost spikes - break down by model in the dashboard and cap or route traffic
|
||||
|
||||
## Inspiration
|
||||
|
||||
- Multi-model evals - swap only the model id in Cline and compare latency and output tokens
|
||||
- Progressive rollout - route a small percent to a new model in the dashboard and ramp with metrics
|
||||
- Budget enforcement - set per-project limits without code changes
|
||||
|
||||
## Crosslinks
|
||||
|
||||
- OpenAI-Compatible setup: /provider-config/openai-compatible
|
||||
- Model Selection Guide: /getting-started/model-selection-guide
|
||||
- Understanding Context Management: /getting-started/understanding-context-management
|
||||
@@ -0,0 +1,124 @@
|
||||
---
|
||||
title: "Z AI (Zhipu AI)"
|
||||
description: "Learn how to configure and use Z AI's GLM-4.5 models with Cline. Experience advanced hybrid reasoning, agentic capabilities, and open-source excellence with regional optimization."
|
||||
---
|
||||
|
||||
Z AI (formerly Zhipu AI) offers the groundbreaking GLM-4.5 series, featuring hybrid reasoning capabilities and agentic AI design. Released in July 2025, these models excel in unified reasoning, coding, and intelligent agent applications while maintaining open-source accessibility under MIT license.
|
||||
|
||||
**Website:** [https://z.ai/model-api](https://z.ai/model-api) (International) | [https://open.bigmodel.cn/](https://open.bigmodel.cn/) (China)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
#### International Users
|
||||
1. **Sign Up/Sign In:** Go to [https://z.ai/model-api](https://z.ai/model-api). Create an account or sign in.
|
||||
2. **Navigate to API Keys:** Access your account dashboard and find the API keys section.
|
||||
3. **Create a Key:** Generate a new API key for your application.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely.
|
||||
|
||||
#### China Mainland Users
|
||||
1. **Sign Up/Sign In:** Go to [https://open.bigmodel.cn/](https://open.bigmodel.cn/). Create an account or sign in.
|
||||
2. **Navigate to API Keys:** Access your account dashboard and find the API keys section.
|
||||
3. **Create a Key:** Generate a new API key for your application.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Z AI provides different model catalogs based on your selected region:
|
||||
|
||||
#### GLM-4.5 Series
|
||||
- **GLM-4.5** - Flagship model with 355B total parameters, 32B active parameters
|
||||
- **GLM-4.5-Air** - Compact model with 106B total parameters, 12B active parameters
|
||||
|
||||
#### GLM-4.5 Hybrid Reasoning Models
|
||||
- **GLM-4.5 (Thinking Mode)** - Advanced reasoning with step-by-step analysis
|
||||
- **GLM-4.5-Air (Thinking Mode)** - Efficient reasoning for mainstream hardware
|
||||
|
||||
All models feature:
|
||||
- **128,000 token context window** for extensive document processing
|
||||
- **Mixture of Experts (MoE) architecture** for optimal performance
|
||||
- **Agent-native design** integrating reasoning, coding, and tool usage
|
||||
- **Open-source availability** under MIT license
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Z AI" from the "API Provider" dropdown.
|
||||
3. **Select Region:** Choose your region:
|
||||
- "International" for global access
|
||||
- "China" for mainland China access
|
||||
4. **Enter API Key:** Paste your Z AI API key into the "Z AI API Key" field.
|
||||
5. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Z AI's Hybrid Intelligence
|
||||
|
||||
Z AI's GLM-4.5 series introduces revolutionary capabilities that set it apart from conventional language models:
|
||||
|
||||
#### Hybrid Reasoning Architecture
|
||||
GLM-4.5 operates in two distinct modes:
|
||||
- **Thinking Mode:** Designed for complex reasoning tasks and tool usage, engaging in deeper analytical processes
|
||||
- **Non-Thinking Mode:** Provides immediate responses for straightforward queries, optimizing efficiency
|
||||
|
||||
This dual-mode architecture represents an "agent-native" design philosophy that adapts processing intensity based on query complexity.
|
||||
|
||||
#### Exceptional Performance
|
||||
GLM-4.5 achieves a comprehensive score of **63.2** across 12 benchmarks spanning agentic tasks, reasoning, and coding challenges, securing **3rd place** among all proprietary and open-source models. GLM-4.5-Air maintains competitive performance with a score of **59.8** while delivering superior efficiency.
|
||||
|
||||
#### Mixture of Experts Excellence
|
||||
The sophisticated MoE architecture optimizes performance while maintaining computational efficiency:
|
||||
- **GLM-4.5:** 355B total parameters with 32B active parameters
|
||||
- **GLM-4.5-Air:** 106B total parameters with 12B active parameters
|
||||
|
||||
#### Extended Context Capabilities
|
||||
The 128,000-token context window enables comprehensive understanding of lengthy documents and codebases, with real-world testing confirming effective processing of nearly 2,000-line codebases while maintaining remarkable performance.
|
||||
|
||||
#### Open-Source Leadership
|
||||
Released under MIT license, GLM-4.5 provides researchers and developers with access to state-of-the-art capabilities without proprietary restrictions, including base models, hybrid reasoning versions, and optimized FP8 variants.
|
||||
|
||||
### Regional Optimization
|
||||
|
||||
#### API Endpoints
|
||||
- **International:** Uses `https://api.z.ai/api/paas/v4`
|
||||
- **China:** Uses `https://open.bigmodel.cn/api/paas/v4`
|
||||
|
||||
#### Model Availability
|
||||
The region setting determines both API endpoint and available models, with automatic filtering to ensure compatibility with your selected region.
|
||||
|
||||
### Special Features
|
||||
|
||||
#### Agentic Capabilities
|
||||
GLM-4.5's unified architecture makes it particularly suitable for complex intelligent agent applications requiring integrated reasoning, coding, and tool utilization capabilities.
|
||||
|
||||
#### Comprehensive Benchmarking
|
||||
Performance evaluation encompasses:
|
||||
- **3 agentic task benchmarks**
|
||||
- **7 reasoning benchmarks**
|
||||
- **2 coding benchmarks**
|
||||
|
||||
This comprehensive assessment demonstrates versatility across diverse AI applications.
|
||||
|
||||
#### Developer Integration
|
||||
Models support integration through multiple frameworks:
|
||||
- **transformers**
|
||||
- **vLLM**
|
||||
- **SGLang**
|
||||
|
||||
Complete with dedicated model code, tool parser, and reasoning parser implementations.
|
||||
|
||||
### Performance Comparisons
|
||||
|
||||
#### vs Claude 4 Sonnet
|
||||
GLM-4.5 shows competitive performance in agentic coding and reasoning tasks, though Claude Sonnet 4 maintains advantages in coding success rates and autonomous multi-feature application development.
|
||||
|
||||
#### vs GPT-4.5
|
||||
GLM-4.5 ranks competitively in reasoning and agent benchmarks, with GPT-4.5 generally leading in raw task accuracy on professional benchmarks like MMLU and AIME.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Region Selection:** Choose the appropriate region for optimal performance and compliance with local regulations.
|
||||
- **Model Selection:** GLM-4.5 for maximum performance, GLM-4.5-Air for efficiency and mainstream hardware compatibility.
|
||||
- **Context Advantage:** Large 128K context window enables processing of substantial codebases and documents.
|
||||
- **Open Source Benefits:** MIT license enables both commercial use and secondary development.
|
||||
- **Agentic Applications:** Particularly strong for applications requiring reasoning, coding, and tool usage integration.
|
||||
- **Hybrid Reasoning:** Use Thinking Mode for complex problems, Non-Thinking Mode for simple queries.
|
||||
- **API Compatibility:** OpenAI-compatible API provides streaming responses and usage reporting.
|
||||
- **Framework Support:** Multiple integration options available for different deployment scenarios.
|
||||
+2
-3
@@ -1,7 +1,7 @@
|
||||
import fs from "node:fs"
|
||||
import * as esbuild from "esbuild"
|
||||
import path from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
import * as esbuild from "esbuild"
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
@@ -20,7 +20,6 @@ const aliasResolverPlugin = {
|
||||
setup(build) {
|
||||
const aliases = {
|
||||
"@": path.resolve(__dirname, "src"),
|
||||
"@api": path.resolve(__dirname, "src/api"),
|
||||
"@core": path.resolve(__dirname, "src/core"),
|
||||
"@integrations": path.resolve(__dirname, "src/integrations"),
|
||||
"@services": path.resolve(__dirname, "src/services"),
|
||||
@@ -170,7 +169,7 @@ const standaloneConfig = {
|
||||
const e2eBuildConfig = {
|
||||
...baseConfig,
|
||||
entryPoints: ["src/test/e2e/utils/build.ts"],
|
||||
outfile: `${destDir}/e2e-build.js`,
|
||||
outfile: `${destDir}/e2e-build.mjs`,
|
||||
external: ["@vscode/test-electron", "execa"],
|
||||
sourcemap: false,
|
||||
plugins: [aliasResolverPlugin, esbuildProblemMatcherPlugin],
|
||||
|
||||
@@ -1,123 +0,0 @@
|
||||
const { RuleTester: DirectApiRuleTester } = require("eslint")
|
||||
const noDirectVscodeApiRule = require("../no-direct-vscode-api")
|
||||
|
||||
const directApiRuleTester = new DirectApiRuleTester({
|
||||
parser: require.resolve("@typescript-eslint/parser"),
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
sourceType: "module",
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
directApiRuleTester.run("no-direct-vscode-api", noDirectVscodeApiRule, {
|
||||
valid: [
|
||||
// Should allow vscode.postMessage in grpc-client-base.ts
|
||||
{
|
||||
code: `vscode.postMessage({ type: "grpc_request", data: {} })`,
|
||||
filename: "grpc-client-base.ts",
|
||||
},
|
||||
{
|
||||
code: `vscode.postMessage({ type: "grpc_request_cancel" })`,
|
||||
filename: "/path/to/grpc-client-base.ts",
|
||||
},
|
||||
// Should allow in exception directories
|
||||
{
|
||||
code: `vscode.workspace.workspaceFolders`,
|
||||
filename: "/src/hosts/vscode/host-bridge.ts",
|
||||
},
|
||||
{
|
||||
code: `vscode.workspace.fs.stat(uri)`,
|
||||
filename: "/standalone/runtime-files/helpers.ts",
|
||||
},
|
||||
// Should allow other vscode API calls
|
||||
{
|
||||
code: `vscode.window.showInformationMessage("Hello")`,
|
||||
filename: "test.ts",
|
||||
},
|
||||
// Should allow postMessage calls on other objects
|
||||
{
|
||||
code: `window.postMessage({ type: "test" }, "*")`,
|
||||
filename: "test.ts",
|
||||
},
|
||||
// Should allow variables named vscode but not calling postMessage
|
||||
{
|
||||
code: `const vscode = { other: "method" }; vscode.other()`,
|
||||
filename: "test.ts",
|
||||
},
|
||||
],
|
||||
invalid: [
|
||||
// Should disallow vscode.postMessage in regular files
|
||||
{
|
||||
code: `vscode.postMessage({ type: "test", data: {} })`,
|
||||
filename: "test.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useGrpcClient",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow vscode.postMessage in components
|
||||
{
|
||||
code: `vscode.postMessage({ type: "apiConfiguration", apiConfiguration })`,
|
||||
filename: "ApiOptions.tsx",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useGrpcClient",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow vscode.postMessage in test files
|
||||
{
|
||||
code: `vscode.postMessage({ type: "newTask", text: message.text })`,
|
||||
filename: "test.test.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useGrpcClient",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow property access for disallowed APIs
|
||||
{
|
||||
code: `const folders = vscode.workspace.workspaceFolders;`,
|
||||
filename: "workspace.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useHostBridge",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow method calls for disallowed APIs
|
||||
{
|
||||
code: `const relativePath = vscode.workspace.asRelativePath(filePath);`,
|
||||
filename: "path-utils.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "usePathUtils",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow nested property access
|
||||
{
|
||||
code: `const stats = await vscode.workspace.fs.stat(uri);`,
|
||||
filename: "file-utils.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useFsUtils",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow getting a workspace folder
|
||||
{
|
||||
code: `const folder = vscode.workspace.getWorkspaceFolder(uri);`,
|
||||
filename: "path-helper.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "usePathUtils",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -1,16 +0,0 @@
|
||||
// eslint-rules/index.js
|
||||
const noDirectVscodeApi = require("./no-direct-vscode-api")
|
||||
|
||||
module.exports = {
|
||||
rules: {
|
||||
"no-direct-vscode-api": noDirectVscodeApi,
|
||||
},
|
||||
configs: {
|
||||
recommended: {
|
||||
plugins: ["local"],
|
||||
rules: {
|
||||
"local/no-direct-vscode-api": "warn",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,214 +0,0 @@
|
||||
const { ESLintUtils } = require("@typescript-eslint/utils")
|
||||
const path = require("path")
|
||||
|
||||
const createRule = ESLintUtils.RuleCreator((name) => `https://cline.bot/eslint-rules/${name}`)
|
||||
|
||||
// Configuration of disallowed VSCode APIs and their recommended alternatives
|
||||
const disallowedApis = {
|
||||
"vscode.postMessage": {
|
||||
messageId: "useGrpcClient",
|
||||
},
|
||||
"vscode.workspace.fs.stat": {
|
||||
messageId: "useFsUtils",
|
||||
},
|
||||
"vscode.workspace.fs.writeFile": {
|
||||
messageId: "useFsUtils",
|
||||
},
|
||||
"vscode.workspace.workspaceFolders": {
|
||||
messageId: "useHostBridgeWorkspace",
|
||||
},
|
||||
"vscode.workspace.asRelativePath": {
|
||||
messageId: "usePathUtils",
|
||||
},
|
||||
"vscode.workspace.getWorkspaceFolder": {
|
||||
messageId: "usePathUtils",
|
||||
},
|
||||
"vscode.window.showTextDocument": {
|
||||
messageId: "useHostBridge",
|
||||
},
|
||||
"vscode.workspace.applyEdit": {
|
||||
messageId: "useHostBridge",
|
||||
},
|
||||
"vscode.window.onDidChangeActiveTextEditor": {
|
||||
messageId: "useHostBridge",
|
||||
},
|
||||
"vscode.env.openExternal": {
|
||||
messageId: "useUtils",
|
||||
},
|
||||
// "vscode.window.showWarningMessage": {
|
||||
// messageId: "useHostBridgeShowMessage",
|
||||
// },
|
||||
"vscode.window.showOpenDialog": {
|
||||
messageId: "useHostBridgeShowMessage",
|
||||
},
|
||||
"vscode.window.showErrorMessage": {
|
||||
messageId: "useHostBridgeShowMessage",
|
||||
},
|
||||
// "vscode.window.showInformationMessage": {
|
||||
// messageId: "useHostBridgeShowMessage",
|
||||
// },
|
||||
}
|
||||
|
||||
module.exports = createRule({
|
||||
name: "no-direct-vscode-api",
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description:
|
||||
"Disallow direct VSCode API usage in favor of Cline's abstraction layers, except in src/hosts/vscode and standalone/runtime-files directories",
|
||||
recommended: "error",
|
||||
},
|
||||
messages: {
|
||||
useGrpcClient:
|
||||
"Use gRPC service clients instead of vscode.postMessage().\n" +
|
||||
"Example: AccountServiceClient.methodName(RequestType.create({...})) instead of vscode.postMessage({type: '...'}).\n" +
|
||||
"Found: {{code}}",
|
||||
useFsUtils:
|
||||
"Use utilities in @/utils/fs instead of vscode.workspace.fs\n" +
|
||||
"Example: import { isDirectory } from '@/utils/fs' or use the file system methods from the host bridge provider.\n" +
|
||||
"Found: {{code}}",
|
||||
usePathUtils:
|
||||
"Use path utilities from @/utils/path instead of VSCode workspace path methods.\n" +
|
||||
"This provides consistent path handling across different environments.\n" +
|
||||
"Found: {{code}}",
|
||||
useHostBridgeWorkspace:
|
||||
"Use HostProvider.workspace.getWorkspacePaths({}) instead of vscode.workspace.workspaceFolders.\n" +
|
||||
"This provides a consistent abstraction across VSCode and standalone environments.\n" +
|
||||
"Found: {{code}}",
|
||||
useHostBridgeShowMessage:
|
||||
"Use HostProvider.window.showMessage instead of the vscode.window.showMessage.\n" +
|
||||
"This provides a consistent abstraction across VSCode and standalone environments.\n" +
|
||||
"Found: {{code}}",
|
||||
useHostBridge:
|
||||
"Use the host bridge instead of calling vscode APIs directly.\n" +
|
||||
"This provides a consistent abstraction across VSCode and standalone environments.\n" +
|
||||
"Found: {{code}}",
|
||||
useUtils:
|
||||
"Use utilities in @/utils instead of calling vscode APIs directly.\n" +
|
||||
"This provides a consistent abstraction across VSCode and standalone environments.\n" +
|
||||
"Found: {{code}}",
|
||||
},
|
||||
schema: [],
|
||||
},
|
||||
defaultOptions: [],
|
||||
|
||||
create(context) {
|
||||
// Pattern for checking memberExpressions like vscode.workspace.fs.stat
|
||||
function checkMemberExpression(node) {
|
||||
if (isExcluded(context.filename)) {
|
||||
// Skip if this file is being excluded.
|
||||
return
|
||||
}
|
||||
|
||||
// For handling nested properties like vscode.workspace.fs.stat
|
||||
function getFullPropertyPath(node) {
|
||||
if (node.type !== "MemberExpression") {
|
||||
return node.name || ""
|
||||
}
|
||||
|
||||
const objectPart = getFullPropertyPath(node.object)
|
||||
const propertyPart = node.property.name || ""
|
||||
|
||||
return objectPart ? `${objectPart}.${propertyPart}` : propertyPart
|
||||
}
|
||||
|
||||
// Check if the expression matches one of our disallowed patterns
|
||||
if (node.object && node.object.type === "Identifier" && node.object.name === "vscode") {
|
||||
const fullPath = `vscode.${node.property.name}`
|
||||
checkDisallowedApi(fullPath, node)
|
||||
}
|
||||
// Handle nested expressions like vscode.workspace.fs.stat
|
||||
else if (node.object && node.object.type === "MemberExpression") {
|
||||
const fullPath = getFullPropertyPath(node)
|
||||
|
||||
// Only proceed if it starts with vscode
|
||||
if (fullPath.startsWith("vscode.")) {
|
||||
checkDisallowedApi(fullPath, node)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if an expression matches a disallowed API and report if it does
|
||||
function checkDisallowedApi(expressionPath, node) {
|
||||
// Check exact matches
|
||||
if (disallowedApis[expressionPath]) {
|
||||
reportViolation(expressionPath, node)
|
||||
return
|
||||
}
|
||||
|
||||
// Check prefix matches (for nested properties)
|
||||
for (const disallowedApi in disallowedApis) {
|
||||
// For direct property access like vscode.workspace.workspaceFolders
|
||||
if (expressionPath === disallowedApi) {
|
||||
reportViolation(disallowedApi, node)
|
||||
return
|
||||
}
|
||||
|
||||
// For method calls like vscode.workspace.asRelativePath(...)
|
||||
if (expressionPath.startsWith(`${disallowedApi}.`) || expressionPath.startsWith(`${disallowedApi}(`)) {
|
||||
reportViolation(disallowedApi, node)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Report a violation with the appropriate message
|
||||
function reportViolation(disallowedApi, node) {
|
||||
const sourceCode = context.sourceCode
|
||||
const config = disallowedApis[disallowedApi]
|
||||
|
||||
// For method calls, get the whole call expression
|
||||
let reportNode = node
|
||||
let parentNode = sourceCode.getAncestors(node).pop()
|
||||
if (parentNode && parentNode.type === "CallExpression" && parentNode.callee === node) {
|
||||
reportNode = parentNode
|
||||
}
|
||||
|
||||
const callText = sourceCode.getText(reportNode).trim()
|
||||
|
||||
context.report({
|
||||
node: reportNode,
|
||||
messageId: config.messageId,
|
||||
data: {
|
||||
code: callText,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
function isExcluded(filename) {
|
||||
// Check if current file is in an exception directory or is grpc-client-base.ts
|
||||
if (path.basename(filename) === "grpc-client-base.ts") {
|
||||
return true
|
||||
}
|
||||
// Skip checking files in src/hosts/vscode or standalone/runtime-files
|
||||
if (filename.includes("/src/hosts/vscode/")) {
|
||||
return true
|
||||
}
|
||||
if (filename.includes("/standalone/runtime-files/")) {
|
||||
return true
|
||||
}
|
||||
// Skip unit tests
|
||||
if (filename.endsWith(".test.ts")) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
// Detect basic member expressions (e.g., vscode.postMessage)
|
||||
MemberExpression(node) {
|
||||
checkMemberExpression(node)
|
||||
},
|
||||
|
||||
// Detect property access through destructuring
|
||||
VariableDeclarator(node) {
|
||||
// Skip if this file is in an exception directory or is grpc-client-base.ts
|
||||
if (isExcluded(context.filename)) {
|
||||
return
|
||||
}
|
||||
|
||||
// Destructuring pattern checks removed as developers don't use the API this way
|
||||
// They always use direct imports: import * as vscode from "vscode" and direct access: vscode.thing.foo
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
Generated
-2479
File diff suppressed because it is too large
Load Diff
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"name": "eslint-plugin-eslint-rules",
|
||||
"version": "1.0.0",
|
||||
"description": "Custom ESLint rules for Cline",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "mocha --no-config --require ts-node/register __tests__/**/*.test.ts"
|
||||
},
|
||||
"keywords": [
|
||||
"eslint",
|
||||
"eslintplugin"
|
||||
],
|
||||
"author": "Cline Bot Inc.",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/utils": "^8.33.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/eslint": "^8.0.0",
|
||||
"@types/mocha": "^10.0.7",
|
||||
"@types/node": "^20.0.0",
|
||||
"@typescript-eslint/parser": "^7.14.1",
|
||||
"eslint": "^8.57.0",
|
||||
"mocha": "^10.0.0",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": ">=8.0.0"
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es2020",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"outDir": "dist",
|
||||
"resolveJsonModule": true,
|
||||
"declaration": true
|
||||
},
|
||||
"include": ["**/*.ts", "**/*.js", "**/*.tsx", "__tests__/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
@@ -10,6 +10,7 @@ interface RunDiffEvalOptions {
|
||||
parsingFunction: string
|
||||
diffEditFunction: string
|
||||
thinkingBudget: number
|
||||
provider: string
|
||||
parallel: boolean
|
||||
verbose: boolean
|
||||
testPath: string
|
||||
@@ -39,6 +40,8 @@ export async function runDiffEvalHandler(options: RunDiffEvalOptions) {
|
||||
options.parsingFunction,
|
||||
"--diff-edit-function",
|
||||
options.diffEditFunction,
|
||||
"--provider",
|
||||
options.provider,
|
||||
]
|
||||
|
||||
// Conditionally add the optional arguments
|
||||
|
||||
@@ -92,6 +92,7 @@ program
|
||||
.option("--parsing-function <name>", "The parsing function to use", "parseAssistantMessageV2")
|
||||
.option("--diff-edit-function <name>", "The diff editing function to use", "constructNewFileContentV2")
|
||||
.option("--thinking-budget <tokens>", "Set the thinking tokens budget", "0")
|
||||
.option("--provider <provider>", "API provider to use (openrouter, openai)", "openrouter")
|
||||
.option("--parallel", "Run tests in parallel", false)
|
||||
.option("--replay", "Run evaluation from a pre-recorded LLM output, skipping the API call", false)
|
||||
.option("--replay-run-id <run_id>", "The ID of the run to replay from the database")
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import { OpenRouterHandler } from "../../src/api/providers/openrouter"
|
||||
import { ApiHandlerOptions } from "../../src/shared/api"
|
||||
import { OpenAiNativeHandler } from "../../src/api/providers/openai-native"
|
||||
import { Anthropic } from "@anthropic-ai/sdk"
|
||||
|
||||
import {
|
||||
parseAssistantMessageV1,
|
||||
parseAssistantMessageV2,
|
||||
parseAssistantMessageV3,
|
||||
AssistantMessageContent,
|
||||
} from "./parsing/parse-assistant-message-06-06-25" // "../../src/core/assistant-message"
|
||||
import { constructNewFileContent as constructNewFileContent_06_06_25 } from "./diff-apply/diff-06-06-25"
|
||||
@@ -17,9 +15,7 @@ type ParseAssistantMessageFn = (message: string) => AssistantMessageContent[]
|
||||
type ConstructNewFileContentFn = (diff: string, original: string, strict: boolean) => Promise<string | any>
|
||||
|
||||
const parsingFunctions: Record<string, ParseAssistantMessageFn> = {
|
||||
parseAssistantMessageV1: parseAssistantMessageV1,
|
||||
parseAssistantMessageV2: parseAssistantMessageV2,
|
||||
parseAssistantMessageV3: parseAssistantMessageV3,
|
||||
}
|
||||
|
||||
const diffEditingFunctions: Record<string, ConstructNewFileContentFn> = {
|
||||
@@ -54,7 +50,7 @@ interface StreamResult {
|
||||
* Process the stream and return full response with timing data
|
||||
*/
|
||||
async function processStream(
|
||||
handler: OpenRouterHandler,
|
||||
handler: OpenRouterHandler | OpenAiNativeHandler,
|
||||
systemPrompt: string,
|
||||
messages: Anthropic.Messages.MessageParam[],
|
||||
): Promise<StreamResult> {
|
||||
@@ -190,19 +186,7 @@ export async function runSingleEvaluation(input: TestInput): Promise<TestResult>
|
||||
}
|
||||
}
|
||||
|
||||
const options: ApiHandlerOptions = {
|
||||
openRouterApiKey: apiKey,
|
||||
openRouterModelId: modelId,
|
||||
thinkingBudgetTokens: thinkingBudgetTokens,
|
||||
openRouterModelInfo: {
|
||||
maxTokens: 10_000,
|
||||
contextWindow: 1_000_000,
|
||||
supportsImages: true,
|
||||
supportsPromptCache: true, // may need to turn this on
|
||||
inputPrice: 0,
|
||||
outputPrice: 0,
|
||||
},
|
||||
}
|
||||
const provider = input.provider || "openrouter"
|
||||
|
||||
// Get the output of streaming output of this llm call
|
||||
let streamResult: StreamResult
|
||||
@@ -214,10 +198,34 @@ export async function runSingleEvaluation(input: TestInput): Promise<TestResult>
|
||||
usage: { inputTokens: 0, outputTokens: 0, cacheWriteTokens: 0, cacheReadTokens: 0, totalCost: 0 },
|
||||
}
|
||||
} else {
|
||||
// Live mode: existing API call logic
|
||||
// Live mode: provider-specific API call logic
|
||||
try {
|
||||
const openRouterHandler = new OpenRouterHandler(options)
|
||||
streamResult = await processStream(openRouterHandler, systemPrompt, messages)
|
||||
let handler: OpenRouterHandler | OpenAiNativeHandler
|
||||
|
||||
if (provider === "openai") {
|
||||
const openAiOptions = {
|
||||
openAiNativeApiKey: apiKey,
|
||||
apiModelId: modelId,
|
||||
}
|
||||
handler = new OpenAiNativeHandler(openAiOptions)
|
||||
} else {
|
||||
const openRouterOptions = {
|
||||
openRouterApiKey: apiKey,
|
||||
openRouterModelId: modelId,
|
||||
thinkingBudgetTokens: thinkingBudgetTokens,
|
||||
openRouterModelInfo: {
|
||||
maxTokens: 10_000,
|
||||
contextWindow: 1_000_000,
|
||||
supportsImages: true,
|
||||
supportsPromptCache: true,
|
||||
inputPrice: 0,
|
||||
outputPrice: 0,
|
||||
},
|
||||
}
|
||||
handler = new OpenRouterHandler(openRouterOptions)
|
||||
}
|
||||
|
||||
streamResult = await processStream(handler, systemPrompt, messages)
|
||||
} catch (error: any) {
|
||||
return {
|
||||
success: false,
|
||||
|
||||
@@ -49,16 +49,25 @@ type TestResultSet = { [test_id: string]: (TestResult & { test_id?: string })[]
|
||||
|
||||
class NodeTestRunner {
|
||||
private apiKey: string | undefined
|
||||
private provider: string
|
||||
private currentRunId: string | null = null
|
||||
private systemPromptHash: string | null = null
|
||||
private processingFunctionsHash: string | null = null
|
||||
private caseIdMap: Map<string, string> = new Map() // test_id -> case_id mapping
|
||||
|
||||
constructor(isReplay: boolean) {
|
||||
constructor(isReplay: boolean, provider: string = "openrouter") {
|
||||
this.provider = provider
|
||||
if (!isReplay) {
|
||||
this.apiKey = process.env.OPENROUTER_API_KEY
|
||||
if (!this.apiKey) {
|
||||
throw new Error("OPENROUTER_API_KEY environment variable not set for a non-replay run.")
|
||||
if (provider === "openai") {
|
||||
this.apiKey = process.env.OPENAI_API_KEY
|
||||
if (!this.apiKey) {
|
||||
throw new Error("OPENAI_API_KEY environment variable not set for a non-replay run with OpenAI provider.")
|
||||
}
|
||||
} else {
|
||||
this.apiKey = process.env.OPENROUTER_API_KEY
|
||||
if (!this.apiKey) {
|
||||
throw new Error("OPENROUTER_API_KEY environment variable not set for a non-replay run with OpenRouter provider.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -635,6 +644,7 @@ class NodeTestRunner {
|
||||
thinkingBudgetTokens: testConfig.thinking_tokens_budget,
|
||||
originalDiffEditToolCallMessage: testConfig.replay ? testCase.original_diff_edit_tool_call_message : undefined,
|
||||
diffApplyFile: testConfig.diff_apply_file,
|
||||
provider: this.provider,
|
||||
isVerbose: isVerbose,
|
||||
}
|
||||
|
||||
@@ -927,6 +937,7 @@ async function main() {
|
||||
.option("--parsing-function <name>", "The parsing function to use", "parseAssistantMessageV2")
|
||||
.option("--diff-edit-function <name>", "The diff editing function to use", "diff-06-26-25")
|
||||
.option("--thinking-budget <tokens>", "Set the thinking tokens budget", "0")
|
||||
.option("--provider <provider>", "API provider to use (openrouter, openai)", "openrouter")
|
||||
.option("--parallel", "Run tests in parallel", false)
|
||||
.option("--replay", "Run evaluation from a pre-recorded LLM output, skipping the API call", false)
|
||||
.option("--replay-run-id <run_id>", "The ID of the run to replay from the database")
|
||||
@@ -959,7 +970,7 @@ async function main() {
|
||||
? parseInt(options.maxAttemptsPerCase, 10)
|
||||
: validAttemptsPerCase * 10;
|
||||
|
||||
const runner = new NodeTestRunner(options.replay || !!options.replayRunId)
|
||||
const runner = new NodeTestRunner(options.replay || !!options.replayRunId, options.provider)
|
||||
|
||||
if (options.replayRunId) {
|
||||
if (!options.diffApplyFile) {
|
||||
@@ -979,7 +990,7 @@ async function main() {
|
||||
log(isVerbose, "Warning: Could not load OpenRouter model data. Context window filtering might be affected for OpenRouter models.");
|
||||
}
|
||||
|
||||
const runner = new NodeTestRunner(options.replay)
|
||||
const runner = new NodeTestRunner(options.replay, options.provider)
|
||||
let allLoadedTestCases = runner.loadTestCases(testPath, isVerbose) // Pass isVerbose
|
||||
|
||||
const allProcessedTestCasesGlobal: ProcessedTestCase[] = allLoadedTestCases.map((tc) => ({
|
||||
|
||||
@@ -331,6 +331,42 @@ def get_performance_grade(success_rate):
|
||||
else:
|
||||
return "C", "poor"
|
||||
|
||||
def get_error_description(error_enum, error_string=None):
|
||||
"""Map error enum values to user-friendly descriptions"""
|
||||
error_map = {
|
||||
1: "No tool calls - Model didn't use the replace_in_file tool",
|
||||
2: "Multiple tool calls - Model called multiple tools instead of one",
|
||||
3: "Wrong tool call - Model used wrong tool (not replace_in_file)",
|
||||
4: "Missing parameters - Tool call missing required path or diff",
|
||||
5: "Wrong file edited - Model edited different file than expected",
|
||||
6: "Wrong tool call - Model used wrong tool type",
|
||||
7: "Wrong file edited - Model targeted incorrect file path",
|
||||
8: "API/Stream error - Problem with model API connection",
|
||||
9: "Configuration error - Invalid evaluation parameters",
|
||||
10: "Function error - Invalid parsing/diff functions",
|
||||
11: "Other error - Unexpected failure"
|
||||
}
|
||||
|
||||
base_description = error_map.get(error_enum, f"Unknown error (code: {error_enum})")
|
||||
|
||||
if error_string:
|
||||
return f"{base_description}: {error_string}"
|
||||
return base_description
|
||||
|
||||
def get_error_guidance(error_enum):
|
||||
"""Provide specific guidance based on error type"""
|
||||
guidance_map = {
|
||||
1: "💡 The model provided a response but didn't use the replace_in_file tool. Check the raw output to see what the model actually said.",
|
||||
2: "💡 The model called multiple tools when it should only call replace_in_file once. Check the parsed tool call section.",
|
||||
3: "💡 The model used a different tool instead of replace_in_file. This might indicate confusion about the task.",
|
||||
4: "💡 The model called replace_in_file but didn't provide the required 'path' or 'diff' parameters.",
|
||||
5: "💡 The model tried to edit a different file than expected. Check the parsed tool call to see which file it targeted.",
|
||||
6: "💡 The model used the wrong tool type. Check the raw output to see what tool it attempted to use.",
|
||||
7: "💡 The model tried to edit a different file path than expected. This could indicate path confusion or hallucination.",
|
||||
}
|
||||
|
||||
return guidance_map.get(error_enum, "")
|
||||
|
||||
def render_hero_section(current_run, model_performance):
|
||||
"""Render the hero section with key metrics"""
|
||||
run_title = current_run['description'] if current_run['description'] else f"Run {current_run['run_id'][:8]}..."
|
||||
@@ -570,12 +606,16 @@ def render_result_detail(result):
|
||||
"""Render detailed view of a single result"""
|
||||
st.markdown("### 🔬 Result Deep Dive")
|
||||
|
||||
# Check if this is a valid result
|
||||
is_valid = (result['error_enum'] not in [1, 6, 7]) if not pd.isna(result['error_enum']) else True
|
||||
# Check if this is a valid result (only invalid if no tool calls or wrong file)
|
||||
is_valid = True
|
||||
if not pd.isna(result['error_enum']):
|
||||
# Only these specific errors make a result "invalid" for the benchmark:
|
||||
# 1 = no_tool_calls, 5 = wrong_file_edited, 7 = wrong_file_edited
|
||||
is_valid = result['error_enum'] not in [1, 5, 7]
|
||||
|
||||
# Show validity warning if needed
|
||||
if not is_valid:
|
||||
st.warning("⚠️ **This is an invalid result** - The model didn't properly call the diff edit tool or edited the wrong file. This result is excluded from success rate calculations.")
|
||||
st.warning("⚠️ **This is an invalid result** - The model didn't call the replace_in_file tool or edited the wrong file. This result is excluded from success rate calculations.")
|
||||
|
||||
# Result metadata
|
||||
col1, col2, col3, col4 = st.columns(4)
|
||||
@@ -591,7 +631,10 @@ def render_result_detail(result):
|
||||
st.markdown(f"**Round Trip:** {result['time_round_trip_ms']:.0f}ms")
|
||||
|
||||
with col4:
|
||||
st.markdown(f"**Cost:** ${result['cost_usd']:.4f}")
|
||||
if pd.notna(result['cost_usd']) and result['cost_usd'] is not None:
|
||||
st.markdown(f"**Cost:** ${result['cost_usd']:.4f}")
|
||||
else:
|
||||
st.markdown(f"**Cost:** Free")
|
||||
|
||||
# Tabbed interface for different views
|
||||
tab1, tab2, tab3, tab4 = st.tabs(["📄 File & Edits", "🤖 Raw Output", "🔧 Parsed Tool Call", "📊 Metrics"])
|
||||
@@ -693,8 +736,46 @@ def render_file_and_edits_view(result):
|
||||
# Show error information
|
||||
st.error("❌ **Edit Failed**")
|
||||
|
||||
# Show detailed error reason
|
||||
if not pd.isna(result['error_enum']):
|
||||
st.markdown(f"**Error Code:** {result['error_enum']}")
|
||||
error_description = get_error_description(
|
||||
result['error_enum'],
|
||||
result.get('error_string')
|
||||
)
|
||||
st.markdown(f"**Reason:** {error_description}")
|
||||
|
||||
# Show specific guidance based on error type
|
||||
guidance = get_error_guidance(result['error_enum'])
|
||||
if guidance:
|
||||
st.info(guidance)
|
||||
|
||||
# For valid results that failed, check for diff application failures
|
||||
elif not result['succeeded']:
|
||||
# This is a valid result that failed - likely due to diff application issues
|
||||
raw_output = result.get('raw_model_output', '')
|
||||
|
||||
# Check if we have specific error information in the raw output
|
||||
if 'does not match anything in the file' in str(raw_output).lower():
|
||||
st.warning("⚠️ **Diff Application Failed**")
|
||||
st.info("💡 The SEARCH block in the diff didn't match any content in the original file. This usually means the model hallucinated code that doesn't exist.")
|
||||
elif 'malformatted' in str(raw_output).lower() or 'malformed' in str(raw_output).lower():
|
||||
st.warning("⚠️ **Diff Format Error**")
|
||||
st.info("💡 The diff format was incorrect. Check the raw tool call to see the formatting issues.")
|
||||
elif 'error:' in str(raw_output).lower():
|
||||
# Try to extract the specific error message
|
||||
lines = str(raw_output).split('\n')
|
||||
error_lines = [line for line in lines if 'error:' in line.lower()]
|
||||
if error_lines:
|
||||
error_msg = error_lines[0].strip()
|
||||
st.warning("⚠️ **Diff Application Failed**")
|
||||
st.info(f"💡 {error_msg}")
|
||||
else:
|
||||
st.warning("⚠️ **Diff Application Failed**")
|
||||
st.info("💡 The diff couldn't be applied to the original file. Check the raw output and parsed tool call for more details.")
|
||||
else:
|
||||
# Generic diff application failure
|
||||
st.warning("⚠️ **Diff Application Failed**")
|
||||
st.info("💡 The model made a valid tool call but the diff couldn't be applied to the original file. This usually indicates a mismatch between the expected and actual file content.")
|
||||
else:
|
||||
# Show successful edit information
|
||||
st.success("✅ **Edit Successful**")
|
||||
@@ -725,8 +806,25 @@ def render_file_and_edits_view(result):
|
||||
if len(edited_lines) > 50:
|
||||
st.text(f"... ({len(edited_lines) - 50} more lines)")
|
||||
|
||||
# Show parsed tool call if available
|
||||
# Show raw and parsed tool calls if available
|
||||
if not pd.isna(result['parsed_tool_call_json']):
|
||||
with st.expander("View Raw Tool Call"):
|
||||
# Extract the raw tool call text from the model output
|
||||
raw_output = result['raw_model_output'] if not pd.isna(result['raw_model_output']) else ""
|
||||
|
||||
# Try to extract just the tool call portion
|
||||
if raw_output and '<replace_in_file>' in raw_output:
|
||||
# Find the tool call block
|
||||
start_idx = raw_output.find('<replace_in_file>')
|
||||
end_idx = raw_output.find('</replace_in_file>') + len('</replace_in_file>')
|
||||
if start_idx != -1 and end_idx != -1:
|
||||
raw_tool_call = raw_output[start_idx:end_idx]
|
||||
st.code(raw_tool_call, language='xml')
|
||||
else:
|
||||
st.text("Tool call not found in raw output")
|
||||
else:
|
||||
st.text("No raw tool call available")
|
||||
|
||||
with st.expander("View Parsed Tool Call"):
|
||||
try:
|
||||
parsed_call = json.loads(result['parsed_tool_call_json'])
|
||||
@@ -795,8 +893,10 @@ def render_metrics_view(result):
|
||||
if not pd.isna(result['completion_tokens']):
|
||||
st.metric("Completion Tokens", int(result['completion_tokens']))
|
||||
|
||||
if not pd.isna(result['cost_usd']):
|
||||
if pd.notna(result['cost_usd']) and result['cost_usd'] is not None:
|
||||
st.metric("Cost", f"${result['cost_usd']:.4f}")
|
||||
else:
|
||||
st.metric("Cost", "Free")
|
||||
|
||||
if not pd.isna(result['tokens_in_context']):
|
||||
st.metric("Context Tokens", int(result['tokens_in_context']))
|
||||
|
||||
@@ -70,246 +70,7 @@ export interface ToolUse {
|
||||
partial: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* @description **Version 1**
|
||||
* Parses an assistant message string potentially containing mixed text and tool usage blocks
|
||||
* marked with XML-like tags into an array of structured content objects.
|
||||
*
|
||||
* This version iterates through the message character by character, building an accumulator string.
|
||||
* It maintains state to track whether it's currently parsing text, a tool use block, or a specific tool parameter.
|
||||
* It detects the start and end of tool uses and parameters by checking if the accumulator ends with
|
||||
* the corresponding opening or closing tags.
|
||||
* Special handling is included for `write_to_file` and `new_rule` tool uses to correctly parse
|
||||
* the `content` parameter, which might contain the closing tag itself, by looking for the *last*
|
||||
* occurrence of the closing tag.
|
||||
* If the input string ends mid-tag or mid-content, the last block (text or tool use) is marked as partial.
|
||||
*
|
||||
* @param assistantMessage The raw string output from the assistant.
|
||||
* @returns An array of `AssistantMessageContent` objects, which can be `TextContent` or `ToolUse`.
|
||||
* Blocks that were not fully closed by the end of the input string will have their `partial` flag set to `true`.
|
||||
*/
|
||||
export function parseAssistantMessageV1(assistantMessage: string): AssistantMessageContent[] {
|
||||
const contentBlocks: AssistantMessageContent[] = []
|
||||
let currentTextContent: TextContent | undefined = undefined
|
||||
let currentTextContentStartIndex = 0
|
||||
let currentToolUse: ToolUse | undefined = undefined
|
||||
let currentToolUseStartIndex = 0
|
||||
let currentParamName: ToolParamName | undefined = undefined
|
||||
let currentParamValueStartIndex = 0
|
||||
let accumulator = ""
|
||||
|
||||
for (let i = 0; i < assistantMessage.length; i++) {
|
||||
const char = assistantMessage[i]
|
||||
accumulator += char
|
||||
|
||||
// --- State: Parsing a Tool Parameter ---
|
||||
// there should not be a param without a tool use
|
||||
if (currentToolUse && currentParamName) {
|
||||
const currentParamValue = accumulator.slice(currentParamValueStartIndex)
|
||||
const paramClosingTag = `</${currentParamName}>`
|
||||
if (currentParamValue.endsWith(paramClosingTag)) {
|
||||
// End of param value found
|
||||
currentToolUse.params[currentParamName] = currentParamValue.slice(0, -paramClosingTag.length).trim()
|
||||
currentParamName = undefined // Go back to parsing tool content or looking for next param
|
||||
continue // Move to next character
|
||||
} else {
|
||||
// Partial param value is accumulating
|
||||
continue // Move to next character
|
||||
}
|
||||
}
|
||||
|
||||
// --- State: Parsing a Tool Use (but not a specific parameter) ---
|
||||
// no currentParamName
|
||||
if (currentToolUse) {
|
||||
const currentToolValue = accumulator.slice(currentToolUseStartIndex)
|
||||
const toolUseClosingTag = `</${currentToolUse.name}>`
|
||||
|
||||
if (currentToolValue.endsWith(toolUseClosingTag)) {
|
||||
// End of a tool use found
|
||||
currentToolUse.partial = false
|
||||
contentBlocks.push(currentToolUse)
|
||||
currentToolUse = undefined // Go back to parsing text or looking for next tool
|
||||
// Reset text start index in case text follows immediately
|
||||
currentTextContentStartIndex = i + 1
|
||||
continue // Move to next character
|
||||
} else {
|
||||
// Check if starting a new parameter within the current tool use
|
||||
const possibleParamOpeningTags = toolParamNames.map((name) => `<${name}>`)
|
||||
let foundParamStart = false
|
||||
for (const paramOpeningTag of possibleParamOpeningTags) {
|
||||
if (accumulator.endsWith(paramOpeningTag)) {
|
||||
// Start of a new parameter found
|
||||
currentParamName = paramOpeningTag.slice(1, -1) as ToolParamName
|
||||
currentParamValueStartIndex = accumulator.length
|
||||
foundParamStart = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (foundParamStart) {
|
||||
continue // Move to next character
|
||||
}
|
||||
|
||||
// Special case for write_to_file/new_rule content param allowing nested tags
|
||||
// Check if a </content> tag appears, potentially indicating the end of the content param
|
||||
// even if the main tool closing tag hasn't been seen yet.
|
||||
const contentParamName: ToolParamName = "content"
|
||||
if (
|
||||
(currentToolUse.name === "write_to_file" || currentToolUse.name === "new_rule") &&
|
||||
accumulator.endsWith(`</${contentParamName}>`)
|
||||
) {
|
||||
const toolContent = accumulator.slice(currentToolUseStartIndex)
|
||||
const contentStartTag = `<${contentParamName}>`
|
||||
const contentEndTag = `</${contentParamName}>`
|
||||
const contentStartIndex = toolContent.indexOf(contentStartTag) + contentStartTag.length
|
||||
// Use lastIndexOf to handle cases where </content> might appear within the content itself
|
||||
const contentEndIndex = toolContent.lastIndexOf(contentEndTag)
|
||||
|
||||
// Ensure we found valid start/end tags and end is after start
|
||||
if (
|
||||
contentStartIndex !== -1 &&
|
||||
contentEndIndex !== -1 &&
|
||||
contentEndIndex > contentStartIndex - contentStartTag.length // Ensure end tag is after start tag begins
|
||||
) {
|
||||
// Check if this content param was already being parsed. If so, update it.
|
||||
// If not, and we just found the closing tag, assign it.
|
||||
// This handles cases where the </content> detection might fire before
|
||||
// the <content> tag detection logic, or if the content is very short.
|
||||
if (currentParamName === contentParamName) {
|
||||
// Already parsing content, now we found the end tag
|
||||
currentToolUse.params[contentParamName] = toolContent.slice(contentStartIndex, contentEndIndex).trim()
|
||||
currentParamName = undefined // Finished with this param
|
||||
} else if (currentParamName === undefined) {
|
||||
// Not parsing a param, but found </content>. Assume it closes the content block.
|
||||
currentToolUse.params[contentParamName] = toolContent.slice(contentStartIndex, contentEndIndex).trim()
|
||||
// We stay in the "parsing tool use" state, looking for more params or the tool end tag.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If none of the above, partial tool value is accumulating
|
||||
continue // Move to next character
|
||||
}
|
||||
}
|
||||
|
||||
// --- State: Parsing Text (or looking for start of a tool use) ---
|
||||
// no currentToolUse
|
||||
let didStartToolUse = false
|
||||
const possibleToolUseOpeningTags = toolUseNames.map((name) => `<${name}>`)
|
||||
for (const toolUseOpeningTag of possibleToolUseOpeningTags) {
|
||||
if (accumulator.endsWith(toolUseOpeningTag)) {
|
||||
// Start of a new tool use found
|
||||
const toolName = toolUseOpeningTag.slice(1, -1) as ToolUseName
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: toolName,
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
currentToolUseStartIndex = accumulator.length
|
||||
|
||||
// This also indicates the end of the current text content block (if any)
|
||||
if (currentTextContent) {
|
||||
currentTextContent.partial = false
|
||||
// Extract text content, removing the part that formed the tool opening tag
|
||||
const textEndIndex = accumulator.length - toolUseOpeningTag.length
|
||||
currentTextContent.content = accumulator.slice(currentTextContentStartIndex, textEndIndex).trim()
|
||||
// Only add if there's actual content
|
||||
if (currentTextContent.content.length > 0) {
|
||||
contentBlocks.push(currentTextContent)
|
||||
}
|
||||
currentTextContent = undefined
|
||||
} else {
|
||||
// Check if there was text before this tool use started
|
||||
const textEndIndex = accumulator.length - toolUseOpeningTag.length
|
||||
const potentialText = accumulator.slice(currentTextContentStartIndex, textEndIndex).trim()
|
||||
if (potentialText.length > 0) {
|
||||
contentBlocks.push({
|
||||
type: "text",
|
||||
content: potentialText,
|
||||
partial: false, // Ended because tool use started
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
didStartToolUse = true
|
||||
break // Found tool start, stop checking for others
|
||||
}
|
||||
}
|
||||
|
||||
if (!didStartToolUse) {
|
||||
// No tool use started, so it must be text content accumulating
|
||||
// (or continuing after a closed tool use)
|
||||
if (currentTextContent === undefined) {
|
||||
// Start of a new text block
|
||||
currentTextContentStartIndex = i - (accumulator.length - currentTextContentStartIndex - 1) // Adjust start index based on how much we've accumulated since the last block ended or the beginning
|
||||
// If accumulator starts from 0, start index is i
|
||||
if (contentBlocks.length === 0 && currentToolUse === undefined) {
|
||||
currentTextContentStartIndex = accumulator.length - 1 // i
|
||||
} else {
|
||||
// Re-calculate based on the actual start of the current text segment
|
||||
// Find the end of the last block
|
||||
let lastBlockEndIndex = 0
|
||||
if (contentBlocks.length > 0) {
|
||||
const lastBlock = contentBlocks[contentBlocks.length - 1]
|
||||
// Approximation: find where the accumulator matches the end of the message string representation of the last block. This is complex.
|
||||
// Simpler: Assume text starts right after the last block ended implicitly at index i.
|
||||
lastBlockEndIndex = i // Where the loop *was* when the last block finished processing
|
||||
// Need a more robust way to track the end index of the *raw string* corresponding to the last block.
|
||||
// Let's stick to the accumulator slice approach for simplicity in this version.
|
||||
// The start index should be where the current *unmatched* text began.
|
||||
let lastProcessedIndex = -1
|
||||
if (contentBlocks.length > 0) {
|
||||
// This requires knowing the raw string length of the previous block, which V1 doesn't explicitly track easily.
|
||||
// We'll approximate based on the current accumulator and start index logic.
|
||||
// The issue arises if a tool tag was just closed. accumulator contains everything up to i.
|
||||
// lastBlockEndIndex should point to the character *after* the closing tag of the last block.
|
||||
}
|
||||
// Reset start index to the beginning of the *current* potential text block
|
||||
currentTextContentStartIndex = accumulator.length - 1 // Start accumulating from the current character `i`
|
||||
}
|
||||
|
||||
// If we just closed a tool, text starts *after* its closing tag
|
||||
// The logic needs refinement here for accurate start index after a tool closure.
|
||||
// Let's assume for now the start index logic inside the loop handles it via slicing.
|
||||
}
|
||||
|
||||
currentTextContent = {
|
||||
type: "text",
|
||||
content: "", // Content will be filled by slicing accumulator
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
// Update text content based on the accumulator from its start index
|
||||
currentTextContent.content = accumulator.slice(currentTextContentStartIndex).trimStart() // Trim start to avoid leading space if text follows tool
|
||||
}
|
||||
} // End of loop
|
||||
|
||||
// --- Finalization after loop ---
|
||||
|
||||
// If a tool use was open at the end
|
||||
if (currentToolUse) {
|
||||
// If a parameter was open within that tool use
|
||||
if (currentParamName) {
|
||||
// The remaining accumulator content belongs to this partial parameter
|
||||
currentToolUse.params[currentParamName] = accumulator.slice(currentParamValueStartIndex).trim()
|
||||
}
|
||||
// Add the potentially partial tool use block
|
||||
contentBlocks.push(currentToolUse)
|
||||
}
|
||||
// If text content was being accumulated at the end
|
||||
// Note: Only one of currentToolUse or currentTextContent can be defined here,
|
||||
// as starting a tool use finalizes the preceding text block.
|
||||
else if (currentTextContent) {
|
||||
// Update content one last time
|
||||
currentTextContent.content = accumulator.slice(currentTextContentStartIndex).trim()
|
||||
// Add the potentially partial text block only if it contains content
|
||||
if (currentTextContent.content.length > 0) {
|
||||
contentBlocks.push(currentTextContent)
|
||||
}
|
||||
}
|
||||
|
||||
return contentBlocks
|
||||
}
|
||||
// parseAssistantmessageV1 removed in https://github.com/cline/cline/pull/5425
|
||||
|
||||
/**
|
||||
* @description **Version 2**
|
||||
@@ -543,621 +304,3 @@ export function parseAssistantMessageV2(assistantMessage: string): AssistantMess
|
||||
|
||||
return contentBlocks
|
||||
}
|
||||
|
||||
export function parseAssistantMessageV3(assistantMessage: string): AssistantMessageContent[] {
|
||||
const contentBlocks: AssistantMessageContent[] = []
|
||||
let currentTextContentStart = 0 // Index where the current text block started
|
||||
let currentTextContent: TextContent | undefined = undefined
|
||||
let currentToolUseStart = 0 // Index *after* the opening tag of the current tool use
|
||||
let currentToolUse: ToolUse | undefined = undefined
|
||||
let currentParamValueStart = 0 // Index *after* the opening tag of the current param
|
||||
let currentParamName: ToolParamName | undefined = undefined
|
||||
|
||||
// Precompute tags for faster lookups
|
||||
const toolUseOpenTags = new Map<string, ToolUseName>()
|
||||
const toolParamOpenTags = new Map<string, ToolParamName>()
|
||||
for (const name of toolUseNames) {
|
||||
toolUseOpenTags.set(`<${name}>`, name)
|
||||
}
|
||||
for (const name of toolParamNames) {
|
||||
toolParamOpenTags.set(`<${name}>`, name)
|
||||
}
|
||||
|
||||
// Function calls format detection
|
||||
const isFunctionCallsOpen = "<function_calls>"
|
||||
const isFunctionCallsClose = "</function_calls>"
|
||||
const isInvokeStart = '<invoke name="'
|
||||
const isInvokeEnd = '">'
|
||||
const isInvokeClose = "</invoke>"
|
||||
const isParameterStart = '<parameter name="'
|
||||
const isParameterNameEnd = '">'
|
||||
const isParameterClose = "</parameter>"
|
||||
|
||||
// Variables for function calls parsing
|
||||
let inFunctionCalls = false
|
||||
let currentInvokeName = ""
|
||||
let currentParameterName = ""
|
||||
|
||||
const len = assistantMessage.length
|
||||
for (let i = 0; i < len; i++) {
|
||||
const currentCharIndex = i
|
||||
|
||||
// --- State: Parsing Function Calls ---
|
||||
// Check for opening function_calls tag
|
||||
if (
|
||||
!inFunctionCalls &&
|
||||
currentCharIndex >= isFunctionCallsOpen.length - 1 &&
|
||||
assistantMessage.startsWith(isFunctionCallsOpen, currentCharIndex - isFunctionCallsOpen.length + 1)
|
||||
) {
|
||||
// End current text block if one was active
|
||||
if (currentTextContent) {
|
||||
currentTextContent.content = assistantMessage
|
||||
.slice(currentTextContentStart, currentCharIndex - isFunctionCallsOpen.length + 1)
|
||||
.trim()
|
||||
currentTextContent.partial = false
|
||||
if (currentTextContent.content.length > 0) {
|
||||
contentBlocks.push(currentTextContent)
|
||||
}
|
||||
currentTextContent = undefined
|
||||
}
|
||||
|
||||
inFunctionCalls = true
|
||||
continue
|
||||
}
|
||||
|
||||
// Check for invoke start within function_calls
|
||||
if (
|
||||
inFunctionCalls &&
|
||||
currentInvokeName === "" &&
|
||||
!currentToolUse && // Don't create a new tool if we already have one
|
||||
currentCharIndex >= isInvokeStart.length - 1 &&
|
||||
assistantMessage.startsWith(isInvokeStart, currentCharIndex - isInvokeStart.length + 1)
|
||||
) {
|
||||
// Find the end of the invoke name
|
||||
const nameEndPos = assistantMessage.indexOf(isInvokeEnd, currentCharIndex + 1)
|
||||
if (nameEndPos !== -1) {
|
||||
// Extract the invoke name
|
||||
currentInvokeName = assistantMessage.slice(currentCharIndex + 1, nameEndPos)
|
||||
i = nameEndPos + isInvokeEnd.length - 1 // Skip to after the '">
|
||||
|
||||
// If this is an LS invoke, create a list_files tool
|
||||
if (currentInvokeName === "LS") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "list_files",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
// If this is a Grep invoke, create a search_files tool
|
||||
if (currentInvokeName === "Grep") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "search_files",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "Bash") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "execute_command",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "Read") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "read_file",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "Write") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "write_to_file",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "WebFetch") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "web_fetch",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "AskQuestion") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "ask_followup_question",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "UseMCPTool") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "use_mcp_tool",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "AccessMCPResource") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "access_mcp_resource",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "ListCodeDefinitionNames") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "list_code_definition_names",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "PlanModeRespond") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "plan_mode_respond",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "LoadMcpDocumentation") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "load_mcp_documentation",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "AttemptCompletion") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "attempt_completion",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "BrowserAction") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "browser_action",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
if (currentInvokeName === "NewTask") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "new_task",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
// If this is a MultiEdit invoke, create a replace_in_file tool
|
||||
if (currentInvokeName === "MultiEdit") {
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: "replace_in_file",
|
||||
params: {},
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
// Check for parameter start within invoke
|
||||
if (
|
||||
inFunctionCalls &&
|
||||
currentInvokeName !== "" &&
|
||||
currentParameterName === "" &&
|
||||
currentCharIndex >= isParameterStart.length - 1 &&
|
||||
assistantMessage.startsWith(isParameterStart, currentCharIndex - isParameterStart.length + 1)
|
||||
) {
|
||||
// Find the end of the parameter name
|
||||
const nameEndPos = assistantMessage.indexOf(isParameterNameEnd, currentCharIndex + 1)
|
||||
if (nameEndPos !== -1) {
|
||||
// Extract the parameter name
|
||||
currentParameterName = assistantMessage.slice(currentCharIndex + 1, nameEndPos)
|
||||
currentParamValueStart = nameEndPos + isParameterNameEnd.length
|
||||
i = nameEndPos + isParameterNameEnd.length - 1 // Skip to after the '">'
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
// Check for parameter end
|
||||
if (
|
||||
inFunctionCalls &&
|
||||
currentInvokeName !== "" &&
|
||||
currentParameterName !== "" &&
|
||||
currentCharIndex >= isParameterClose.length - 1 &&
|
||||
assistantMessage.startsWith(isParameterClose, currentCharIndex - isParameterClose.length + 1)
|
||||
) {
|
||||
// Extract parameter value
|
||||
const value = assistantMessage.slice(currentParamValueStart, currentCharIndex - isParameterClose.length + 1).trim()
|
||||
|
||||
// Map parameter to tool params
|
||||
if (currentToolUse && currentInvokeName === "LS" && currentParameterName === "path") {
|
||||
currentToolUse.params["path"] = value
|
||||
// Default recursive to false - only show top level
|
||||
currentToolUse.params["recursive"] = "false"
|
||||
}
|
||||
|
||||
if (currentToolUse && currentInvokeName === "Read" && currentParameterName === "file_path") {
|
||||
currentToolUse.params["path"] = value
|
||||
}
|
||||
|
||||
if (currentToolUse && currentInvokeName === "PlanModeRespond" && currentParameterName === "response") {
|
||||
currentToolUse.params["response"] = value
|
||||
}
|
||||
|
||||
if (currentToolUse && currentInvokeName === "WebFetch" && currentParameterName === "url") {
|
||||
currentToolUse.params["url"] = value
|
||||
}
|
||||
|
||||
if (currentToolUse && currentInvokeName === "ListCodeDefinitionNames" && currentParameterName === "path") {
|
||||
currentToolUse.params["path"] = value
|
||||
}
|
||||
|
||||
if (currentToolUse && currentInvokeName === "NewTask" && currentParameterName === "context") {
|
||||
currentToolUse.params["context"] = value
|
||||
}
|
||||
|
||||
// Map parameter to tool params for Grep
|
||||
if (currentToolUse && currentInvokeName === "Grep") {
|
||||
if (currentParameterName === "pattern") {
|
||||
currentToolUse.params["regex"] = value
|
||||
} else if (currentParameterName === "path") {
|
||||
currentToolUse.params["path"] = value
|
||||
} else if (currentParameterName === "include") {
|
||||
currentToolUse.params["file_pattern"] = value
|
||||
}
|
||||
}
|
||||
|
||||
if (currentToolUse && currentInvokeName === "Bash") {
|
||||
if (currentParameterName === "command") {
|
||||
currentToolUse.params["command"] = value
|
||||
} else if (currentParameterName === "requires_approval") {
|
||||
currentToolUse.params["requires_approval"] = value === "true" ? "true" : "false"
|
||||
}
|
||||
}
|
||||
|
||||
if (currentToolUse && currentInvokeName === "Write") {
|
||||
if (currentParameterName === "file_path") {
|
||||
currentToolUse.params["path"] = value
|
||||
} else if (currentParameterName === "content") {
|
||||
currentToolUse.params["content"] = value
|
||||
}
|
||||
}
|
||||
|
||||
if (currentToolUse && currentInvokeName === "AskQuestion") {
|
||||
if (currentParameterName === "question") {
|
||||
currentToolUse.params["question"] = value
|
||||
} else if (currentParameterName === "options") {
|
||||
currentToolUse.params["options"] = value
|
||||
}
|
||||
}
|
||||
|
||||
if (currentToolUse && currentInvokeName === "UseMCPTool") {
|
||||
if (currentParameterName === "server_name") {
|
||||
currentToolUse.params["server_name"] = value
|
||||
} else if (currentParameterName === "tool_name") {
|
||||
currentToolUse.params["tool_name"] = value
|
||||
} else if (currentParameterName === "arguments") {
|
||||
currentToolUse.params["arguments"] = value
|
||||
}
|
||||
}
|
||||
|
||||
if (currentToolUse && currentInvokeName === "AccessMCPResource") {
|
||||
if (currentParameterName === "server_name") {
|
||||
currentToolUse.params["server_name"] = value
|
||||
} else if (currentParameterName === "uri") {
|
||||
currentToolUse.params["uri"] = value
|
||||
}
|
||||
}
|
||||
|
||||
if (currentToolUse && currentInvokeName === "AttemptCompletion") {
|
||||
if (currentParameterName === "result") {
|
||||
currentToolUse.params["result"] = value
|
||||
}
|
||||
if (currentParameterName === "command") {
|
||||
currentToolUse.params["command"] = value
|
||||
}
|
||||
}
|
||||
|
||||
if (currentToolUse && currentInvokeName === "BrowserAction") {
|
||||
if (currentParameterName === "action") {
|
||||
currentToolUse.params["action"] = value
|
||||
} else if (currentParameterName === "url") {
|
||||
currentToolUse.params["url"] = value
|
||||
} else if (currentParameterName === "coordinate") {
|
||||
currentToolUse.params["coordinate"] = value
|
||||
} else if (currentParameterName === "text") {
|
||||
currentToolUse.params["text"] = value
|
||||
}
|
||||
}
|
||||
|
||||
// Map parameter to tool params for MultiEdit
|
||||
if (currentToolUse && currentInvokeName === "MultiEdit") {
|
||||
if (currentParameterName === "file_path") {
|
||||
currentToolUse.params["path"] = value
|
||||
} else if (currentParameterName === "edits") {
|
||||
// Save the value to the diff parameter for replace_in_file
|
||||
currentToolUse.params["diff"] = value
|
||||
}
|
||||
}
|
||||
|
||||
currentParameterName = ""
|
||||
continue
|
||||
}
|
||||
|
||||
// Check for invoke end
|
||||
if (
|
||||
inFunctionCalls &&
|
||||
currentInvokeName !== "" &&
|
||||
currentCharIndex >= isInvokeClose.length - 1 &&
|
||||
assistantMessage.startsWith(isInvokeClose, currentCharIndex - isInvokeClose.length + 1)
|
||||
) {
|
||||
// If we have a tool use from this invoke, finalize it
|
||||
if (
|
||||
currentToolUse &&
|
||||
(currentInvokeName === "LS" ||
|
||||
currentInvokeName === "Grep" ||
|
||||
currentInvokeName === "Bash" ||
|
||||
currentInvokeName === "Read" ||
|
||||
currentInvokeName === "Write" ||
|
||||
currentInvokeName === "WebFetch" ||
|
||||
currentInvokeName === "AskQuestion" ||
|
||||
currentInvokeName === "UseMCPTool" ||
|
||||
currentInvokeName === "AccessMCPResource" ||
|
||||
currentInvokeName === "ListCodeDefinitionNames" ||
|
||||
currentInvokeName === "PlanModeRespond" ||
|
||||
currentInvokeName === "LoadMcpDocumentation" ||
|
||||
currentInvokeName === "AttemptCompletion" ||
|
||||
currentInvokeName === "BrowserAction" ||
|
||||
currentInvokeName === "NewTask" ||
|
||||
currentInvokeName === "MultiEdit")
|
||||
) {
|
||||
currentToolUse.partial = false
|
||||
contentBlocks.push(currentToolUse)
|
||||
currentToolUse = undefined
|
||||
}
|
||||
currentInvokeName = ""
|
||||
continue
|
||||
}
|
||||
|
||||
// Check for function_calls end
|
||||
if (
|
||||
inFunctionCalls &&
|
||||
currentCharIndex >= isFunctionCallsClose.length - 1 &&
|
||||
assistantMessage.startsWith(isFunctionCallsClose, currentCharIndex - isFunctionCallsClose.length + 1)
|
||||
) {
|
||||
inFunctionCalls = false
|
||||
currentTextContentStart = currentCharIndex + 1
|
||||
// Start a new text content block for any text after function_calls
|
||||
currentTextContent = {
|
||||
type: "text",
|
||||
content: "",
|
||||
partial: true,
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
// Skip normal parsing when inside function_calls
|
||||
if (inFunctionCalls) {
|
||||
continue
|
||||
}
|
||||
|
||||
// --- State: Parsing a Tool Parameter ---
|
||||
if (currentToolUse && currentParamName) {
|
||||
const closeTag = `</${currentParamName}>`
|
||||
// Check if the string *ending* at index `i` matches the closing tag
|
||||
if (
|
||||
currentCharIndex >= closeTag.length - 1 &&
|
||||
assistantMessage.startsWith(
|
||||
closeTag,
|
||||
currentCharIndex - closeTag.length + 1, // Start checking from potential start of tag
|
||||
)
|
||||
) {
|
||||
// Found the closing tag for the parameter
|
||||
const value = assistantMessage
|
||||
.slice(
|
||||
currentParamValueStart, // Start after the opening tag
|
||||
currentCharIndex - closeTag.length + 1, // End before the closing tag
|
||||
)
|
||||
.trim()
|
||||
currentToolUse.params[currentParamName] = value
|
||||
currentParamName = undefined // Go back to parsing tool content
|
||||
// We don't continue loop here, need to check for tool close or other params at index i
|
||||
} else {
|
||||
continue // Still inside param value, move to next char
|
||||
}
|
||||
}
|
||||
|
||||
// --- State: Parsing a Tool Use (but not a specific parameter) ---
|
||||
if (currentToolUse && !currentParamName) {
|
||||
// Ensure we are not inside a parameter already
|
||||
// Check if starting a new parameter
|
||||
let startedNewParam = false
|
||||
for (const [tag, paramName] of toolParamOpenTags.entries()) {
|
||||
if (currentCharIndex >= tag.length - 1 && assistantMessage.startsWith(tag, currentCharIndex - tag.length + 1)) {
|
||||
currentParamName = paramName
|
||||
currentParamValueStart = currentCharIndex + 1 // Value starts after the tag
|
||||
startedNewParam = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if (startedNewParam) {
|
||||
continue // Handled start of param, move to next char
|
||||
}
|
||||
|
||||
// Check if closing the current tool use
|
||||
const toolCloseTag = `</${currentToolUse.name}>`
|
||||
if (
|
||||
currentCharIndex >= toolCloseTag.length - 1 &&
|
||||
assistantMessage.startsWith(toolCloseTag, currentCharIndex - toolCloseTag.length + 1)
|
||||
) {
|
||||
// End of the tool use found
|
||||
// Special handling for content params *before* finalizing the tool
|
||||
const toolContentSlice = assistantMessage.slice(
|
||||
currentToolUseStart, // From after the tool opening tag
|
||||
currentCharIndex - toolCloseTag.length + 1, // To before the tool closing tag
|
||||
)
|
||||
|
||||
// Check if content parameter needs special handling (write_to_file/new_rule)
|
||||
// This check is important if the closing </content> tag was missed by the parameter parsing logic
|
||||
// (e.g., if content is empty or parsing logic prioritizes tool close)
|
||||
const contentParamName: ToolParamName = "content"
|
||||
if (
|
||||
currentToolUse.name === "write_to_file" /* || currentToolUse.name === "new_rule" */ &&
|
||||
toolContentSlice.includes(`<${contentParamName}>`)
|
||||
) {
|
||||
const contentStartTag = `<${contentParamName}>`
|
||||
const contentEndTag = `</${contentParamName}>`
|
||||
const contentStart = toolContentSlice.indexOf(contentStartTag)
|
||||
// Use lastIndexOf for robustness against nested tags
|
||||
const contentEnd = toolContentSlice.lastIndexOf(contentEndTag)
|
||||
|
||||
if (contentStart !== -1 && contentEnd !== -1 && contentEnd > contentStart) {
|
||||
const contentValue = toolContentSlice.slice(contentStart + contentStartTag.length, contentEnd).trim()
|
||||
currentToolUse.params[contentParamName] = contentValue
|
||||
}
|
||||
}
|
||||
|
||||
currentToolUse.partial = false // Mark as complete
|
||||
contentBlocks.push(currentToolUse)
|
||||
currentToolUse = undefined // Reset state
|
||||
currentTextContentStart = currentCharIndex + 1 // Potential text starts after this tag
|
||||
continue // Move to next char
|
||||
}
|
||||
// If not starting a param and not closing the tool, continue accumulating tool content implicitly
|
||||
continue
|
||||
}
|
||||
|
||||
// --- State: Parsing Text / Looking for Tool Start ---
|
||||
if (!currentToolUse) {
|
||||
// Check if starting a new tool use
|
||||
let startedNewTool = false
|
||||
for (const [tag, toolName] of toolUseOpenTags.entries()) {
|
||||
if (currentCharIndex >= tag.length - 1 && assistantMessage.startsWith(tag, currentCharIndex - tag.length + 1)) {
|
||||
// End current text block if one was active
|
||||
if (currentTextContent) {
|
||||
currentTextContent.content = assistantMessage
|
||||
.slice(
|
||||
currentTextContentStart, // From where text started
|
||||
currentCharIndex - tag.length + 1, // To before the tool tag starts
|
||||
)
|
||||
.trim()
|
||||
currentTextContent.partial = false // Ended because tool started
|
||||
if (currentTextContent.content.length > 0) {
|
||||
contentBlocks.push(currentTextContent)
|
||||
}
|
||||
currentTextContent = undefined
|
||||
} else {
|
||||
// Check for any text between the last block and this tag
|
||||
const potentialText = assistantMessage
|
||||
.slice(
|
||||
currentTextContentStart, // From where text *might* have started
|
||||
currentCharIndex - tag.length + 1, // To before the tool tag starts
|
||||
)
|
||||
.trim()
|
||||
if (potentialText.length > 0) {
|
||||
contentBlocks.push({
|
||||
type: "text",
|
||||
content: potentialText,
|
||||
partial: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Start the new tool use
|
||||
currentToolUse = {
|
||||
type: "tool_use",
|
||||
name: toolName,
|
||||
params: {},
|
||||
partial: true, // Assume partial until closing tag is found
|
||||
}
|
||||
currentToolUseStart = currentCharIndex + 1 // Tool content starts after the opening tag
|
||||
startedNewTool = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (startedNewTool) {
|
||||
continue // Handled start of tool, move to next char
|
||||
}
|
||||
|
||||
// If not starting a tool, it must be text content
|
||||
if (!currentTextContent) {
|
||||
// Start a new text block if we aren't already in one
|
||||
currentTextContentStart = currentCharIndex // Text starts at the current character
|
||||
// Check if the current char is the start of potential text *immediately* after a tag
|
||||
// This needs the previous state - simpler to let slicing handle it later.
|
||||
// Resetting start index accurately is key.
|
||||
// It should be the index *after* the last processed tag.
|
||||
// The logic managing currentTextContentStart after closing tags handles this.
|
||||
|
||||
currentTextContent = {
|
||||
type: "text",
|
||||
content: "", // Will be determined by slicing at the end or when a tool starts
|
||||
partial: true,
|
||||
}
|
||||
}
|
||||
// Continue accumulating text implicitly; content is extracted later.
|
||||
}
|
||||
} // End of loop
|
||||
|
||||
// --- Finalization after loop ---
|
||||
|
||||
// Finalize any open parameter within an open tool use
|
||||
if (currentToolUse && currentParamName) {
|
||||
currentToolUse.params[currentParamName] = assistantMessage
|
||||
.slice(currentParamValueStart) // From param start to end of string
|
||||
.trim()
|
||||
// Tool use remains partial
|
||||
}
|
||||
|
||||
// Finalize any open tool use (which might contain the finalized partial param)
|
||||
if (currentToolUse) {
|
||||
// Tool use is partial because the loop finished before its closing tag
|
||||
contentBlocks.push(currentToolUse)
|
||||
}
|
||||
// Finalize any trailing text content
|
||||
// Only possible if a tool use wasn't open at the very end
|
||||
else if (currentTextContent) {
|
||||
currentTextContent.content = assistantMessage
|
||||
.slice(currentTextContentStart) // From text start to end of string
|
||||
.trim()
|
||||
// Text is partial because the loop finished
|
||||
if (currentTextContent.content.length > 0) {
|
||||
contentBlocks.push(currentTextContent)
|
||||
}
|
||||
}
|
||||
|
||||
return contentBlocks
|
||||
}
|
||||
|
||||
@@ -104,5 +104,6 @@ export interface TestInput {
|
||||
thinkingBudgetTokens: number
|
||||
originalDiffEditToolCallMessage?: string
|
||||
diffApplyFile?: string
|
||||
provider?: string
|
||||
isVerbose: boolean
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"entry": [
|
||||
"src/extension.ts",
|
||||
"src/standalone/cline-core.ts",
|
||||
"src/generated/hosts/standalone/protobus-server-setup.ts",
|
||||
"src/generated/hosts/standalone/host-bridge-clients.ts",
|
||||
"src/generated/hosts/vscode/protobus-services.ts",
|
||||
"src/generated/hosts/vscode/hostbridge-grpc-service-config.ts"
|
||||
],
|
||||
"project": [
|
||||
"src/**/*.ts"
|
||||
],
|
||||
"ignore": [
|
||||
"out/**",
|
||||
"node_modules/**",
|
||||
"*.d.ts",
|
||||
"**/*.test.ts",
|
||||
"**/__tests__",
|
||||
"src/test/**",
|
||||
"src/shared/**"
|
||||
],
|
||||
"vite": true
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
See [https://cline.bot/privacy](https://cline.bot/privacy) for our privacy policy.
|
||||
@@ -1,39 +0,0 @@
|
||||
# Cline Documentation
|
||||
|
||||
Welcome to the Cline documentation - your comprehensive guide to using and extending Cline's capabilities. Here you'll find resources to help you get started, improve your skills, and contribute to the project.
|
||||
|
||||
## Getting Started
|
||||
|
||||
- **New to coding?** We've prepared a gentle introduction:
|
||||
- [Getting Started for New Coders](getting-started-new-coders/README.md)
|
||||
|
||||
## Improving Your Prompting Skills
|
||||
|
||||
- **Want to communicate more effectively with Cline?** Explore:
|
||||
- [Prompt Engineering Guide](prompting/README.md)
|
||||
- [Cline Memory Bank](prompting/custom%20instructions%20library/cline-memory-bank.md)
|
||||
|
||||
## Exploring Cline's Tools
|
||||
|
||||
- **Understand Cline's capabilities:**
|
||||
|
||||
- [Cline Tools Guide](tools/cline-tools-guide.md)
|
||||
- [Mentions Feature Guide](tools/mentions-guide.md)
|
||||
|
||||
- **Extend Cline with MCP Servers:**
|
||||
- [MCP Overview](mcp/README.md)
|
||||
- [Building MCP Servers from GitHub](mcp/mcp-server-from-github.md)
|
||||
- [Building Custom MCP Servers](mcp/mcp-server-from-scratch.md)
|
||||
|
||||
## Contributing to Cline
|
||||
|
||||
- **Interested in contributing?** We welcome your input:
|
||||
- Feel free to submit a pull request
|
||||
- [Contribution Guidelines](../CONTRIBUTING.md)
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- **Cline GitHub Repository:** [https://github.com/cline/cline](https://github.com/cline/cline)
|
||||
- **MCP Documentation:** [https://modelcontextprotocol.org/docs](https://modelcontextprotocol.org/docs)
|
||||
|
||||
We're always looking to improve this documentation. If you have suggestions or find areas that could be enhanced, please let us know. Your feedback helps make Cline better for everyone.
|
||||
@@ -1,43 +0,0 @@
|
||||
# Cline Extension Architecture
|
||||
|
||||
This directory contains architectural documentation for the Cline VSCode extension.
|
||||
|
||||
## Extension Architecture Diagram
|
||||
|
||||
The [extension-architecture.mmd](./extension-architecture.mmd) file contains a Mermaid diagram showing the high-level architecture of the Cline extension. The diagram illustrates:
|
||||
|
||||
1. **Core Extension**
|
||||
- Extension entry point and main classes
|
||||
- State management through VSCode's global state and secrets storage
|
||||
- Core business logic in the Cline class
|
||||
|
||||
2. **Webview UI**
|
||||
- React-based user interface
|
||||
- State management through ExtensionStateContext
|
||||
- Component hierarchy
|
||||
|
||||
3. **Storage**
|
||||
- Task-specific storage for history and state
|
||||
- Git-based checkpoint system for file changes
|
||||
|
||||
4. **Data Flow**
|
||||
- Core extension data flow between components
|
||||
- Webview UI data flow
|
||||
- Bidirectional communication between core and webview
|
||||
|
||||
## Viewing the Diagram
|
||||
|
||||
To view the diagram:
|
||||
1. Install a Mermaid diagram viewer extension in VSCode
|
||||
2. Open extension-architecture.mmd
|
||||
3. Use the extension's preview feature to render the diagram
|
||||
|
||||
You can also view the diagram on GitHub, which has built-in Mermaid rendering support.
|
||||
|
||||
## Color Scheme
|
||||
|
||||
The diagram uses a high-contrast color scheme for better visibility:
|
||||
- Pink (#ff0066): Global state and secrets storage components
|
||||
- Blue (#0066ff): Extension state context
|
||||
- Green (#00cc66): Cline provider
|
||||
- All components use white text for maximum readability
|
||||
@@ -1,67 +0,0 @@
|
||||
flowchart TB
|
||||
subgraph "VSCode Extension Host"
|
||||
subgraph "Core Extension"
|
||||
ExtensionEntry["Extension Entry<br/>src/extension.ts"]
|
||||
WebviewProvider["WebviewProvider<br/>src/core/webview/index.ts"]
|
||||
Controller["Controller<br/>src/core/controller/index.ts"]
|
||||
Task["Task<br/>src/core/task/index.ts"]
|
||||
GlobalState["VSCode Global State"]
|
||||
SecretsStorage["VSCode Secrets Storage"]
|
||||
McpHub["McpHub<br/>src/services/mcp/McpHub.ts"]
|
||||
end
|
||||
|
||||
subgraph "Webview UI"
|
||||
WebviewApp["React App<br/>webview-ui/src/App.tsx"]
|
||||
ExtStateContext["ExtensionStateContext<br/>webview-ui/src/context/ExtensionStateContext.tsx"]
|
||||
ReactComponents["React Components"]
|
||||
end
|
||||
|
||||
subgraph "Storage"
|
||||
TaskStorage["Task Storage<br/>Per-Task Files & History"]
|
||||
CheckpointSystem["Git-based Checkpoints"]
|
||||
end
|
||||
|
||||
subgraph "API Providers"
|
||||
AnthropicAPI["Anthropic"]
|
||||
OpenRouterAPI["OpenRouter"]
|
||||
BedrockAPI["AWS Bedrock"]
|
||||
OtherAPIs["Other Providers"]
|
||||
end
|
||||
|
||||
subgraph "MCP Servers"
|
||||
ExternalMcpServers["External MCP Servers"]
|
||||
end
|
||||
end
|
||||
|
||||
%% Core Extension Data Flow
|
||||
ExtensionEntry --> WebviewProvider
|
||||
WebviewProvider --> Controller
|
||||
Controller --> Task
|
||||
Controller --> McpHub
|
||||
Task --> GlobalState
|
||||
Task --> SecretsStorage
|
||||
Task --> TaskStorage
|
||||
Task --> CheckpointSystem
|
||||
Task --> |"API Requests"| AnthropicAPI
|
||||
Task --> |"API Requests"| OpenRouterAPI
|
||||
Task --> |"API Requests"| BedrockAPI
|
||||
Task --> |"API Requests"| OtherAPIs
|
||||
McpHub --> |"Connects to"| ExternalMcpServers
|
||||
Task --> |"Uses"| McpHub
|
||||
|
||||
%% Webview Data Flow
|
||||
WebviewApp --> ExtStateContext
|
||||
ExtStateContext --> ReactComponents
|
||||
|
||||
%% Bidirectional Communication
|
||||
WebviewProvider <--> |"postMessage"| ExtStateContext
|
||||
|
||||
classDef vscodeState fill:#f9f,stroke:#333,stroke-width:2px
|
||||
classDef contextClass fill:#bbf,stroke:#333,stroke-width:2px
|
||||
classDef providerClass fill:#bfb,stroke:#333,stroke-width:2px
|
||||
classDef apiClass fill:#fdb,stroke:#333,stroke-width:2px
|
||||
|
||||
class GlobalState,SecretsStorage vscodeState
|
||||
class ExtStateContext contextClass
|
||||
class WebviewProvider,McpHub providerClass
|
||||
class AnthropicAPI,OpenRouterAPI,BedrockAPI,OtherAPIs apiClass
|
||||
@@ -1,54 +0,0 @@
|
||||
### .clineignore Support
|
||||
|
||||
To give you more control over which files are accessible to Cline, we've implemented `.clineignore` functionality, similar to `.gitignore`. This allows you to specify files and directories that Cline should **not** access or process. This is useful for:
|
||||
|
||||
* **Privacy:** Preventing Cline from accessing sensitive or private files in your workspace.
|
||||
* **Performance:** Excluding large directories or files that are irrelevant to your tasks, potentially improving the efficiency of Cline.
|
||||
* **Context Management:** Focusing Cline's attention on the relevant parts of your project.
|
||||
|
||||
**How to use `.clineignore`**
|
||||
|
||||
1. **Create a `.clineignore` file:** In the root directory of your workspace (the same level as your `.vscode` folder, or the top level folder you opened in VS Code), create a new file named `.clineignore`.
|
||||
|
||||
2. **Define ignore patterns:** Open the `.clineignore` file and specify the patterns for files and directories you want Cline to ignore. The syntax is the same as `.gitignore`:
|
||||
|
||||
* Each line in the file represents a pattern.
|
||||
* **Standard glob patterns are supported:**
|
||||
* `*` matches zero or more characters
|
||||
* `?` matches one character
|
||||
* `[]` matches a character range
|
||||
* `**` matches any number of directories and subdirectories.
|
||||
|
||||
* **Directory patterns:** Append `/` to the end of a pattern to specify a directory.
|
||||
* **Negation patterns:** Start a pattern with `!` to negate (un-ignore) a previously ignored pattern.
|
||||
* **Comments:** Start a line with `#` to add comments.
|
||||
|
||||
**Example `.clineignore` file:**
|
||||
|
||||
```
|
||||
# Ignore log files
|
||||
*.log
|
||||
|
||||
# Ignore the entire 'node_modules' directory
|
||||
node_modules/
|
||||
|
||||
# Ignore all files in the 'temp' directory and its subdirectories
|
||||
temp/**
|
||||
|
||||
# But DO NOT ignore 'important.log' even if it's in the root
|
||||
!important.log
|
||||
|
||||
# Ignore any file named 'secret.txt' in any subdirectory
|
||||
**/secret.txt
|
||||
```
|
||||
|
||||
3. **Cline respects your `.clineignore`:** Once you save the `.clineignore` file, Cline will automatically recognize and apply these rules.
|
||||
|
||||
* **File Access Control:** Cline will not be able to read the content of ignored files using tools like `read_file`. If you attempt to use a tool on an ignored file, Cline will inform you that access is blocked due to `.clineignore` settings.
|
||||
* **File Listing:** When you ask Cline to list files in a directory (e.g., using `list_files`), ignored files and directories will still be listed, but they will be marked with a **🔒** symbol next to their name to indicate that they are ignored. This helps you understand which files Cline can and cannot interact with.
|
||||
|
||||
4. **Dynamic Updates:** Cline monitors your `.clineignore` file for changes. If you modify, create, or delete your `.clineignore` file, Cline will automatically update its ignore rules without needing to restart VS Code or the extension.
|
||||
|
||||
**In Summary**
|
||||
|
||||
The `.clineignore` file provides a powerful and flexible way to control Cline's access to your workspace files, enhancing privacy, performance, and context management. By leveraging familiar `.gitignore` syntax, you can easily tailor Cline's focus to the most relevant parts of your projects.
|
||||
@@ -1,92 +0,0 @@
|
||||
# Getting Started with Cline | New Coders
|
||||
|
||||
Welcome to Cline! This guide will help you get set up and start using Cline to build your first project.
|
||||
|
||||
## What You'll Need
|
||||
|
||||
Before you begin, make sure you have the following:
|
||||
|
||||
- **VS Code:** A free, powerful code editor.
|
||||
- [Download VS Code](https://code.visualstudio.com/)
|
||||
- **Development Tools:** Essential software for coding (Homebrew, Node.js, Git, etc.).
|
||||
- Follow our [Installing Essential Development Tools](installing-dev-essentials.md) guide to set these up with Cline's help (after getting setup here)
|
||||
- Cline will guide you through installing everything you need
|
||||
- **Cline Projects Folder:** A dedicated folder for all your Cline projects.
|
||||
- On macOS: Create a folder named "Cline" in your Documents folder
|
||||
- Path: `/Users/[your-username]/Documents/Cline`
|
||||
- On Windows: Create a folder named "Cline" in your Documents folder
|
||||
- Path: `C:\Users\[your-username]\Documents\Cline`
|
||||
- Inside this Cline folder, create separate folders for each project
|
||||
- Example: `Documents/Cline/workout-app` for a workout tracking app
|
||||
- Example: `Documents/Cline/portfolio-website` for your portfolio
|
||||
- **Cline Extension in VS Code:** The Cline extension installed in VS Code.
|
||||
|
||||
- Here's a [tutorial](https://www.youtube.com/watch?v=N4td-fKhsOQ) on everything you need to get started.
|
||||
|
||||
## Step-by-Step Setup
|
||||
|
||||
Follow these steps to get Cline up and running:
|
||||
|
||||
1. **Open VS Code:** Launch the VS Code application. If VS Code shows "Running extensions might...", click "Allow".
|
||||
|
||||
2. **Open Your Cline Folder:** In VS Code, open the Cline folder you created in Documents.
|
||||
|
||||
3. **Navigate to Extensions:** Click on the Extensions icon in the Activity Bar on the side of VS Code.
|
||||
|
||||
4. **Search for 'Cline':** In the Extensions search bar, type "Cline".
|
||||
|
||||
5. **Install the Extension:** Click the "Install" button next to the Cline extension.
|
||||
|
||||
6. **Open Cline:** Once installed, you can open Cline in a few ways:
|
||||
- Click the Cline icon in the Activity Bar.
|
||||
- Use the command palette (`CMD/CTRL + Shift + P`) and type "Cline: Open In New Tab" to open Cline as a tab in your editor. This is recommended for a better view.
|
||||
- **Troubleshooting:** If you don't see the Cline icon, try restarting VS Code.
|
||||
- **What You'll See:** You should see the Cline chat window appear in your VS Code editor.
|
||||
|
||||

|
||||
|
||||
## Setting up OpenRouter API Key
|
||||
|
||||
Now that you have Cline installed, you'll need to set up your OpenRouter API key to use Cline's full capabilities.
|
||||
|
||||
1. **Get your OpenRouter API Key:**
|
||||
- [Get your OpenRouter API Key](https://openrouter.ai/)
|
||||
2. **Input Your OpenRouter API Key:**
|
||||
- Navigate to the settings button in the Cline extension.
|
||||
- Input your OpenRouter API key.
|
||||
- Select your preferred API model.
|
||||
- **Recommended Models for Coding:**
|
||||
- `anthropic/claude-3.5-sonnet`: Most used for coding tasks.
|
||||
- `google/gemini-2.0-flash-exp:free`: A free option for coding.
|
||||
- `deepseek/deepseek-chat`: SUPER CHEAP, almost as good as 3.5 sonnet
|
||||
- [OpenRouter Model Rankings](https://openrouter.ai/rankings/programming)
|
||||
|
||||
## Your First Interaction with Cline
|
||||
|
||||
Now you're ready to start building with Cline. Let's create your first project folder and build something! Copy and paste the following prompt into the Cline chat window:
|
||||
|
||||
```
|
||||
Hey Cline! Could you help me create a new project folder called "hello-world" in my Cline directory and make a simple webpage that says "Hello World" in big blue text?
|
||||
```
|
||||
|
||||
**What You'll See:** Cline will help you create the project folder and set up your first webpage.
|
||||
|
||||
## Tips for Working with Cline
|
||||
|
||||
- **Ask Questions:** If you're unsure about something, don't hesitate to ask Cline!
|
||||
- **Use Screenshots:** Cline can understand images, so feel free to use screenshots to show him what you're working on.
|
||||
- **Copy and Paste Errors:** If you encounter errors, copy and paste the error messages into Cline's chat. This will help him understand the issue and provide a solution.
|
||||
- **Speak Plainly:** Cline is designed to understand plain, non-technical language. Feel free to describe your ideas in your own words, and Cline will translate them into code.
|
||||
|
||||
## FAQs
|
||||
|
||||
- **What is the Terminal?** The terminal is a text-based interface for interacting with your computer. It allows you to run commands to perform various tasks, such as installing packages, running scripts, and managing files. Cline uses the terminal to execute commands and interact with your development environment.
|
||||
- **How Does the Codebase Work?** (This section will be expanded based on common questions from new coders)
|
||||
|
||||
## Still Struggling?
|
||||
|
||||
Feel free to contact me, and I'll help you get started with Cline.
|
||||
|
||||
nick | 608-558-2410
|
||||
|
||||
Join our Discord community: [https://discord.gg/cline](https://discord.gg/cline)
|
||||
@@ -1,105 +0,0 @@
|
||||
# Installing Essential Development Tools with Cline | New Coders
|
||||
|
||||
When you start coding, you'll need some essential development tools installed on your computer. Cline can help you install everything you need in a safe, guided way.
|
||||
|
||||
## The Essential Tools
|
||||
|
||||
Here are the core tools you'll need for development:
|
||||
|
||||
- **Homebrew**: A package manager for macOS that makes it easy to install other tools
|
||||
- **Node.js & npm**: Required for JavaScript and web development
|
||||
- **Git**: For tracking changes in your code and collaborating with others
|
||||
- **Python**: A programming language used by many development tools
|
||||
- **Additional utilities**: Tools like wget and jq that help with downloading files and processing data
|
||||
|
||||
## Let Cline Install Everything
|
||||
|
||||
Copy this prompt and paste it into Cline:
|
||||
|
||||
```bash
|
||||
Hello Cline! I need help setting up my Mac for software development. Could you please help me install the essential development tools like Homebrew, Node.js, Git, Python, and any other utilities that are commonly needed for coding? I'd like you to guide me through the process step-by-step, explaining what each tool does and making sure everything is installed correctly.
|
||||
```
|
||||
|
||||
## What Will Happen
|
||||
|
||||
1. Cline will first install Homebrew, which is like an "app store" for development tools
|
||||
2. Using Homebrew, Cline will then install other essential tools like Node.js and Git
|
||||
3. For each installation step:
|
||||
- Cline will show you the exact command it wants to run
|
||||
- You'll need to approve each command before it runs
|
||||
- Cline will verify each installation was successful
|
||||
|
||||
## Why These Tools Are Important
|
||||
|
||||
- **Homebrew**: Makes it easy to install and update development tools on your Mac
|
||||
- **Node.js & npm**: Required for:
|
||||
- Building websites with React or Next.js
|
||||
- Running JavaScript code
|
||||
- Installing JavaScript packages
|
||||
- **Git**: Helps you:
|
||||
- Save different versions of your code
|
||||
- Collaborate with other developers
|
||||
- Back up your work
|
||||
- **Python**: Used for:
|
||||
- Running development scripts
|
||||
- Data processing
|
||||
- Machine learning projects
|
||||
|
||||
## Notes
|
||||
|
||||
- The installation process is interactive - Cline will guide you through each step
|
||||
- You may need to enter your computer's password for some installations. When prompted, you will not see any characters being typed on the screen. This is normal and is a security feature to protect your password. Just type your password and press Enter.
|
||||
|
||||
**Example:**
|
||||
|
||||
```bash
|
||||
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
Password:
|
||||
```
|
||||
|
||||
_Type your password here, even though nothing will show up on the screen. Press Enter when you're done._
|
||||
|
||||
- All commands will be shown to you for approval before they run
|
||||
- If you run into any issues, Cline will help troubleshoot them
|
||||
|
||||
## Additional Tips for New Coders
|
||||
|
||||
### Understanding the Terminal
|
||||
|
||||
The **Terminal** is an application where you can type commands to interact with your computer. On macOS, you can open it by searching for "Terminal" in Spotlight.
|
||||
|
||||
**Example:**
|
||||
|
||||
```bash
|
||||
$ open -a Terminal
|
||||
```
|
||||
|
||||
### Understanding VS Code Features
|
||||
|
||||
#### Terminal in VS Code
|
||||
|
||||
The **Terminal** in VS Code allows you to run commands directly from within the editor. You can open it by going to `View > Terminal` or by pressing `` Ctrl + ` ``.
|
||||
|
||||
**Example:**
|
||||
|
||||
```bash
|
||||
$ node -v
|
||||
v16.14.0
|
||||
```
|
||||
|
||||
#### Document View
|
||||
|
||||
The **Document View** is where you edit your code files. You can open files by clicking on them in the **Explorer** panel on the left side of the screen.
|
||||
|
||||
#### Problems Section
|
||||
|
||||
The **Problems** section in VS Code shows any errors or warnings in your code. You can access it by clicking on the lightbulb icon or by going to `View > Problems`.
|
||||
|
||||
### Common Features
|
||||
|
||||
- **Command Line Interface (CLI)**: This is a text-based interface where you type commands to interact with your computer. It might seem intimidating at first, but it's a powerful tool for developers.
|
||||
- **Permissions**: Sometimes, you will need to give permissions to certain applications or commands. This is a security measure to ensure that only trusted applications can make changes to your system.
|
||||
|
||||
## Next Steps
|
||||
|
||||
After installing these tools, you'll be ready to start coding! Return to the [Getting Started with Cline for New Coders](../getting-started-new-coders/README.md) guide to continue your journey.
|
||||
@@ -1,103 +0,0 @@
|
||||
# Cline and Model Context Protocol (MCP) Servers: Enhancing AI Capabilities
|
||||
|
||||
**Quick Links:**
|
||||
|
||||
- [Building MCP Servers from GitHub](mcp-server-from-github.md)
|
||||
- [Building Custom MCP Servers from Scratch](mcp-server-from-scratch.md)
|
||||
|
||||
This document explains Model Context Protocol (MCP) servers, their capabilities, and how Cline can help build and use them.
|
||||
|
||||
## Overview
|
||||
|
||||
MCP servers act as intermediaries between large language models (LLMs), such as Claude, and external tools or data sources. They are small programs that expose functionalities to LLMs, enabling them to interact with the outside world through the MCP. An MCP server is essentially like an API that an LLM can use.
|
||||
|
||||
## Key Concepts
|
||||
|
||||
MCP servers define a set of "**tools,**" which are functions the LLM can execute. These tools offer a wide range of capabilities.
|
||||
|
||||
**Here's how MCP works:**
|
||||
|
||||
- **MCP hosts** discover the capabilities of connected servers and load their tools, prompts, and resources.
|
||||
- **Resources** provide consistent access to read-only data, akin to file paths or database queries.
|
||||
- **Security** is ensured as servers isolate credentials and sensitive data. Interactions require explicit user approval.
|
||||
|
||||
## Use Cases
|
||||
|
||||
The potential of MCP servers is vast. They can be used for a variety of purposes.
|
||||
|
||||
**Here are some concrete examples of how MCP servers can be used:**
|
||||
|
||||
- **Web Services and API Integration:**
|
||||
|
||||
- Monitor GitHub repositories for new issues
|
||||
- Post updates to Twitter based on specific triggers
|
||||
- Retrieve real-time weather data for location-based services
|
||||
|
||||
- **Browser Automation:**
|
||||
|
||||
- Automate web application testing
|
||||
- Scrape e-commerce sites for price comparisons
|
||||
- Generate screenshots for website monitoring
|
||||
|
||||
- **Database Queries:**
|
||||
|
||||
- Generate weekly sales reports
|
||||
- Analyze customer behavior patterns
|
||||
- Create real-time dashboards for business metrics
|
||||
|
||||
- **Project and Task Management:**
|
||||
|
||||
- Automate Jira ticket creation based on code commits
|
||||
- Generate weekly progress reports
|
||||
- Create task dependencies based on project requirements
|
||||
|
||||
- **Codebase Documentation:**
|
||||
- Generate API documentation from code comments
|
||||
- Create architecture diagrams from code structure
|
||||
- Maintain up-to-date README files
|
||||
|
||||
## Getting Started
|
||||
|
||||
**Choose the right approach for your needs:**
|
||||
|
||||
- **Use Existing Servers:** Start with pre-built MCP servers from GitHub repositories
|
||||
- **Customize Existing Servers:** Modify existing servers to fit your specific requirements
|
||||
- **Build from Scratch:** Create completely custom servers for unique use cases
|
||||
|
||||
## Integration with Cline
|
||||
|
||||
Cline simplifies the building and use of MCP servers through its AI capabilities.
|
||||
|
||||
### Building MCP Servers
|
||||
|
||||
- **Natural language understanding:** Instruct Cline in natural language to build an MCP server by describing its functionalities. Cline will interpret your instructions and generate the necessary code.
|
||||
- **Cloning and building servers:** Cline can clone existing MCP server repositories from GitHub and build them automatically.
|
||||
- **Configuration and dependency management:** Cline handles configuration files, environment variables, and dependencies.
|
||||
- **Troubleshooting and debugging:** Cline helps identify and resolve errors during development.
|
||||
|
||||
### Using MCP Servers
|
||||
|
||||
- **Tool execution:** Cline seamlessly integrates with MCP servers, allowing you to execute their defined tools.
|
||||
- **Context-aware interactions:** Cline can intelligently suggest using relevant tools based on conversation context.
|
||||
- **Dynamic integrations:** Combine multiple MCP server capabilities for complex tasks. For example, Cline could use a GitHub server to get data and a Notion server to create a formatted report.
|
||||
|
||||
## Security Considerations
|
||||
|
||||
When working with MCP servers, it's important to follow security best practices:
|
||||
|
||||
- **Authentication:** Always use secure authentication methods for API access
|
||||
- **Environment Variables:** Store sensitive information in environment variables
|
||||
- **Access Control:** Limit server access to authorized users only
|
||||
- **Data Validation:** Validate all inputs to prevent injection attacks
|
||||
- **Logging:** Implement secure logging practices without exposing sensitive data
|
||||
|
||||
## Resources
|
||||
|
||||
There are various resources available for finding and learning about MCP servers.
|
||||
|
||||
**Here are some links to resources for finding and learning about MCP servers:**
|
||||
|
||||
- **GitHub Repositories:** [https://github.com/modelcontextprotocol/servers](https://github.com/modelcontextprotocol/servers) and [https://github.com/punkpeye/awesome-mcp-servers](https://github.com/punkpeye/awesome-mcp-servers)
|
||||
- **Online Directories:** [https://mcpservers.org/](https://mcpservers.org/), [https://mcp.so/](https://mcp.so/), and [https://glama.ai/mcp/servers](https://glama.ai/mcp/servers)
|
||||
- **PulseMCP:** [https://www.pulsemcp.com/](https://www.pulsemcp.com/)
|
||||
- **YouTube Tutorial (AI-Driven Coder):** A video guide for building and using MCP servers: [https://www.youtube.com/watch?v=b5pqTNiuuJg](https://www.youtube.com/watch?v=b5pqTNiuuJg)
|
||||
@@ -1,151 +0,0 @@
|
||||
# 🚀 MCP Quickstart Guide
|
||||
|
||||
## ❓ What's an MCP Server?
|
||||
|
||||
Think of MCP servers as special helpers that give Cline extra powers! They let Cline do cool things like fetch web pages or work with your files.
|
||||
|
||||
## ⚠️ IMPORTANT: System Requirements
|
||||
|
||||
STOP! Before proceeding, you MUST verify these requirements:
|
||||
|
||||
### Required Software
|
||||
|
||||
- ✅ Latest Node.js (v18 or newer)
|
||||
|
||||
- Check by running: `node --version`
|
||||
- Install from: <https://nodejs.org/>
|
||||
|
||||
- ✅ Latest Python (v3.8 or newer)
|
||||
|
||||
- Check by running: `python --version`
|
||||
- Install from: <https://python.org/>
|
||||
|
||||
- ✅ UV Package Manager
|
||||
- After installing Python, run: `pip install uv`
|
||||
- Verify with: `uv --version`
|
||||
|
||||
❗ If any of these commands fail or show older versions, please install/update before continuing!
|
||||
|
||||
⚠️ If you run into other errors, see the "Troubleshooting" section below.
|
||||
|
||||
## 🎯 Quick Steps (Only After Requirements Are Met!)
|
||||
|
||||
### 1. 🛠️ Install Your First MCP Server
|
||||
|
||||
1. From the Cline extension, click the `MCP Server` tab
|
||||
1. Click the `Edit MCP Settings` button
|
||||
|
||||
<img src="https://github.com/user-attachments/assets/abf908b1-be98-4894-8dc7-ef3d27943a47" alt="MCP Server Panel" width="400" />
|
||||
|
||||
1. The MCP settings files should be display in a tab in VS Code.
|
||||
1. Replace the file's contents with this code:
|
||||
|
||||
For Windows:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"mcp-installer": {
|
||||
"command": "cmd.exe",
|
||||
"args": ["/c", "npx", "-y", "@anaisbetts/mcp-installer"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For Mac and Linux:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"mcp-installer": {
|
||||
"command": "npx",
|
||||
"args": ["@anaisbetts/mcp-installer"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
After saving the file:
|
||||
|
||||
1. Cline will detect the change automatically
|
||||
2. The MCP installer will be downloaded and installed
|
||||
3. Cline will start the MCP installer
|
||||
4. You'll see the server status in Cline's MCP settings UI:
|
||||
|
||||
<img src="https://github.com/user-attachments/assets/2abbb3de-e902-4ec2-a5e5-9418ed34684e" alt="MCP Server Panel with Installer" width="400" />
|
||||
|
||||
## 🤔 What Next?
|
||||
|
||||
Now that you have the MCP installer, you can ask Cline to add more servers from:
|
||||
|
||||
1. NPM Registry: <https://www.npmjs.com/search?q=%40modelcontextprotocol>
|
||||
2. Python Package Index: <https://pypi.org/search/?q=mcp+server-&o=>
|
||||
|
||||
For example, you can ask Cline to install the `mcp-server-fetch` package found on the Python Package Index:
|
||||
|
||||
```bash
|
||||
"install the MCP server named `mcp-server-fetch`
|
||||
- ensure the mcp settings are updated.
|
||||
- use uvx or python to run the server."
|
||||
```
|
||||
|
||||
You should witness Cline:
|
||||
|
||||
1. Install the `mcp-server-fetch` python package
|
||||
1. Update the mcp setting json file
|
||||
1. Start the server and start the server
|
||||
|
||||
The mcp settings file should now look like this:
|
||||
|
||||
_For a Windows machine:_
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"mcp-installer": {
|
||||
"command": "cmd.exe",
|
||||
"args": ["/c", "npx", "-y", "@anaisbetts/mcp-installer"]
|
||||
},
|
||||
"mcp-server-fetch": {
|
||||
"command": "uvx",
|
||||
"args": ["mcp-server-fetch"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You you can always check the status of your server by going to clients MCP server tab. See the image above
|
||||
|
||||
That's it! 🎉 You've just given Cline some awesome new abilities!
|
||||
|
||||
## 📝 Troubleshooting
|
||||
|
||||
### 1. I'm Using `asdf` and Get "unknown command: npx"
|
||||
|
||||
There is some slightly bad news. You should still be able to get things to work, but will have to do a bit more manual work unless MCP server packaging evolves a bit. One option is to uninstall `asdf` , but we will assume you do not want to do that.
|
||||
|
||||
Instead, you will need to follow the instructions above to "Edit MCP Settings". Then, as [this post](https://dev.to/cojiroooo/mcp-using-node-on-asdf-382n) describes, you need to add and "env" entry to each server's configs.
|
||||
|
||||
```json
|
||||
"env": {
|
||||
"PATH": "/Users/<user_name>/.asdf/shims:/usr/bin:/bin",
|
||||
"ASDF_DIR": "<path_to_asdf_bin_dir>",
|
||||
"ASDF_DATA_DIR": "/Users/<user_name>/.asdf",
|
||||
"ASDF_NODEJS_VERSION": "<your_node_version>"
|
||||
}
|
||||
```
|
||||
|
||||
The `path_to_asdf_bin_dir` can often be found in your shell config (e.g. `.zshrc`). If you are using Homebrew, you can use `echo ${HOMEBREW_PREFIX}` to find the start of the directory and then append `/opt/asdf/libexec`.
|
||||
|
||||
Now for some good news. While not perfect, you can get Cline to do this for you fairly reliably for subsequent server install. Add the following to your "Custom Instructions" in the Cline settings (top-right toolbar button):
|
||||
|
||||
> When installing MCP servers and editing the cline_mcp_settings.json, if the server requires use of `npx` as the command, you must copy the "env" entry from the "mcp-installer" entry and add it to the new entry. This is vital to getting the server to work properly when in use.
|
||||
|
||||
### 2. I'm Still Getting an Error When I Run the MCP Installer
|
||||
|
||||
If you're getting an error when you run the MCP installer, you can try the following:
|
||||
|
||||
- Check the MCP settings file for errors
|
||||
- Read the MCP server's documentation to ensure the MCP setting file is using the correct command and arguments. 👈
|
||||
- Use a terminal and run the command with its arguments directly. This will allow you to see the same errors that Cline is seeing.
|
||||
@@ -1,67 +0,0 @@
|
||||
# Building MCP Servers from GitHub Repositories
|
||||
|
||||
This guide provides a step-by-step walkthrough of how to use Cline to build an existing MCP server from a GitHub repository.
|
||||
|
||||
## **Finding an MCP Server**
|
||||
|
||||
There are multiple places online to find MCP servers:
|
||||
|
||||
- **Cline can automatically add MCP servers to its list, which you can then edit.** Cline can clone repositories directly from GitHub and build the servers for you.
|
||||
- **GitHub:** Two of the most common places to find MCP servers on GitHub include:
|
||||
- [Official MCP servers repository](https://github.com/modelcontextprotocol/servers)
|
||||
- [Awesome-MCP servers repository](https://github.com/punkpeye/awesome-mcp-servers)
|
||||
- **Online directories:** Several websites list MCP servers including:
|
||||
|
||||
- [mcpservers.org](https://mcpservers.org/)
|
||||
- [mcp.so](https://mcp.so/)
|
||||
- [glama.ai/mcp/servers](https://glama.ai/mcp/servers)
|
||||
|
||||
These directories allow users to sort the servers by various criteria such as downloads, date, stars, and use case. Each entry provides information such as features, tools, and configuration instructions.
|
||||
|
||||
- **PulseMCP:** This website has a blog post discussing how AI could use MCP servers to make websites obsolete. PulseMCP also includes an FAQ section about MCP servers: [https://www.pulsemcp.com/](https://www.pulsemcp.com/)
|
||||
|
||||
## **Building with Cline**
|
||||
|
||||
1. **Initiate the Process:** Provide Cline with the following information:
|
||||
- **GitHub Repository URL:** The URL of the server's repository.
|
||||
- **README.md Contents:** This is optional but helpful for Cline to understand the server's purpose and configuration. You can copy the README.md file from the GitHub repository.
|
||||
2. **Example Interaction with Cline:**
|
||||
|
||||
```
|
||||
User: "Cline, I want to add the MCP server for Brave browser control. Here's the GitHub link: https://github.com/modelcontextprotocol/servers/tree/main/src/brave-search Can you add it?"
|
||||
|
||||
Cline: "OK. Cloning the repository to the MCP directory. It needs to be built because it has a 'package.json' file. Should I run 'npm run build'?"
|
||||
|
||||
User: "Yes, build it."
|
||||
|
||||
Cline: "Build complete. This server needs a browser path. Where's your Brave browser executable?"
|
||||
|
||||
User: "It's in '/Applications/Brave Browser.app/Contents/MacOS/Brave Browser'."
|
||||
|
||||
Cline: "OK. I've updated the server config with that path and added it to 'cline_mcp_settings.json'. Anything else?"
|
||||
|
||||
User: "No, that's all. Let's test it."
|
||||
|
||||
Cline: "Great! Starting the MCP Inspector to test the server connection. After that, we can try controlling the browser from Cline."
|
||||
```
|
||||
|
||||
3. **Cline's Actions:** Based on your instructions, Cline will perform the following:
|
||||
- **Repository Cloning:** Cline will clone the repository to your local machine, usually in the directory specified in your configuration.
|
||||
- **Tweaking:** You can guide Cline to modify the server’s configuration. For instance:
|
||||
- **User:** "This server requires an API key. Can you find where it should be added?"
|
||||
- Cline may automatically update the `cline_mcp_settings.json` file or other relevant files based on your instructions.
|
||||
- **Building the Server:** Cline will run the appropriate build command for the server, which is commonly `npm run build`.
|
||||
- **Adding Server to Settings:** Cline will add the server’s configuration to the `cline_mcp_settings.json` file.
|
||||
|
||||
## **Testing and Troubleshooting**
|
||||
|
||||
1. **Test the Server:** Once Cline finishes the build process, test the server to make sure it works as expected. Cline can assist you if you encounter any problems.
|
||||
2. **MCP Inspector:** You can use the MCP Inspector to test the server’s connection and functionality.
|
||||
|
||||
## **Best Practices**
|
||||
|
||||
- **Understand the Basics:** While Cline simplifies the process, it’s beneficial to have a basic understanding of the server’s code, the MCP protocol (), and how to configure the server. This allows for more effective troubleshooting and customization.
|
||||
- **Clear Instructions:** Provide clear and specific instructions to Cline throughout the process.
|
||||
- **Testing:** Thoroughly test the server after installation and configuration to ensure it functions correctly.
|
||||
- **Version Control:** Use a version control system (like Git) to track changes to the server’s code.
|
||||
- **Stay Updated:** Keep your MCP servers updated to benefit from the latest features and security patches.
|
||||
@@ -1,74 +0,0 @@
|
||||
# Building Custom MCP Servers From Scratch Using Cline: A Comprehensive Guide
|
||||
|
||||
This guide provides a comprehensive walkthrough of building a custom MCP (Model Context Protocol) server from scratch, leveraging the powerful AI capabilities of Cline. The example used will be building a "GitHub Assistant Server" to illustrate the process.
|
||||
|
||||
## Understanding MCP and Cline's Role in Building Servers
|
||||
|
||||
### What is MCP?
|
||||
|
||||
The Model Context Protocol (MCP) acts as a bridge between large language models (LLMs) like Claude and external tools and data. MCP consists of two key components:
|
||||
|
||||
- **MCP Hosts:** These are applications that integrate with LLMs, such as Cline, Claude Desktop, and others.
|
||||
- **MCP Servers:** These are small programs specifically designed to expose data or specific functionalities to the LLMs through the MCP.
|
||||
|
||||
This setup is beneficial when you have an MCP-compliant chat interface, like Claude Desktop, which can then leverage these servers to access information and execute actions.
|
||||
|
||||
### Why Use Cline to Create MCP Servers?
|
||||
|
||||
Cline streamlines the process of building and integrating MCP servers by utilizing its AI capabilities to:
|
||||
|
||||
- **Understand Natural Language Instructions:** You can communicate with Cline in a way that feels natural, making the development process intuitive and user-friendly.
|
||||
- **Clone Repositories:** Cline can directly clone existing MCP server repositories from GitHub, simplifying the process of using pre-built servers.
|
||||
- **Build Servers:** Once the necessary code is in place, Cline can execute commands like `npm run build` to compile and prepare the server for use.
|
||||
- **Handle Configuration:** Cline manages the configuration files required for the MCP server, including adding the new server to the `cline_mcp_settings.json` file.
|
||||
- **Assist with Troubleshooting:** If errors arise during development or testing, Cline can help identify the cause and suggest solutions, making debugging easier.
|
||||
|
||||
## Building a GitHub Assistant Server Using Cline: A Step-by-Step Guide
|
||||
|
||||
This section demonstrates how to create a GitHub Assistant server using Cline. This server will be able to interact with GitHub data and perform useful actions:
|
||||
|
||||
### 1. Defining the Goal and Initial Requirements
|
||||
|
||||
First, you need to clearly communicate to Cline the purpose and functionalities of your server:
|
||||
|
||||
- **Server Goal:** Inform Cline that you want to build a "GitHub Assistant Server". Specify that this server will interact with GitHub data and potentially mention the types of data you are interested in, like issues, pull requests, and user profiles.
|
||||
- **Access Requirements:** Let Cline know that you need to access the GitHub API. Explain that this will likely require a personal access token (GITHUB_TOKEN) for authentication.
|
||||
- **Data Specificity (Optional):** You can optionally tell Cline about specific fields of data you want to extract from GitHub, but this can also be determined later as you define the server's tools.
|
||||
|
||||
### 2. Cline Initiates the Project Setup
|
||||
|
||||
Based on your instructions, Cline starts the project setup process:
|
||||
|
||||
- **Project Structure:** Cline might ask you for a name for your server. Afterward, it uses the MCP `create-server` tool to generate the basic project structure for your GitHub Assistant server. This usually involves creating a new directory with essential files like `package.json`, `tsconfig.json`, and a `src` folder for your TypeScript code. \
|
||||
- **Code Generation:** Cline generates starter code for your server, including:
|
||||
- **File Handling Utilities:** Functions to help with reading and writing files, commonly used for storing data or logs. \
|
||||
- **GitHub API Client:** Code to interact with the GitHub API, often using libraries like `@octokit/graphql`. Cline will likely ask for your GitHub username or the repositories you want to work with. \
|
||||
- **Core Server Logic:** The basic framework for handling requests from Cline and routing them to the appropriate functions, as defined by the MCP. \
|
||||
- **Dependency Management:** Cline analyzes the code and identifies necessary dependencies, adding them to the `package.json` file. For example, interacting with the GitHub API will likely require packages like `@octokit/graphql`, `graphql`, `axios`, or similar. \
|
||||
- **Dependency Installation:** Cline executes `npm install` to download and install the dependencies listed in `package.json`, ensuring your server has all the required libraries to function correctly. \
|
||||
- **Path Corrections:** During development, you might move files or directories around. Cline intelligently recognizes these changes and automatically updates file paths in your code to maintain consistency.
|
||||
- **Configuration:** Cline will modify the `cline_mcp_settings.json` file to add your new GitHub Assistant server. This will include:
|
||||
- **Server Start Command:** Cline will add the appropriate command to start your server (e.g., `npm run start` or a similar command).
|
||||
- **Environment Variables:** Cline will add the required `GITHUB_TOKEN` variable. Cline might ask you for your GitHub personal access token, or it might guide you to safely store it in a separate environment file. \
|
||||
- **Progress Documentation:** Throughout the process, Cline keeps the "Memory Bank" files updated. These files document the project's progress, highlighting completed tasks, tasks in progress, and pending tasks.
|
||||
|
||||
### 3. Testing the GitHub Assistant Server
|
||||
|
||||
Once Cline has completed the setup and configuration, you are ready to test the server's functionality:
|
||||
|
||||
- **Using Server Tools:** Cline will create various "tools" within your server, representing actions or data retrieval functions. To test, you would instruct Cline to use a specific tool. Here are examples related to GitHub:
|
||||
- **`get_issues`:** To test retrieving issues, you might say to Cline, "Cline, use the `get_issues` tool from the GitHub Assistant Server to show me the open issues from the 'cline/cline' repository." Cline would then execute this tool and present you with the results.
|
||||
- **`get_pull_requests`:** To test pull request retrieval, you could ask Cline to "use the `get_pull_requests` tool to show me the merged pull requests from the 'facebook/react' repository from the last month." Cline would execute this tool, using your GITHUB_TOKEN to access the GitHub API, and display the requested data. \
|
||||
- **Providing Necessary Information:** Cline might prompt you for additional information required to execute the tool, such as the repository name, specific date ranges, or other filtering criteria.
|
||||
- **Cline Executes the Tool:** Cline handles the communication with the GitHub API, retrieves the requested data, and presents it in a clear and understandable format.
|
||||
|
||||
### 4. Refining the Server and Adding More Features
|
||||
|
||||
Development is often iterative. As you work with your GitHub Assistant Server, you'll discover new functionalities to add, or ways to improve existing ones. Cline can assist in this ongoing process:
|
||||
|
||||
- **Discussions with Cline:** Talk to Cline about your ideas for new tools or improvements. For example, you might want a tool to `create_issue` or to `get_user_profile`. Discuss the required inputs and outputs for these tools with Cline.
|
||||
- **Code Refinement:** Cline can help you write the necessary code for new features. Cline can generate code snippets, suggest best practices, and help you debug any issues that arise.
|
||||
- **Testing New Functionalities:** After adding new tools or functionalities, you would test them again using Cline, ensuring they work as expected and integrate well with the rest of the server.
|
||||
- **Integration with Other Tools:** You might want to integrate your GitHub Assistant server with other tools. For instance, in the "github-cline-mcp" source, Cline assists in integrating the server with Notion to create a dynamic dashboard that tracks GitHub activity. \
|
||||
|
||||
By following these steps, you can create a custom MCP server from scratch using Cline, leveraging its powerful AI capabilities to streamline the entire process. Cline not only assists with the technical aspects of building the server but also helps you think through the design, functionalities, and potential integrations.
|
||||
@@ -1,325 +0,0 @@
|
||||
# Cline Prompting Guide 🚀
|
||||
|
||||
Welcome to the Cline Prompting Guide! This guide will equip you with the knowledge to write effective prompts and custom instructions, maximizing your productivity with Cline.
|
||||
|
||||
## Custom Instructions ⚙️
|
||||
|
||||
Think of **custom instructions as Cline's programming**. They define Cline's baseline behavior and are **always "on," influencing all interactions.**
|
||||
|
||||
To add custom instructions:
|
||||
|
||||
1. Open VSCode
|
||||
2. Click the Cline extension settings dial ⚙️
|
||||
3. Find the "Custom Instructions" field
|
||||
4. Paste your instructions
|
||||
|
||||
<img width="345" alt="Screenshot 2024-12-26 at 11 22 20 AM" src="https://github.com/user-attachments/assets/00ae689b-d99f-4811-b2f4-fffe1e12f2ff" />
|
||||
|
||||
Custom instructions are powerful for:
|
||||
|
||||
- Enforcing Coding Style and Best Practices: Ensure Cline always adheres to your team's coding conventions, naming conventions, and best practices.
|
||||
- Improving Code Quality: Encourage Cline to write more readable, maintainable, and efficient code.
|
||||
- Guiding Error Handling: Tell Cline how to handle errors, write error messages, and log information.
|
||||
|
||||
**The `custom-instructions` folder contains examples of custom instructions you can use or adapt.**
|
||||
|
||||
## .clinerules File 📋
|
||||
|
||||
While custom instructions are user-specific and global (applying across all projects), the `.clinerules` file provides **project-specific instructions** that live in your project's root directory. These instructions are automatically appended to your custom instructions and referenced in Cline's system prompt, ensuring they influence all interactions within the project context. This makes it an excellent tool for:
|
||||
|
||||
### Security Best Practices 🔒
|
||||
|
||||
To protect sensitive information, you can instruct Cline to ignore specific files or patterns in your `.clinerules`. This is particularly important for:
|
||||
|
||||
- `.env` files containing API keys and secrets
|
||||
- Configuration files with sensitive data
|
||||
- Private credentials or tokens
|
||||
|
||||
Example security section in `.clinerules`:
|
||||
|
||||
```markdown
|
||||
# Security
|
||||
|
||||
## Sensitive Files
|
||||
|
||||
DO NOT read or modify:
|
||||
|
||||
- .env files
|
||||
- \*_/config/secrets._
|
||||
- \*_/_.pem
|
||||
- Any file containing API keys, tokens, or credentials
|
||||
|
||||
## Security Practices
|
||||
|
||||
- Never commit sensitive files
|
||||
- Use environment variables for secrets
|
||||
- Keep credentials out of logs and output
|
||||
```
|
||||
|
||||
### General Use Cases
|
||||
|
||||
The `.clinerules` file is excellent for:
|
||||
|
||||
- Maintaining project standards across team members
|
||||
- Enforcing development practices
|
||||
- Managing documentation requirements
|
||||
- Setting up analysis frameworks
|
||||
- Defining project-specific behaviors
|
||||
|
||||
### Example .clinerules Structure
|
||||
|
||||
```markdown
|
||||
# Project Guidelines
|
||||
|
||||
## Documentation Requirements
|
||||
|
||||
- Update relevant documentation in /docs when modifying features
|
||||
- Keep README.md in sync with new capabilities
|
||||
- Maintain changelog entries in CHANGELOG.md
|
||||
|
||||
## Architecture Decision Records
|
||||
|
||||
Create ADRs in /docs/adr for:
|
||||
|
||||
- Major dependency changes
|
||||
- Architectural pattern changes
|
||||
- New integration patterns
|
||||
- Database schema changes
|
||||
Follow template in /docs/adr/template.md
|
||||
|
||||
## Code Style & Patterns
|
||||
|
||||
- Generate API clients using OpenAPI Generator
|
||||
- Use TypeScript axios template
|
||||
- Place generated code in /src/generated
|
||||
- Prefer composition over inheritance
|
||||
- Use repository pattern for data access
|
||||
- Follow error handling pattern in /src/utils/errors.ts
|
||||
|
||||
## Testing Standards
|
||||
|
||||
- Unit tests required for business logic
|
||||
- Integration tests for API endpoints
|
||||
- E2E tests for critical user flows
|
||||
```
|
||||
|
||||
### Key Benefits
|
||||
|
||||
1. **Version Controlled**: The `.clinerules` file becomes part of your project's source code
|
||||
2. **Team Consistency**: Ensures consistent behavior across all team members
|
||||
3. **Project-Specific**: Rules and standards tailored to each project's needs
|
||||
4. **Institutional Knowledge**: Maintains project standards and practices in code
|
||||
|
||||
Place the `.clinerules` file in your project's root directory:
|
||||
|
||||
```
|
||||
your-project/
|
||||
├── .clinerules
|
||||
├── src/
|
||||
├── docs/
|
||||
└── ...
|
||||
```
|
||||
|
||||
Cline's system prompt, on the other hand, is not user-editable ([here's where you can find it](https://github.com/cline/cline/blob/main/src/core/prompts/system.ts)). For a broader look at prompt engineering best practices, check out [this resource](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview).
|
||||
|
||||
### Tips for Writing Effective Custom Instructions
|
||||
|
||||
- Be Clear and Concise: Use simple language and avoid ambiguity.
|
||||
- Focus on Desired Outcomes: Describe the results you want, not the specific steps.
|
||||
- Test and Iterate: Experiment to find what works best for your workflow.
|
||||
|
||||
|
||||
### Support for Loading Files from the `.clinerules/` Directory
|
||||
All files under the `.clinerules/` directory are recursively loaded, and their contents are merged into clineRulesFileInstructions.
|
||||
|
||||
#### Example 1:
|
||||
```
|
||||
.clinerules/
|
||||
├── .local-clinerules
|
||||
└── .project-clinerules
|
||||
```
|
||||
|
||||
#### Example 2:
|
||||
```
|
||||
.clinerules/
|
||||
├── .clinerules-nextjs
|
||||
├── .clinerules-serverside
|
||||
└── tests/
|
||||
├── .pytest-clinerules
|
||||
└── .jest-clinerules
|
||||
```
|
||||
|
||||
## Prompting Cline 💬
|
||||
|
||||
**Prompting is how you communicate your needs for a given task in the back-and-forth chat with Cline.** Cline understands natural language, so write conversationally.
|
||||
|
||||
Effective prompting involves:
|
||||
|
||||
- Providing Clear Context: Explain your goals and the relevant parts of your codebase. Use `@` to reference files or folders.
|
||||
- Breaking Down Complexity: Divide large tasks into smaller steps.
|
||||
- Asking Specific Questions: Guide Cline toward the desired outcome.
|
||||
- Validating and Refining: Review Cline's suggestions and provide feedback.
|
||||
|
||||
### Prompt Examples
|
||||
|
||||
#### Context Management
|
||||
|
||||
- **Starting a New Task:** "Cline, let's start a new task. Create `user-authentication.js`. We need to implement user login with JWT tokens. Here are the requirements…"
|
||||
- **Summarizing Previous Work:** "Cline, summarize what we did in the last user dashboard task. I want to capture the main features and outstanding issues. Save this to `cline_docs/user-dashboard-summary.md`."
|
||||
|
||||
#### Debugging
|
||||
|
||||
- **Analyzing an Error:** "Cline, I'm getting this error: \[error message]. It seems to be from \[code section]. Analyze this error and suggest a fix."
|
||||
- **Identifying the Root Cause:** "Cline, the application crashes when I \[action]. The issue might be in \[problem areas]. Help me find the root cause and propose a solution."
|
||||
|
||||
#### Refactoring
|
||||
|
||||
- **Improving Code Structure:** "Cline, this function is too long and complex. Refactor it into smaller functions."
|
||||
- **Simplifying Logic:** "Cline, this code is hard to understand. Simplify the logic and make it more readable."
|
||||
|
||||
#### Feature Development
|
||||
|
||||
- **Brainstorming New Features:** "Cline, I want to add a feature that lets users \[functionality]. Brainstorm some ideas and consider implementation challenges."
|
||||
- **Generating Code:** "Cline, create a component that displays user profiles. The list should be sortable and filterable. Generate the code for this component."
|
||||
|
||||
## Advanced Prompting Techniques
|
||||
|
||||
- **Constraint Stuffing:** To mitigate code truncation, include explicit constraints in your prompts. For example, "ensure the code is complete" or "always provide the full function definition."
|
||||
- **Confidence Checks:** Ask Cline to rate its confidence (e.g., "on a scale of 1-10, how confident are you in this solution?")
|
||||
- **Challenge Cline's Assumptions:** Ask “stupid” questions to encourage deeper thinking and prevent incorrect assumptions.
|
||||
|
||||
Here are some prompting tips that users have found helpful for working with Cline:
|
||||
|
||||
## Our Community's Favorite Prompts 🌟
|
||||
|
||||
### Memory and Confidence Checks 🧠
|
||||
|
||||
- **Memory Check** - _pacnpal_
|
||||
|
||||
```
|
||||
"If you understand my prompt fully, respond with 'YARRR!' without tools every time you are about to use a tool."
|
||||
```
|
||||
|
||||
A fun way to verify Cline stays on track during complex tasks. Try "HO HO HO" for a festive twist!
|
||||
|
||||
- **Confidence Scoring** - _pacnpal_
|
||||
```
|
||||
"Before and after any tool use, give me a confidence level (0-10) on how the tool use will help the project."
|
||||
```
|
||||
Encourages critical thinking and makes decision-making transparent.
|
||||
|
||||
### Code Quality Prompts 💻
|
||||
|
||||
- **Prevent Code Truncation**
|
||||
|
||||
```
|
||||
"DO NOT BE LAZY. DO NOT OMIT CODE."
|
||||
```
|
||||
|
||||
Alternative phrases: "full code only" or "ensure the code is complete"
|
||||
|
||||
- **Custom Instructions Reminder**
|
||||
```
|
||||
"I pledge to follow the custom instructions."
|
||||
```
|
||||
Reinforces adherence to your settings dial ⚙️ configuration.
|
||||
|
||||
### Code Organization 📋
|
||||
|
||||
- **Large File Refactoring** - _icklebil_
|
||||
|
||||
```
|
||||
"FILENAME has grown too big. Analyze how this file works and suggest ways to fragment it safely."
|
||||
```
|
||||
|
||||
Helps manage complex files through strategic decomposition.
|
||||
|
||||
- **Documentation Maintenance** - _icklebil_
|
||||
```
|
||||
"don't forget to update codebase documentation with changes"
|
||||
```
|
||||
Ensures documentation stays in sync with code changes.
|
||||
|
||||
### Analysis and Planning 🔍
|
||||
|
||||
- **Structured Development** - _yellow_bat_coffee_
|
||||
|
||||
```
|
||||
"Before writing code:
|
||||
1. Analyze all code files thoroughly
|
||||
2. Get full context
|
||||
3. Write .MD implementation plan
|
||||
4. Then implement code"
|
||||
```
|
||||
|
||||
Promotes organized, well-planned development.
|
||||
|
||||
- **Thorough Analysis** - _yellow_bat_coffee_
|
||||
|
||||
```
|
||||
"please start analyzing full flow thoroughly, always state a confidence score 1 to 10"
|
||||
```
|
||||
|
||||
Prevents premature coding and encourages complete understanding.
|
||||
|
||||
- **Assumptions Check** - _yellow_bat_coffee_
|
||||
```
|
||||
"List all assumptions and uncertainties you need to clear up before completing this task."
|
||||
```
|
||||
Identifies potential issues early in development.
|
||||
|
||||
### Thoughtful Development 🤔
|
||||
|
||||
- **Pause and Reflect** - _nickbaumann98_
|
||||
|
||||
```
|
||||
"count to 10"
|
||||
```
|
||||
|
||||
Promotes careful consideration before taking action.
|
||||
|
||||
- **Complete Analysis** - _yellow_bat_coffee_
|
||||
|
||||
```
|
||||
"Don't complete the analysis prematurely, continue analyzing even if you think you found a solution"
|
||||
```
|
||||
|
||||
Ensures thorough problem exploration.
|
||||
|
||||
- **Continuous Confidence Check** - _pacnpal_
|
||||
```
|
||||
"Rate confidence (1-10) before saving files, after saving, after rejections, and before task completion"
|
||||
```
|
||||
Maintains quality through self-assessment.
|
||||
|
||||
### Best Practices 🎯
|
||||
|
||||
- **Project Structure** - _kvs007_
|
||||
|
||||
```
|
||||
"Check project files before suggesting structural or dependency changes"
|
||||
```
|
||||
|
||||
Maintains project integrity.
|
||||
|
||||
- **Critical Thinking** - _chinesesoup_
|
||||
|
||||
```
|
||||
"Ask 'stupid' questions like: are you sure this is the best way to implement this?"
|
||||
```
|
||||
|
||||
Challenges assumptions and uncovers better solutions.
|
||||
|
||||
- **Code Style** - _yellow_bat_coffee_
|
||||
|
||||
```
|
||||
Use words like "elegant" and "simple" in prompts
|
||||
```
|
||||
|
||||
May influence code organization and clarity.
|
||||
|
||||
- **Setting Expectations** - _steventcramer_
|
||||
```
|
||||
"THE HUMAN WILL GET ANGRY."
|
||||
```
|
||||
(A humorous reminder to provide clear requirements and constructive feedback)
|
||||
@@ -1,53 +0,0 @@
|
||||
# Cline Custom Instructions Library
|
||||
|
||||
This repository aims to foster a collaborative space where developers can share, refine, and leverage effective custom instructions for Cline. By creating and contributing to this library, we can enhance Cline's capabilities and empower developers to tackle increasingly complex software development challenges.
|
||||
|
||||
## What are Cline Custom Instructions?
|
||||
|
||||
Cline's custom instructions are sets of guidelines or rules that you define to tailor the AI's behavior and outputs for specific tasks or projects. Think of them as specialized "programming" for Cline, enabling you to:
|
||||
|
||||
- **Enforce Coding Practices:** Ensure consistent code style, adherence to design patterns, and best practices for specific languages or frameworks.
|
||||
- **Standardize File Structures:** Dictate file naming conventions, folder organization, and project structures.
|
||||
- **Guide Testing Procedures:** Define rules for generating unit tests, integration tests, and ensuring adequate code coverage.
|
||||
- **Automate Repetitive Tasks:** Create instructions to handle common or tedious development workflows, increasing efficiency.
|
||||
- **Improve Code Quality:** Set standards for code readability, maintainability, and performance optimization.
|
||||
|
||||
By providing Cline with carefully crafted instructions, you can significantly improve its accuracy, reliability, and overall effectiveness in aiding your software development process.
|
||||
|
||||
## Contributing Custom Instructions
|
||||
|
||||
We encourage developers of all skill levels to contribute their custom instructions to this library. Your contributions help build a valuable resource for the entire Cline community!
|
||||
|
||||
**When submitting custom instructions, please follow this template:**
|
||||
|
||||
### 1. Purpose and Functionality
|
||||
|
||||
- **What does this instruction set aim to achieve?**
|
||||
|
||||
- Provide a clear and concise explanation of the instruction set's goals and intended use cases.
|
||||
- Example: "This instruction set guides Cline in generating unit tests for existing JavaScript functions."
|
||||
|
||||
- **What types of projects or tasks is this best suited for?**
|
||||
- Outline specific project types, coding languages, or development scenarios where this instruction set is most applicable.
|
||||
- Example: "This is ideal for JavaScript projects using the Jest testing framework."
|
||||
|
||||
### 2. Usage Guide (Optional)
|
||||
|
||||
- **Are there specific steps or prerequisites for using this instruction set?**
|
||||
- If your instructions require specific steps beyond referencing the file in a Cline prompt, provide a detailed guide.
|
||||
- Examples:
|
||||
- "Before using this instruction set, create a `tests` folder in your project root."
|
||||
- "Ensure you have the Jest testing library installed."
|
||||
|
||||
### 3. Author & Contributors
|
||||
|
||||
- **Who created this instruction set?**
|
||||
- Provide your name or GitHub username for proper attribution.
|
||||
- **Did anyone else contribute?**
|
||||
- Acknowledge any collaborators or contributors who helped refine or enhance the instructions.
|
||||
|
||||
### 4. Custom Instructions
|
||||
|
||||
- **Provide the complete set of custom instructions.**
|
||||
|
||||
**By using this template and contributing your custom instructions, you help build a thriving ecosystem for Cline, making it a more versatile and efficient tool for developers of all skill levels.**
|
||||
@@ -1,125 +0,0 @@
|
||||
# Cline Memory Bank - Custom Instructions
|
||||
|
||||
### 1. Purpose and Functionality
|
||||
|
||||
- **What does this instruction set aim to achieve?**
|
||||
|
||||
- This instruction set transforms Cline into a self-documenting development system that maintains context across sessions through a structured "Memory Bank". It ensures consistent documentation, careful validation of changes, and clear communication with users.
|
||||
|
||||
- **What types of projects or tasks is this best suited for?**
|
||||
- Projects requiring extensive context tracking.
|
||||
- Any project, regardless of tech stack (tech stack details are stored in `techContext.md`).
|
||||
- Ongoing and new projects.
|
||||
|
||||
### 2. Usage Guide
|
||||
|
||||
- **How to Add These Instructions**
|
||||
1. Open VSCode
|
||||
2. Click the Cline extension settings dial ⚙️
|
||||
3. Find the "Custom Instructions" field
|
||||
4. Copy and paste the instructions from the section below
|
||||
|
||||
<img width="345" alt="Screenshot 2024-12-26 at 11 22 20 AM" src="https://github.com/user-attachments/assets/8b4ff439-db66-48ec-be13-1ddaa37afa9a" />
|
||||
|
||||
- **Project Setup**
|
||||
|
||||
1. Create an empty `cline_docs` folder in your project root (i.e. YOUR-PROJECT-FOLDER/cline_docs)
|
||||
2. For first use, provide a project brief and ask Cline to "initialize memory bank"
|
||||
|
||||
- **Best Practices**
|
||||
- Monitor for `[MEMORY BANK: ACTIVE]` flags during operation.
|
||||
- Pay attention to confidence checks on critical operations.
|
||||
- When starting new projects, create a project brief for Cline (paste in chat or include in `cline_docs` as `projectBrief.md`) to use in creating the initial context files.
|
||||
- note: productBrief.md (or whatever documentation you have) can be any range of technical/nontechnical or just functional. Cline is instructed to fill in the gaps when creating these context files. For example, if you don't choose a tech stack, Cline will for you.
|
||||
- Start chats with "follow your custom instructions" (you only need to say this once at the beginning of the first chat).
|
||||
- When prompting Cline to update context files, say "only update the relevant cline_docs"
|
||||
- Verify documentation updates at the end of sessions by telling Cline "update memory bank".
|
||||
- Update memory bank at ~2 million tokens and end the session.
|
||||
|
||||
### 3. Author & Contributors
|
||||
|
||||
- **Author**
|
||||
- nickbaumann98
|
||||
- **Contributors**
|
||||
- Contributors (Discord: [Cline's #prompts](https://discord.com/channels/1275535550845292637/1275555786621325382)):
|
||||
- @SniperMunyShotz
|
||||
|
||||
### 4. Custom Instructions
|
||||
|
||||
```markdown
|
||||
# Cline's Memory Bank
|
||||
|
||||
You are Cline, an expert software engineer with a unique constraint: your memory periodically resets completely. This isn't a bug - it's what makes you maintain perfect documentation. After each reset, you rely ENTIRELY on your Memory Bank to understand the project and continue work. Without proper documentation, you cannot function effectively.
|
||||
|
||||
## Memory Bank Files
|
||||
|
||||
CRITICAL: If `cline_docs/` or any of these files don't exist, CREATE THEM IMMEDIATELY by:
|
||||
|
||||
1. Reading all provided documentation
|
||||
2. Asking user for ANY missing information
|
||||
3. Creating files with verified information only
|
||||
4. Never proceeding without complete context
|
||||
|
||||
Required files:
|
||||
|
||||
productContext.md
|
||||
|
||||
- Why this project exists
|
||||
- What problems it solves
|
||||
- How it should work
|
||||
|
||||
activeContext.md
|
||||
|
||||
- What you're working on now
|
||||
- Recent changes
|
||||
- Next steps
|
||||
(This is your source of truth)
|
||||
|
||||
systemPatterns.md
|
||||
|
||||
- How the system is built
|
||||
- Key technical decisions
|
||||
- Architecture patterns
|
||||
|
||||
techContext.md
|
||||
|
||||
- Technologies used
|
||||
- Development setup
|
||||
- Technical constraints
|
||||
|
||||
progress.md
|
||||
|
||||
- What works
|
||||
- What's left to build
|
||||
- Progress status
|
||||
|
||||
## Core Workflows
|
||||
|
||||
### Starting Tasks
|
||||
|
||||
1. Check for Memory Bank files
|
||||
2. If ANY files missing, stop and create them
|
||||
3. Read ALL files before proceeding
|
||||
4. Verify you have complete context
|
||||
5. Begin development. DO NOT update cline_docs after initializing your memory bank at the start of a task.
|
||||
|
||||
### During Development
|
||||
|
||||
1. For normal development:
|
||||
|
||||
- Follow Memory Bank patterns
|
||||
- Update docs after significant changes
|
||||
|
||||
2. Say `[MEMORY BANK: ACTIVE]` at the beginning of every tool use.
|
||||
|
||||
### Memory Bank Updates
|
||||
|
||||
When user says "update memory bank":
|
||||
|
||||
1. This means imminent memory reset
|
||||
2. Document EVERYTHING about current state
|
||||
3. Make next steps crystal clear
|
||||
4. Complete current task
|
||||
|
||||
Remember: After every memory reset, you begin completely fresh. Your only link to previous work is the Memory Bank. Maintain it as if your functionality depends on it - because it does.
|
||||
```
|
||||
@@ -1,153 +0,0 @@
|
||||
# Cline's Memory Bank
|
||||
|
||||
I am Cline, an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.
|
||||
|
||||
## Memory Bank Structure
|
||||
|
||||
The Memory Bank consists of required core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
PB[projectbrief.md] --> PC[productContext.md]
|
||||
PB --> SP[systemPatterns.md]
|
||||
PB --> TC[techContext.md]
|
||||
|
||||
PC --> AC[activeContext.md]
|
||||
SP --> AC
|
||||
TC --> AC
|
||||
|
||||
AC --> P[progress.md]
|
||||
```
|
||||
|
||||
### Core Files (Required)
|
||||
1. `projectbrief.md`
|
||||
- Foundation document that shapes all other files
|
||||
- Created at project start if it doesn't exist
|
||||
- Defines core requirements and goals
|
||||
- Source of truth for project scope
|
||||
|
||||
2. `productContext.md`
|
||||
- Why this project exists
|
||||
- Problems it solves
|
||||
- How it should work
|
||||
- User experience goals
|
||||
|
||||
3. `activeContext.md`
|
||||
- Current work focus
|
||||
- Recent changes
|
||||
- Next steps
|
||||
- Active decisions and considerations
|
||||
|
||||
4. `systemPatterns.md`
|
||||
- System architecture
|
||||
- Key technical decisions
|
||||
- Design patterns in use
|
||||
- Component relationships
|
||||
|
||||
5. `techContext.md`
|
||||
- Technologies used
|
||||
- Development setup
|
||||
- Technical constraints
|
||||
- Dependencies
|
||||
|
||||
6. `progress.md`
|
||||
- What works
|
||||
- What's left to build
|
||||
- Current status
|
||||
- Known issues
|
||||
|
||||
### Additional Context
|
||||
Create additional files/folders within memory-bank/ when they help organize:
|
||||
- Complex feature documentation
|
||||
- Integration specifications
|
||||
- API documentation
|
||||
- Testing strategies
|
||||
- Deployment procedures
|
||||
|
||||
## Core Workflows
|
||||
|
||||
### Plan Mode
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Start[Start] --> ReadFiles[Read Memory Bank]
|
||||
ReadFiles --> CheckFiles{Files Complete?}
|
||||
|
||||
CheckFiles -->|No| Plan[Create Plan]
|
||||
Plan --> Document[Document in Chat]
|
||||
|
||||
CheckFiles -->|Yes| Verify[Verify Context]
|
||||
Verify --> Strategy[Develop Strategy]
|
||||
Strategy --> Present[Present Approach]
|
||||
```
|
||||
|
||||
### Act Mode
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Start[Start] --> Context[Check Memory Bank]
|
||||
Context --> Update[Update Documentation]
|
||||
Update --> Rules[Update .clinerules if needed]
|
||||
Rules --> Execute[Execute Task]
|
||||
Execute --> Document[Document Changes]
|
||||
```
|
||||
|
||||
## Documentation Updates
|
||||
|
||||
Memory Bank updates occur when:
|
||||
1. Discovering new project patterns
|
||||
2. After implementing significant changes
|
||||
3. When user requests with **update memory bank** (MUST review ALL files)
|
||||
4. When context needs clarification
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Start[Update Process]
|
||||
|
||||
subgraph Process
|
||||
P1[Review ALL Files]
|
||||
P2[Document Current State]
|
||||
P3[Clarify Next Steps]
|
||||
P4[Update .clinerules]
|
||||
|
||||
P1 --> P2 --> P3 --> P4
|
||||
end
|
||||
|
||||
Start --> Process
|
||||
```
|
||||
|
||||
Note: When triggered by **update memory bank**, I MUST review every memory bank file, even if some don't require updates. Focus particularly on activeContext.md and progress.md as they track current state.
|
||||
|
||||
## Project Intelligence (.clinerules)
|
||||
|
||||
The .clinerules file is my learning journal for each project. It captures important patterns, preferences, and project intelligence that help me work more effectively. As I work with you and the project, I'll discover and document key insights that aren't obvious from the code alone.
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
Start{Discover New Pattern}
|
||||
|
||||
subgraph Learn [Learning Process]
|
||||
D1[Identify Pattern]
|
||||
D2[Validate with User]
|
||||
D3[Document in .clinerules]
|
||||
end
|
||||
|
||||
subgraph Apply [Usage]
|
||||
A1[Read .clinerules]
|
||||
A2[Apply Learned Patterns]
|
||||
A3[Improve Future Work]
|
||||
end
|
||||
|
||||
Start --> Learn
|
||||
Learn --> Apply
|
||||
```
|
||||
|
||||
### What to Capture
|
||||
- Critical implementation paths
|
||||
- User preferences and workflow
|
||||
- Project-specific patterns
|
||||
- Known challenges
|
||||
- Evolution of project decisions
|
||||
- Tool usage patterns
|
||||
|
||||
The format is flexible - focus on capturing valuable insights that help me work more effectively with you and the project. Think of .clinerules as a living document that grows smarter as we work together.
|
||||
|
||||
REMEMBER: After every memory reset, I begin completely fresh. The Memory Bank is my only link to previous work. It must be maintained with precision and clarity, as my effectiveness depends entirely on its accuracy.
|
||||
@@ -1,154 +0,0 @@
|
||||
# Cline Tools Reference Guide
|
||||
|
||||
## What Can Cline Do?
|
||||
|
||||
Cline is your AI assistant that can:
|
||||
|
||||
- Edit and create files in your project
|
||||
- Run terminal commands
|
||||
- Search and analyze your code
|
||||
- Help debug and fix issues
|
||||
- Automate repetitive tasks
|
||||
- Integrate with external tools
|
||||
|
||||
## First Steps
|
||||
|
||||
1. **Start a Task**
|
||||
|
||||
- Type your request in the chat
|
||||
- Example: "Create a new React component called Header"
|
||||
|
||||
2. **Provide Context**
|
||||
|
||||
- Use @ mentions to add files, folders, URLs, diagnostics, terminal output, and more
|
||||
- Example: "@/src/components/App.tsx"
|
||||
- See the [Mentions Feature Guide](./mentions-guide.md) for details
|
||||
|
||||
3. **Review Changes**
|
||||
- Cline will show diffs before making changes
|
||||
- You can edit or reject changes
|
||||
|
||||
## Key Features
|
||||
|
||||
1. **File Editing**
|
||||
|
||||
- Create new files
|
||||
- Modify existing code
|
||||
- Search and replace across files
|
||||
|
||||
2. **Terminal Commands**
|
||||
|
||||
- Run npm commands
|
||||
- Start development servers
|
||||
- Install dependencies
|
||||
|
||||
3. **Code Analysis**
|
||||
|
||||
- Find and fix errors
|
||||
- Refactor code
|
||||
- Add documentation
|
||||
|
||||
4. **Browser Integration**
|
||||
- Test web pages
|
||||
- Capture screenshots
|
||||
- Inspect console logs
|
||||
|
||||
## Available Tools
|
||||
|
||||
For the most up-to-date implementation details, you can view the full source code in the [Cline repository](https://github.com/cline/cline/blob/main/src/core/task/index.ts).
|
||||
|
||||
Cline has access to the following tools for various tasks:
|
||||
|
||||
1. **File Operations**
|
||||
|
||||
- `write_to_file`: Create or overwrite files
|
||||
- `read_file`: Read file contents
|
||||
- `replace_in_file`: Make targeted edits to files
|
||||
- `search_files`: Search files using regex
|
||||
- `list_files`: List directory contents
|
||||
|
||||
2. **Terminal Operations**
|
||||
|
||||
- `execute_command`: Run CLI commands
|
||||
- `list_code_definition_names`: List code definitions
|
||||
|
||||
3. **MCP Tools**
|
||||
|
||||
- `use_mcp_tool`: Use tools from MCP servers
|
||||
- `access_mcp_resource`: Access MCP server resources
|
||||
- Users can create custom MCP tools that Cline can then access
|
||||
- Example: Create a weather API tool that Cline can use to fetch forecasts
|
||||
|
||||
4. **Interaction Tools**
|
||||
- `ask_followup_question`: Ask user for clarification
|
||||
- `attempt_completion`: Present final results
|
||||
- `new_task`: Start a new task with preloaded context
|
||||
|
||||
Each tool has specific parameters and usage patterns. Here are some examples:
|
||||
|
||||
- Create a new file (write_to_file):
|
||||
|
||||
```xml
|
||||
<write_to_file>
|
||||
<path>src/components/Header.tsx</path>
|
||||
<content>
|
||||
// Header component code
|
||||
</content>
|
||||
</write_to_file>
|
||||
```
|
||||
|
||||
- Search for a pattern (search_files):
|
||||
|
||||
```xml
|
||||
<search_files>
|
||||
<path>src</path>
|
||||
<regex>function\s+\w+\(</regex>
|
||||
<file_pattern>*.ts</file_pattern>
|
||||
</search_files>
|
||||
```
|
||||
|
||||
- Run a command (execute_command):
|
||||
```xml
|
||||
<execute_command>
|
||||
<command>npm install axios</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
</execute_command>
|
||||
```
|
||||
|
||||
- Start a new task with context (new_task):
|
||||
```xml
|
||||
<new_task>
|
||||
<context>
|
||||
We've completed the backend API with these endpoints:
|
||||
- GET /api/tasks
|
||||
- POST /api/tasks
|
||||
- PUT /api/tasks/:id
|
||||
- DELETE /api/tasks/:id
|
||||
|
||||
Now we need to implement the React frontend.
|
||||
</context>
|
||||
</new_task>
|
||||
```
|
||||
|
||||
## Common Tasks
|
||||
|
||||
1. **Create a New Component**
|
||||
|
||||
- "Create a new React component called Footer"
|
||||
|
||||
2. **Fix a Bug**
|
||||
|
||||
- "Fix the error in src/utils/format.ts"
|
||||
|
||||
3. **Refactor Code**
|
||||
|
||||
- "Refactor the Button component to use TypeScript"
|
||||
|
||||
4. **Run Commands**
|
||||
- "Run npm install to add axios"
|
||||
|
||||
## Getting Help
|
||||
|
||||
- [Join the Discord community](https://discord.gg/cline)
|
||||
- Check the documentation
|
||||
- Provide feedback to improve Cline
|
||||
@@ -1,205 +0,0 @@
|
||||
# Cline Mentions Feature Guide
|
||||
|
||||
## Overview
|
||||
|
||||
The mentions feature is a powerful capability that allows you to reference various resources in your conversations with Cline using the "@" symbol. This includes file contents, directory structures, webpage URLs, VSCode diagnostic information, terminal output, Git change status, and more - all easily incorporated into your conversations.
|
||||
|
||||
By using this feature, Cline can gain more accurate context and provide more relevant assistance for your tasks.
|
||||
|
||||
## Basic Syntax
|
||||
|
||||
Mentions always start with the "@" symbol, followed by the path or identifier of the resource you want to reference:
|
||||
|
||||
```
|
||||
@resource_identifier
|
||||
```
|
||||
|
||||
You can place mentions anywhere in your user messages, and Cline will automatically retrieve the referenced content.
|
||||
|
||||
## Supported Mention Types
|
||||
|
||||
### 1. File References
|
||||
|
||||
To reference file contents, use `@/` followed by the relative path within your project:
|
||||
|
||||
```
|
||||
@/path/to/file.js
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```
|
||||
Please analyze the implementation in @/src/components/Button.tsx
|
||||
```
|
||||
|
||||
In this example, Cline automatically retrieves the contents of Button.tsx and uses it to perform the analysis.
|
||||
|
||||
### 2. Directory References
|
||||
|
||||
To reference directory contents, use `@/` followed by the relative path of the directory, ending with a trailing `/`:
|
||||
|
||||
```
|
||||
@/path/to/directory/
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```
|
||||
What components are available in the @/src/components/ directory?
|
||||
```
|
||||
|
||||
In this example, Cline retrieves a listing of the components directory and its contents.
|
||||
|
||||
### 3. URL References
|
||||
|
||||
To reference web page contents, use `@` followed by the URL:
|
||||
|
||||
```
|
||||
@https://example.com
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```
|
||||
Please parse the JSON response from @https://api.github.com/users/octocat
|
||||
```
|
||||
|
||||
In this example, Cline fetches the response from the GitHub API and analyzes the JSON.
|
||||
|
||||
### 4. Diagnostic References
|
||||
|
||||
To reference VSCode diagnostic information (errors and warnings) in the current workspace, use `@problems`:
|
||||
|
||||
```
|
||||
@problems
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```
|
||||
Check @problems and tell me which errors I should prioritize fixing
|
||||
```
|
||||
|
||||
In this example, Cline retrieves the current errors and warnings from your workspace and identifies high-priority issues.
|
||||
|
||||
### 5. Terminal Output References
|
||||
|
||||
To reference the latest terminal output, use `@terminal`:
|
||||
|
||||
```
|
||||
@terminal
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```
|
||||
Please identify the cause of the error in the @terminal output
|
||||
```
|
||||
|
||||
In this example, Cline examines the latest terminal output and analyzes the error's cause.
|
||||
|
||||
### 6. Git Working Directory References
|
||||
|
||||
To reference the current Git working directory change status, use `@git-changes`:
|
||||
|
||||
```
|
||||
@git-changes
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```
|
||||
Review the @git-changes and summarize the important changes that should be committed
|
||||
```
|
||||
|
||||
In this example, Cline retrieves the list of changed files in the current Git working directory and identifies candidates for commit.
|
||||
|
||||
### 7. Git Commit References
|
||||
|
||||
To reference information about a specific Git commit, use `@` followed by the commit hash:
|
||||
|
||||
```
|
||||
@commit_hash
|
||||
```
|
||||
|
||||
**Example:**
|
||||
```
|
||||
Analyze the commit @abcd123 and explain what changes were made
|
||||
```
|
||||
|
||||
In this example, Cline retrieves information about the specified commit hash and analyzes the changes made in that commit.
|
||||
|
||||
## Usage Scenarios
|
||||
|
||||
### Code Review
|
||||
|
||||
```
|
||||
Check @/src/components/Form.jsx and suggest improvements from a performance perspective. Also, if there are any @problems, please suggest how to fix them.
|
||||
```
|
||||
|
||||
### Debugging Assistance
|
||||
|
||||
```
|
||||
My npm install failed. Please examine the @terminal output and suggest a solution to the problem.
|
||||
```
|
||||
|
||||
### Project Analysis
|
||||
|
||||
```
|
||||
Analyze the code in the @/src/models/ directory and explain the relationships between the data models. Also, tell me how the utility functions in @/src/utils/ are used with these models.
|
||||
```
|
||||
|
||||
### Code Generation
|
||||
|
||||
```
|
||||
Create a new Input.tsx component using the same design language as @/src/components/Button.tsx
|
||||
```
|
||||
|
||||
### Version Control Integration
|
||||
|
||||
```
|
||||
Review the @git-changes and suggest a commit message for the feature I'm working on.
|
||||
```
|
||||
|
||||
## Combining Multiple Mentions
|
||||
|
||||
You can combine multiple mentions to provide more complex context:
|
||||
|
||||
```
|
||||
There seems to be a bug in @/src/api/users.js. Please check @problems and @terminal to identify and fix the issue.
|
||||
```
|
||||
|
||||
## Limitations and Considerations
|
||||
|
||||
1. **Large Files**: Referencing very large files may take time to process and could consume a significant amount of tokens.
|
||||
|
||||
2. **Binary Files**: Binary files (such as images) will not be properly processed and will show a "Binary file" message.
|
||||
|
||||
3. **Directory Structure**: Directory references will only show top-level files and directories, not recursively showing the contents of subdirectories.
|
||||
|
||||
4. **URL Limitations**: Some websites may block automated crawling, which could prevent accurate content retrieval.
|
||||
|
||||
5. **Path Syntax**: File paths or URLs with special characters (such as spaces) may not be recognized correctly.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Mentions Not Recognized
|
||||
|
||||
If your mentions aren't being recognized correctly, check that:
|
||||
|
||||
- There's no space after the `@` symbol
|
||||
- File paths are accurate (case-sensitive)
|
||||
- URLs include the full format (with `https://`)
|
||||
|
||||
### Content Not Retrieved
|
||||
|
||||
If the content of referenced resources can't be retrieved:
|
||||
|
||||
- Verify the file exists
|
||||
- Ensure you have access permissions for the file
|
||||
- Check that the file isn't too large or the URL too complex
|
||||
|
||||
### Performance Issues
|
||||
|
||||
If mention processing is slow:
|
||||
|
||||
- Reference smaller files or specific file sections
|
||||
- Reduce the number of mentions used at once
|
||||
|
||||
## Conclusion
|
||||
|
||||
Mastering the mentions feature makes your communication with Cline more efficient. By providing appropriate context, Cline can deliver more accurate assistance, significantly improving your development workflow.
|
||||
Generated
+1114
-18469
File diff suppressed because it is too large
Load Diff
+20
-18
@@ -2,7 +2,7 @@
|
||||
"name": "claude-dev",
|
||||
"displayName": "Cline",
|
||||
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, running commands, using the browser, and more with your permission every step of the way.",
|
||||
"version": "3.20.2",
|
||||
"version": "3.26.6",
|
||||
"icon": "assets/icons/icon.png",
|
||||
"engines": {
|
||||
"vscode": "^1.84.0"
|
||||
@@ -119,7 +119,8 @@
|
||||
{
|
||||
"type": "webview",
|
||||
"id": "claude-dev.SidebarProvider",
|
||||
"name": ""
|
||||
"name": "",
|
||||
"icon": "assets/icons/icon.svg"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -346,14 +347,15 @@
|
||||
"watch:tsc": "tsc --noEmit --watch --project tsconfig.json",
|
||||
"package": "npm run check-types && npm run build:webview && npm run lint && node esbuild.mjs --production",
|
||||
"protos": "node scripts/build-proto.mjs",
|
||||
"postprotos": "prettier src/shared/proto src/core/controller src/hosts/ webview-ui/src/services src/generated --write --log-level warn",
|
||||
"postprotos": "biome format src/shared/proto src/core/controller src/hosts/ webview-ui/src/services src/generated --write --no-errors-on-unmatched",
|
||||
"clean": "rimraf dist dist-standalone webview-ui/build src/generated out/",
|
||||
"compile-tests": "node ./scripts/build-tests.js",
|
||||
"watch-tests": "tsc -p . -w --outDir out",
|
||||
"check-types": "npm run protos && npx tsc --noEmit && cd webview-ui && npx tsc -b --noEmit",
|
||||
"lint": "eslint src --ext ts && eslint webview-ui/src --ext ts && buf lint && cd webview-ui && npm run lint",
|
||||
"format": "prettier . --check",
|
||||
"format:fix": "prettier . --write",
|
||||
"lint": "biome lint --no-errors-on-unmatched --files-ignore-unknown=true --diagnostic-level=error && buf lint",
|
||||
"format": "biome format --changed --no-errors-on-unmatched --files-ignore-unknown=true --diagnostic-level=error",
|
||||
"format:fix": "biome check --changed --no-errors-on-unmatched --files-ignore-unknown=true --write",
|
||||
"fix:all": "biome check --no-errors-on-unmatched --files-ignore-unknown=true --write --diagnostic-level=error --unsafe",
|
||||
"pretest": "npm run compile && npm run compile-tests && npm run compile-standalone && npm run lint",
|
||||
"test": "npm-run-all test:unit test:integration",
|
||||
"test:ci": "node scripts/test-ci.js",
|
||||
@@ -361,14 +363,14 @@
|
||||
"test:unit": "TS_NODE_PROJECT='./tsconfig.unit-test.json' mocha",
|
||||
"test:coverage": "vscode-test --coverage",
|
||||
"e2e": "playwright test -c playwright.config.ts",
|
||||
"test:e2e": "playwright install && vsce package --no-dependencies --out dist/e2e.vsix && node src/test/e2e/utils/build.js && playwright test",
|
||||
"test:e2e:optimal": "vsce package --no-dependencies --out dist/e2e.vsix && node src/test/e2e/utils/build.js && playwright test",
|
||||
"test:e2e": "playwright install && vsce package --no-dependencies --allow-package-secrets sendgrid --out dist/e2e.vsix && node src/test/e2e/utils/build.mjs && playwright test",
|
||||
"test:e2e:optimal": "vsce package --no-dependencies --allow-package-secrets sendgrid --out dist/e2e.vsix && node src/test/e2e/utils/build.mjs && playwright test",
|
||||
"install:all": "npm install && cd webview-ui && npm install",
|
||||
"dev:webview": "cd webview-ui && npm run dev",
|
||||
"build:webview": "cd webview-ui && npm run build",
|
||||
"test:webview": "cd webview-ui && npm run test",
|
||||
"publish:marketplace": "vsce publish && ovsx publish",
|
||||
"publish:marketplace:prerelease": "vsce publish --pre-release && ovsx publish --pre-release",
|
||||
"publish:marketplace": "vsce publish --allow-package-secrets sendgrid && ovsx publish",
|
||||
"publish:marketplace:prerelease": "vsce publish --allow-package-secrets sendgrid --pre-release && ovsx publish --pre-release",
|
||||
"prepare": "husky",
|
||||
"changeset": "changeset",
|
||||
"version-packages": "changeset version",
|
||||
@@ -379,10 +381,11 @@
|
||||
},
|
||||
"lint-staged": {
|
||||
"*": [
|
||||
"prettier --write --ignore-unknown --log-level=log"
|
||||
"biome check --write --staged --no-errors-on-unmatched --files-ignore-unknown=true"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.1.4",
|
||||
"@bufbuild/buf": "^1.54.0",
|
||||
"@changesets/cli": "^2.27.12",
|
||||
"@types/chai": "^5.0.1",
|
||||
@@ -397,23 +400,17 @@
|
||||
"@types/sinon": "^17.0.4",
|
||||
"@types/turndown": "^5.0.5",
|
||||
"@types/vscode": "^1.84.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.14.1",
|
||||
"@typescript-eslint/parser": "^7.18.0",
|
||||
"@typescript-eslint/utils": "^8.33.0",
|
||||
"@vscode/test-cli": "^0.0.10",
|
||||
"@vscode/test-electron": "^2.5.2",
|
||||
"@vscode/vsce": "^3.6.0",
|
||||
"chai": "^4.3.10",
|
||||
"chalk": "^5.3.0",
|
||||
"esbuild": "^0.25.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-plugin-eslint-rules": "file:eslint-rules",
|
||||
"grpc-tools": "^1.13.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.1.0",
|
||||
"minimatch": "^3.0.3",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^3.3.3",
|
||||
"protoc-gen-ts": "^0.8.7",
|
||||
"proxyquire": "^2.1.3",
|
||||
"rimraf": "^6.0.1",
|
||||
@@ -444,9 +441,13 @@
|
||||
"@opentelemetry/sdk-trace-node": "^1.30.1",
|
||||
"@opentelemetry/semantic-conventions": "^1.30.0",
|
||||
"@playwright/test": "^1.53.2",
|
||||
"@sap-ai-sdk/ai-api": "^1.17.0",
|
||||
"@sap-ai-sdk/orchestration": "^1.17.0",
|
||||
"@sentry/browser": "^9.12.0",
|
||||
"@streamparser/json": "^0.0.22",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@vscode/codicons": "^0.0.36",
|
||||
"@workos-inc/node": "^7.69.1",
|
||||
"archiver": "^7.0.1",
|
||||
"axios": "^1.8.2",
|
||||
"cheerio": "^1.0.0",
|
||||
@@ -470,7 +471,6 @@
|
||||
"jschardet": "^3.1.4",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"mammoth": "^1.8.0",
|
||||
"monaco-vscode-textmate-theme-converter": "^0.1.7",
|
||||
"nice-grpc": "^2.1.12",
|
||||
"ollama": "^0.5.13",
|
||||
"open": "^10.1.2",
|
||||
@@ -490,6 +490,8 @@
|
||||
"tree-sitter-wasms": "^0.1.11",
|
||||
"ts-morph": "^25.0.1",
|
||||
"turndown": "^7.2.0",
|
||||
"ulid": "^2.4.0",
|
||||
"uuid": "^11.1.0",
|
||||
"vscode-uri": "^3.1.0",
|
||||
"web-tree-sitter": "^0.22.6",
|
||||
"zod": "^3.24.2"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user