mirror of
https://github.com/cline/cline.git
synced 2026-09-01 23:19:18 +08:00
Compare commits
145 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ffba23d3d | |||
| b3abbd886e | |||
| 8cdc4a936d | |||
| ecc58178dc | |||
| ca3f0f1abd | |||
| 987812a886 | |||
| 0e6afd9848 | |||
| 359e0e070d | |||
| b02ad8377d | |||
| 8fdf5ab8c5 | |||
| aceaeb069b | |||
| e39e58b5e2 | |||
| 717be3f026 | |||
| 5595d12dc3 | |||
| c230de0a14 | |||
| 2ecb87ac5a | |||
| 2315fc6769 | |||
| 6449c36849 | |||
| 8f93e9cc40 | |||
| 3a52baac14 | |||
| 35f08731f6 | |||
| 2c866c9265 | |||
| 10cfd8ba1e | |||
| da4d88fd84 | |||
| 889ed95840 | |||
| 716e6cd6ab | |||
| 45871a962e | |||
| c6aa47095e | |||
| 8c1093cfdc | |||
| 31161f894b | |||
| 20e5ae7b23 | |||
| 22f306e79e | |||
| 553b56336c | |||
| a3fa8cf7b9 | |||
| 4628eca3dc | |||
| 518e624086 | |||
| fa4fa01ec3 | |||
| f526317796 | |||
| 550883df6a | |||
| 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 |
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
fix showing the ai core exisiting models when resource group field is empty (using the default resource group)
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Fix issue on Account view where balance is fetched twice that cause janky UI
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Fixes an issue where thinking text from litellm was not being passed through to Cline thinking UI
|
||||
@@ -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
|
||||
---
|
||||
|
||||
Add search functionality to API provider dropdown
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Remove disabled approve / reject buttons from UI.
|
||||
@@ -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
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": minor
|
||||
---
|
||||
|
||||
support orchestration mode for sap provider
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Improve Gemini Rate Limit handling
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
fix: Support Anthropic Caching when using LiteLLM
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"claude-dev": patch
|
||||
---
|
||||
|
||||
Prompt changes for deep-planning in windows/powershell
|
||||
@@ -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,34 +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",
|
||||
"eslint-rules/no-direct-vscode-state-api": "error",
|
||||
"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", "dist-standalone", "**/*.d.ts", "node_modules"]
|
||||
}
|
||||
@@ -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,7 +97,7 @@ 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
|
||||
|
||||
@@ -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,10 +80,10 @@ 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
|
||||
|
||||
@@ -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
|
||||
|
||||
+13
-4
@@ -1,6 +1,15 @@
|
||||
{
|
||||
"extension": ["ts"],
|
||||
"spec": ["src/**/__tests__/*.ts", "eslint-rules/__tests__/**/*.test.ts"],
|
||||
"require": ["ts-node/register", "source-map-support/register", "./src/test/requires.ts"],
|
||||
"recursive": true
|
||||
"extension": [
|
||||
"ts"
|
||||
],
|
||||
"spec": [
|
||||
"src/**/__tests__/*.ts"
|
||||
],
|
||||
"require": [
|
||||
"ts-node/register",
|
||||
"source-map-support/register",
|
||||
"./src/test/requires.ts"
|
||||
],
|
||||
"recursive": true,
|
||||
"exit": 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,5 +1,64 @@
|
||||
# Changelog
|
||||
|
||||
## [3.27.0]
|
||||
|
||||
- Fix `grok-code-fast-1` model information
|
||||
- Add call to action for trying free `grok-code-fast-1` in Announcement banner
|
||||
|
||||
## [3.26.7]
|
||||
|
||||
- Add 200k context window variant for Claude Sonnet 4 to OpenRouter and Cline providers
|
||||
|
||||
## [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
|
||||
|
||||
+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**
|
||||
|
||||
@@ -30,9 +30,9 @@ English | <a href="https://github.com/cline/cline/blob/main/locales/es/README.md
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Meet Cline (pronounced /klaɪn/, like "Klein"), an AI assistant that can use your **CLI** a**N**d **E**ditor.
|
||||
Meet Cline, an AI assistant that can use your **CLI** a**N**d **E**ditor.
|
||||
|
||||
Thanks to [Claude 3.7 Sonnet's agentic coding capabilities](https://www.anthropic.com/claude/sonnet), Cline can handle complex software development tasks step-by-step. With tools that let him create & edit files, explore large projects, use the browser, and execute terminal commands (after you grant permission), he can assist you in ways that go beyond code completion or tech support. Cline can even use the Model Context Protocol (MCP) to create new tools and extend his own capabilities. While autonomous AI scripts traditionally run in sandboxed environments, this extension provides a human-in-the-loop GUI to approve every file change and terminal command, providing a safe and accessible way to explore the potential of agentic AI.
|
||||
Thanks to [Claude Sonnet's agentic coding capabilities](https://www.anthropic.com/claude/sonnet), Cline can handle complex software development tasks step-by-step. With tools that let him create & edit files, explore large projects, use the browser, and execute terminal commands (after you grant permission), he can assist you in ways that go beyond code completion or tech support. Cline can even use the Model Context Protocol (MCP) to create new tools and extend his own capabilities. While autonomous AI scripts traditionally run in sandboxed environments, this extension provides a human-in-the-loop GUI to approve every file change and terminal command, providing a safe and accessible way to explore the potential of agentic AI.
|
||||
|
||||
1. Enter your task and add images to convert mockups into functional apps or fix bugs with screenshots.
|
||||
2. Cline starts by analyzing your file structure & source code ASTs, running regex searches, and reading relevant files to get up to speed in existing projects. By carefully managing what information is added to context, Cline can provide valuable assistance even for large, complex projects without overwhelming the context window.
|
||||
@@ -87,7 +87,7 @@ All changes made by Cline are recorded in your file's Timeline, providing an eas
|
||||
|
||||
### Use the Browser
|
||||
|
||||
With Claude 3.5 Sonnet's new [Computer Use](https://www.anthropic.com/news/3-5-models-and-computer-use) capability, Cline can launch a browser, click elements, type text, and scroll, capturing screenshots and console logs at each step. This allows for interactive debugging, end-to-end testing, and even general web use! This gives him autonomy to fixing visual bugs and runtime issues without you needing to handhold and copy-pasting error logs yourself.
|
||||
With Claude Sonnet's new [Computer Use](https://www.anthropic.com/news/3-5-models-and-computer-use) capability, Cline can launch a browser, click elements, type text, and scroll, capturing screenshots and console logs at each step. This allows for interactive debugging, end-to-end testing, and even general web use! This gives him autonomy to fixing visual bugs and runtime issues without you needing to handhold and copy-pasting error logs yourself.
|
||||
|
||||
Try asking Cline to "test the app", and watch as he runs a command like `npm run dev`, launches your locally running dev server in a browser, and performs a series of tests to confirm that everything works. [See a demo here.](https://x.com/sdrzn/status/1850880547825823989)
|
||||
|
||||
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
{
|
||||
"$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",
|
||||
"noUnusedImports": "error"
|
||||
},
|
||||
"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"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
+39
-10
@@ -57,18 +57,27 @@
|
||||
{
|
||||
"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/installing-cline-jetbrains",
|
||||
"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",
|
||||
@@ -163,12 +172,18 @@
|
||||
"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"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -181,11 +196,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"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -196,10 +216,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"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,13 @@ 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:
|
||||
@@ -52,4 +59,17 @@ You can use [checkpoints](/features/checkpoints) to restore your task state from
|
||||
|
||||
<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>
|
||||
</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, pdfs, csv, excel, and other text files from your file system, as well as files from your workspace.
|
||||
|
||||
@@ -5,6 +5,13 @@ 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>
|
||||
|
||||
@@ -5,6 +5,13 @@ 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
|
||||
|
||||
@@ -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**.
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
---
|
||||
title: "Installing Cline for JetBrains"
|
||||
description: "Get Cline running in your favorite JetBrains IDE with the same powerful AI assistance you know from VSCode."
|
||||
---
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/jetbrains-logo.svg"
|
||||
alt="JetBrains logo"
|
||||
style={{ width: "200px", height: "auto", margin: "0 auto 20px auto", display: "block" }}
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
Cline for JetBrains works almost identically to Cline in VSCode. All the core features work properly: diff editing, using tools, logging in with different providers, MCP servers, Cline rules and workflows, and more.
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/jetbrains-demo-hifi.gif"
|
||||
alt="Cline running in JetBrains IDE showing AI assistance"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
<Note>Cline for JetBrains is currently in alpha. While all core features are functional, you may encounter occasional issues.</Note>
|
||||
|
||||
## Installation
|
||||
|
||||
Since Cline for JetBrains is currently in alpha, it's not yet available on the JetBrains Marketplace. You'll need to install it manually from a downloaded file:
|
||||
|
||||
### Manual Installation from Disk
|
||||
|
||||
1. **Download the Plugin:**
|
||||
- Go to [https://plugins.jetbrains.com/plugin/28247-cline/versions/stable](https://plugins.jetbrains.com/plugin/28247-cline/versions/stable)
|
||||
- Click **Download** to get the `.zip` file
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/cline-jetbrains-marketplace-download.png"
|
||||
alt="JetBrains plugin marketplace showing Cline download page"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
2. **Install from Disk:**
|
||||
- Open your JetBrains IDE
|
||||
- Go to **IntelliJ IDEA** (or whichever IDE you are in) → **Settings**
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/cline-jetbrains-settings.png"
|
||||
alt="JetBrains IDE settings dialog"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
- Select **Plugins** from the left sidebar
|
||||
- Click the gear icon ⚙️ and select **Install Plugin from Disk...**
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/cline-jetbrains-install-disk.png"
|
||||
alt="JetBrains IDE settings showing Install Plugin from Disk option"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
- Select the downloaded `.zip` file
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/cline-jetbrains-zip-file.png"
|
||||
alt="File selection dialog showing Cline plugin zip file"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
- Restart your IDE when prompted
|
||||
|
||||
## Getting Started with Cline
|
||||
|
||||
After installation, you'll find Cline in your IDE:
|
||||
|
||||
1. **Open Cline:**
|
||||
- Look for the Cline tool window (usually on the right side)
|
||||
- Or go to **View** → **Tool Windows** → **Cline**
|
||||
|
||||
2. **Sign In (optional, BYOK is also available):**
|
||||
- Click **Sign In** in the Cline panel
|
||||
- You'll be taken to [app.cline.bot](https://app.cline.bot) to create your account
|
||||
- No credit card needed to get started with free credits
|
||||
|
||||
3. **Start Coding:**
|
||||
- Try this first prompt: "Hey Cline! Can you help me create a simple Hello World program in this project?"
|
||||
|
||||
## Key Differences from VSCode
|
||||
|
||||
While Cline for JetBrains includes all the same powerful features, there's one important difference to be aware of:
|
||||
|
||||
**Terminal Integration:** The terminal inside JetBrains isn't integrated with Cline the same way it is in VSCode. Cline can execute commands, but the output will only appear in the webview if you expand the **Command Output** section.
|
||||
|
||||
This means:
|
||||
- Commands still run successfully
|
||||
- You can see the output by clicking to expand Command Output in the chat
|
||||
- Terminal commands work the same way, just with a different display
|
||||
|
||||
## What Works
|
||||
|
||||
Everything else works exactly like VSCode:
|
||||
|
||||
- **Diff Editing:** Cline can read, write, and edit files with the same precision
|
||||
- **Tool Usage:** All of Cline's tools (file operations, web browsing, etc.) work identically
|
||||
- **API Providers:** Connect to Anthropic, OpenAI, local models, and more
|
||||
- **MCP Servers:** Full support for Model Context Protocol servers
|
||||
- **Cline Rules:** Custom instructions and workflows work the same way
|
||||
- **@ Mentions:** Reference files, folders, problems, and more
|
||||
- **Drag & Drop:** Add files and images to conversations
|
||||
|
||||
## Tips for JetBrains Users
|
||||
|
||||
- **Project Context:** Cline automatically understands your project structure, just like in VSCode
|
||||
- **Language Support:** Cline works with any language your JetBrains IDE supports
|
||||
- **Debugging Help:** Share error messages and stack traces directly in the chat
|
||||
- **Code Review:** Ask Cline to review your code changes before committing
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If you don't see the Cline tool window after installation:
|
||||
- Restart your IDE completely
|
||||
- Check **View** → **Tool Windows** → **Cline**
|
||||
- Ensure the plugin is enabled in **Settings** → **Plugins**
|
||||
|
||||
Having other issues? Join our [Discord community](https://discord.gg/cline) for help from the team and other users.
|
||||
|
||||
## Next Steps
|
||||
|
||||
Now that you have Cline installed, you might want to:
|
||||
- Learn about [model selection](/getting-started/model-selection-guide) to choose the best AI provider
|
||||
- Explore [@ mentions](/features/at-mentions/overview) to reference files and context efficiently
|
||||
- Set up [Cline rules](/features/cline-rules) for your specific workflow
|
||||
- Try [MCP servers](/mcp/mcp-overview) to extend Cline's capabilities
|
||||
@@ -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,13 +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
|
||||
- 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
|
||||
- [Learn about Automatic Context Summarization](/features/automatic-context-summarization)
|
||||
- [How Cline manages context under the hood](https://cline.bot/blog/understanding-the-new-context-window-progress-bar-in-cline)
|
||||
|
||||
⚠️ **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
|
||||
|
||||
@@ -77,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
|
||||
|
||||
@@ -86,28 +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**: With [Automatic Context Summarization](/features/automatic-context-summarization), 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.
|
||||
**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 now includes intelligent features to manage context automatically:
|
||||
Cline includes intelligent features to manage context automatically:
|
||||
|
||||
### Automatic Context Summarization
|
||||
### Default Settings You Should Keep On
|
||||
|
||||
When your conversation approaches the context window limit, Cline automatically:
|
||||
- Creates a comprehensive summary of the conversation
|
||||
- Preserves all essential technical details and decisions
|
||||
- Seamlessly continues work without interruption
|
||||
- Maintains full task continuity
|
||||
**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).
|
||||
|
||||
This means you can work on larger projects without manually managing context. [Learn more about Automatic Context Summarization](/features/automatic-context-summarization).
|
||||
**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).
|
||||
|
||||
### Focus Chain Integration
|
||||
## Advanced Context Tools
|
||||
|
||||
When combined with [Focus Chain](/features/focus-chain), Cline can:
|
||||
- Maintain todo lists across context resets
|
||||
- Track progress through multiple summarizations
|
||||
- Keep working on long-horizon tasks without losing direction
|
||||
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
|
||||
|
||||
@@ -115,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
|
||||
@@ -173,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
@@ -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.
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
@@ -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"),
|
||||
|
||||
@@ -1,118 +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.commands.registerCommand("Hello")`,
|
||||
filename: "/foo/bar.ts",
|
||||
},
|
||||
// Should allow postMessage calls on other objects
|
||||
{
|
||||
code: `window.postMessage({ type: "test" }, "*")`,
|
||||
filename: "/foo/bar.ts",
|
||||
},
|
||||
// Should allow variables named vscode but not calling postMessage
|
||||
{
|
||||
code: `const vscode = { other: "method" }; vscode.other()`,
|
||||
filename: "/foo/bar.ts",
|
||||
},
|
||||
// Should allow vscode.postMessage in test files
|
||||
{
|
||||
code: `vscode.postMessage({ type: "newTask", text: message.text })`,
|
||||
filename: "/foo/bar.test.ts",
|
||||
},
|
||||
],
|
||||
invalid: [
|
||||
// Should disallow vscode.postMessage in regular files
|
||||
{
|
||||
code: `vscode.postMessage({ type: "test", data: {} })`,
|
||||
filename: "/foo/bar.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useGrpcClient",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow vscode.postMessage in components
|
||||
{
|
||||
code: `vscode.postMessage({ type: "apiConfiguration", apiConfiguration })`,
|
||||
filename: "ApiOptions.tsx",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useGrpcClient",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow property access for disallowed APIs
|
||||
{
|
||||
code: `const folders = vscode.workspace.workspaceFolders;`,
|
||||
filename: "workspace.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useHostBridgeWorkspace",
|
||||
},
|
||||
],
|
||||
},
|
||||
// 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,171 +0,0 @@
|
||||
const { RuleTester: StateApiRuleTester } = require("eslint")
|
||||
const noDirectVscodeStateApiRule = require("../no-direct-vscode-state-api")
|
||||
|
||||
const stateApiRuleTester = new StateApiRuleTester({
|
||||
parser: require.resolve("@typescript-eslint/parser"),
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
sourceType: "module",
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
stateApiRuleTester.run("no-direct-vscode-state-api", noDirectVscodeStateApiRule, {
|
||||
valid: [
|
||||
// Should allow state APIs in CacheService.ts
|
||||
{
|
||||
code: `await context.globalState.update("myKey", value);`,
|
||||
filename: "CacheService.ts",
|
||||
},
|
||||
{
|
||||
code: `const value = context.globalState.get("myKey");`,
|
||||
filename: "/src/core/storage/CacheService.ts",
|
||||
},
|
||||
{
|
||||
code: `await context.secrets.store("apiKey", value);`,
|
||||
filename: "CacheService.ts",
|
||||
},
|
||||
// Should allow state APIs in state-helpers.ts
|
||||
{
|
||||
code: `const value = context.globalState.get("myKey");`,
|
||||
filename: "state-helpers.ts",
|
||||
},
|
||||
{
|
||||
code: `await context.secrets.get("apiKey");`,
|
||||
filename: "/src/core/storage/utils/state-helpers.ts",
|
||||
},
|
||||
// Should allow state APIs in state-migrations.ts
|
||||
{
|
||||
code: `await context.globalState.update("myKey", value);`,
|
||||
filename: "state-migrations.ts",
|
||||
},
|
||||
{
|
||||
code: `const value = context.workspaceState.get("myKey");`,
|
||||
filename: "/src/core/storage/state-migrations.ts",
|
||||
},
|
||||
// Should allow state APIs in extension.ts
|
||||
{
|
||||
code: `const distinctId = context.globalState.get<string>("cline.distinctId");`,
|
||||
filename: "extension.ts",
|
||||
},
|
||||
{
|
||||
code: `await context.globalState.update("clineVersion", currentVersion);`,
|
||||
filename: "/src/extension.ts",
|
||||
},
|
||||
{
|
||||
code: `const secret = await context.secrets.get("clineAccountId");`,
|
||||
filename: "extension.ts",
|
||||
},
|
||||
// Should allow state APIs in test files
|
||||
{
|
||||
code: `context.globalState.get("testKey")`,
|
||||
filename: "/foo/bar.test.ts",
|
||||
},
|
||||
// Should allow non-state API calls
|
||||
{
|
||||
code: `const value = someOtherObject.globalState.get("myKey");`,
|
||||
filename: "some-file.ts",
|
||||
},
|
||||
{
|
||||
code: `await myContext.secrets.store("key", "value");`,
|
||||
filename: "some-file.ts",
|
||||
},
|
||||
],
|
||||
invalid: [
|
||||
// Should disallow context.globalState.get
|
||||
{
|
||||
code: `const value = context.globalState.get("myKey");`,
|
||||
filename: "some-file.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useCacheServiceGlobalGet",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow context.globalState.update
|
||||
{
|
||||
code: `await context.globalState.update("myKey", "myValue");`,
|
||||
filename: "some-file.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useCacheServiceGlobalSet",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow context.workspaceState.get
|
||||
{
|
||||
code: `const value = context.workspaceState.get("myKey");`,
|
||||
filename: "some-file.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useCacheServiceWorkspaceGet",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow context.workspaceState.update
|
||||
{
|
||||
code: `await context.workspaceState.update("myKey", "myValue");`,
|
||||
filename: "some-file.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useCacheServiceWorkspaceSet",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow context.secrets.get
|
||||
{
|
||||
code: `const secret = await context.secrets.get("apiKey");`,
|
||||
filename: "some-file.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useCacheServiceSecretsGet",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow context.secrets.store
|
||||
{
|
||||
code: `await context.secrets.store("apiKey", "secret-value");`,
|
||||
filename: "some-file.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useCacheServiceSecretsSet",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow context.secrets.delete
|
||||
{
|
||||
code: `await context.secrets.delete("apiKey");`,
|
||||
filename: "some-file.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useCacheServiceSecretsSet",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow chained state API calls
|
||||
{
|
||||
code: `const value = await context.globalState.get("key") || "default";`,
|
||||
filename: "some-file.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useCacheServiceGlobalGet",
|
||||
},
|
||||
],
|
||||
},
|
||||
// Should disallow state API calls in Promise.all
|
||||
{
|
||||
code: `await Promise.all([context.secrets.get("key1"), context.secrets.get("key2")]);`,
|
||||
filename: "some-file.ts",
|
||||
errors: [
|
||||
{
|
||||
messageId: "useCacheServiceSecretsGet",
|
||||
},
|
||||
{
|
||||
messageId: "useCacheServiceSecretsGet",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
})
|
||||
@@ -1,19 +0,0 @@
|
||||
// eslint-rules/index.js
|
||||
const noDirectVscodeApi = require("./no-direct-vscode-api")
|
||||
const noDirectVscodeStateApi = require("./no-direct-vscode-state-api")
|
||||
|
||||
module.exports = {
|
||||
rules: {
|
||||
"no-direct-vscode-api": noDirectVscodeApi,
|
||||
"no-direct-vscode-state-api": noDirectVscodeStateApi,
|
||||
},
|
||||
configs: {
|
||||
recommended: {
|
||||
plugins: ["local"],
|
||||
rules: {
|
||||
"local/no-direct-vscode-api": "warn",
|
||||
"local/no-direct-vscode-state-api": "error",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,224 +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",
|
||||
},
|
||||
"vscode.window.showInputBox": {
|
||||
messageId: "useHostBridge",
|
||||
},
|
||||
"vscode.workspace.findFiles": {
|
||||
messageId: "useNative",
|
||||
},
|
||||
}
|
||||
|
||||
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}}",
|
||||
useNative:
|
||||
"Use a native Javascript API instead of calling the vscode API.\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 checking test files
|
||||
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
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -1,144 +0,0 @@
|
||||
const { ESLintUtils } = require("@typescript-eslint/utils")
|
||||
const path = require("path")
|
||||
|
||||
const createRule = ESLintUtils.RuleCreator((name) => `https://cline.bot/eslint-rules/${name}`)
|
||||
|
||||
// Configuration for context-based state APIs
|
||||
const disallowedContextApis = {
|
||||
"globalState.get": {
|
||||
messageId: "useCacheServiceGlobalGet",
|
||||
},
|
||||
"globalState.update": {
|
||||
messageId: "useCacheServiceGlobalSet",
|
||||
},
|
||||
"workspaceState.get": {
|
||||
messageId: "useCacheServiceWorkspaceGet",
|
||||
},
|
||||
"workspaceState.update": {
|
||||
messageId: "useCacheServiceWorkspaceSet",
|
||||
},
|
||||
"secrets.get": {
|
||||
messageId: "useCacheServiceSecretsGet",
|
||||
},
|
||||
"secrets.store": {
|
||||
messageId: "useCacheServiceSecretsSet",
|
||||
},
|
||||
"secrets.delete": {
|
||||
messageId: "useCacheServiceSecretsSet",
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = createRule({
|
||||
name: "no-direct-vscode-state-api",
|
||||
meta: {
|
||||
type: "problem",
|
||||
docs: {
|
||||
description:
|
||||
"Disallow direct VSCode state API usage (context.globalState, context.workspaceState, context.secrets) in favor of CacheService",
|
||||
recommended: "error",
|
||||
},
|
||||
messages: {
|
||||
useCacheServiceGlobalGet:
|
||||
"Use CacheService.getGlobalStateKey() instead of context.globalState.get().\n" +
|
||||
"The CacheService provides fast in-memory access with automatic persistence.\n" +
|
||||
"Example: cacheService.getGlobalStateKey('myKey') instead of context.globalState.get('myKey').\n" +
|
||||
"Found: {{code}}",
|
||||
useCacheServiceGlobalSet:
|
||||
"Use CacheService.setGlobalState() instead of context.globalState.update().\n" +
|
||||
"The CacheService provides immediate updates with debounced persistence.\n" +
|
||||
"Example: cacheService.setGlobalState('myKey', value) instead of context.globalState.update('myKey', value).\n" +
|
||||
"Found: {{code}}",
|
||||
useCacheServiceWorkspaceGet:
|
||||
"Use CacheService.getWorkspaceStateKey() instead of context.workspaceState.get().\n" +
|
||||
"The CacheService provides fast in-memory access with automatic persistence.\n" +
|
||||
"Example: cacheService.getWorkspaceStateKey('myKey') instead of context.workspaceState.get('myKey').\n" +
|
||||
"Found: {{code}}",
|
||||
useCacheServiceWorkspaceSet:
|
||||
"Use CacheService.setWorkspaceState() instead of context.workspaceState.update().\n" +
|
||||
"The CacheService provides immediate updates with debounced persistence.\n" +
|
||||
"Example: cacheService.setWorkspaceState('myKey', value) instead of context.workspaceState.update('myKey', value).\n" +
|
||||
"Found: {{code}}",
|
||||
useCacheServiceSecretsGet:
|
||||
"Use CacheService.getSecretKey() instead of context.secrets.get().\n" +
|
||||
"The CacheService provides fast in-memory access with automatic persistence.\n" +
|
||||
"Example: cacheService.getSecretKey('mySecret') instead of context.secrets.get('mySecret').\n" +
|
||||
"Found: {{code}}",
|
||||
useCacheServiceSecretsSet:
|
||||
"Use CacheService.setSecret() instead of context.secrets.store() or context.secrets.delete().\n" +
|
||||
"The CacheService provides immediate updates with debounced persistence.\n" +
|
||||
"Example: cacheService.setSecret('mySecret', value) instead of context.secrets.store('mySecret', value).\n" +
|
||||
"For deletion, use: cacheService.setSecret('mySecret', undefined).\n" +
|
||||
"Found: {{code}}",
|
||||
},
|
||||
schema: [],
|
||||
},
|
||||
defaultOptions: [],
|
||||
|
||||
create(context) {
|
||||
function isExcluded(filename) {
|
||||
// Skip checking test files
|
||||
if (filename.endsWith(".test.ts")) {
|
||||
return true
|
||||
}
|
||||
// Skip checking specific state-related files that need direct access
|
||||
const basename = path.basename(filename)
|
||||
if (
|
||||
basename === "CacheService.ts" ||
|
||||
basename === "state-helpers.ts" ||
|
||||
basename === "state-migrations.ts" ||
|
||||
basename === "extension.ts" ||
|
||||
basename === "common.ts" // CI might report errors from this virtual file
|
||||
) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Check for context-based state API calls
|
||||
function checkContextStateApi(node) {
|
||||
if (isExcluded(context.filename)) {
|
||||
return
|
||||
}
|
||||
|
||||
// Check if this is a member expression like context.globalState.get
|
||||
if (
|
||||
node.type === "MemberExpression" &&
|
||||
node.object &&
|
||||
node.object.type === "MemberExpression" &&
|
||||
node.object.object &&
|
||||
node.object.object.type === "Identifier" &&
|
||||
node.object.object.name === "context"
|
||||
) {
|
||||
const stateType = node.object.property.name // e.g., "globalState", "workspaceState", "secrets"
|
||||
const method = node.property.name // e.g., "get", "update", "store", "delete"
|
||||
const apiPath = `${stateType}.${method}`
|
||||
|
||||
if (disallowedContextApis[apiPath]) {
|
||||
// For method calls, get the whole call expression
|
||||
let reportNode = node
|
||||
let parentNode = context.sourceCode.getAncestors(node).pop()
|
||||
if (parentNode && parentNode.type === "CallExpression" && parentNode.callee === node) {
|
||||
reportNode = parentNode
|
||||
}
|
||||
|
||||
const callText = context.sourceCode.getText(reportNode).trim()
|
||||
|
||||
context.report({
|
||||
node: reportNode,
|
||||
messageId: disallowedContextApis[apiPath].messageId,
|
||||
data: {
|
||||
code: callText,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
// Detect member expressions (e.g., context.globalState.get)
|
||||
MemberExpression(node) {
|
||||
checkContextStateApi(node)
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
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"]
|
||||
}
|
||||
@@ -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
+602
-1244
File diff suppressed because it is too large
Load Diff
+16
-26
@@ -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.25.3",
|
||||
"version": "3.27.0",
|
||||
"icon": "assets/icons/icon.png",
|
||||
"engines": {
|
||||
"vscode": "^1.84.0"
|
||||
@@ -102,15 +102,8 @@
|
||||
"activitybar": [
|
||||
{
|
||||
"id": "claude-dev-ActivityBar",
|
||||
"title": "Cline (⌘+')",
|
||||
"icon": "assets/icons/icon.svg",
|
||||
"when": "isMac"
|
||||
},
|
||||
{
|
||||
"id": "claude-dev-ActivityBar",
|
||||
"title": "Cline (Ctrl+')",
|
||||
"icon": "assets/icons/icon.svg",
|
||||
"when": "!isMac"
|
||||
"title": "Cline",
|
||||
"icon": "assets/icons/icon.svg"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -347,14 +340,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",
|
||||
@@ -368,8 +362,8 @@
|
||||
"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",
|
||||
@@ -380,10 +374,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",
|
||||
@@ -398,23 +393,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",
|
||||
@@ -430,10 +419,12 @@
|
||||
"@anthropic-ai/vertex-sdk": "^0.6.4",
|
||||
"@aws-sdk/client-bedrock-runtime": "^3.840.0",
|
||||
"@aws-sdk/credential-providers": "^3.840.0",
|
||||
"@sap-ai-sdk/ai-api": "^1.17.0",
|
||||
"@sap-ai-sdk/orchestration": "^1.17.0",
|
||||
"@bufbuild/protobuf": "^2.2.5",
|
||||
"@cerebras/cerebras_cloud_sdk": "^1.35.0",
|
||||
"@google-cloud/vertexai": "^1.9.3",
|
||||
"@google/genai": "1.0.0",
|
||||
"@google/genai": "^1.11.0",
|
||||
"@grpc/grpc-js": "^1.9.15",
|
||||
"@grpc/reflection": "^1.0.4",
|
||||
"@mistralai/mistralai": "^1.5.0",
|
||||
@@ -472,7 +463,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",
|
||||
@@ -482,7 +472,7 @@
|
||||
"p-timeout": "^6.1.4",
|
||||
"p-wait-for": "^5.0.2",
|
||||
"pdf-parse": "^1.1.1",
|
||||
"posthog-node": "^4.8.1",
|
||||
"posthog-node": "^5.8.0",
|
||||
"puppeteer-chromium-resolver": "^23.0.0",
|
||||
"puppeteer-core": "^23.4.0",
|
||||
"reconnecting-eventsource": "^1.6.4",
|
||||
|
||||
+60
-24
@@ -19,6 +19,8 @@ service ModelsService {
|
||||
rpc refreshHuggingFaceModels(EmptyRequest) returns (OpenRouterCompatibleModelInfo);
|
||||
// Refreshes and returns OpenAI models
|
||||
rpc refreshOpenAiModels(OpenAiModelsRequest) returns (StringArray);
|
||||
// Refreshes and returns Vercel AI Gateway models
|
||||
rpc refreshVercelAiGatewayModels(EmptyRequest) returns (OpenRouterCompatibleModelInfo);
|
||||
// Refreshes and returns Requesty models
|
||||
rpc refreshRequestyModels(EmptyRequest) returns (OpenRouterCompatibleModelInfo);
|
||||
// Subscribe to OpenRouter models updates
|
||||
@@ -29,6 +31,8 @@ service ModelsService {
|
||||
rpc refreshGroqModels(EmptyRequest) returns (OpenRouterCompatibleModelInfo);
|
||||
// Refreshes and returns Baseten models
|
||||
rpc refreshBasetenModels(EmptyRequest) returns (OpenRouterCompatibleModelInfo);
|
||||
// Fetches available models from SAP AI Core
|
||||
rpc getSapAiCoreModels(SapAiCoreModelsRequest) returns (SapAiCoreModelsResponse);
|
||||
}
|
||||
|
||||
// List of VS Code LM models
|
||||
@@ -46,20 +50,20 @@ message LanguageModelChatSelector {
|
||||
|
||||
// Price tier for tiered pricing models
|
||||
message PriceTier {
|
||||
int32 token_limit = 1; // Upper limit (inclusive) of input tokens for this price
|
||||
int64 token_limit = 1; // Upper limit (inclusive) of input tokens for this price
|
||||
double price = 2; // Price per million tokens for this tier
|
||||
}
|
||||
|
||||
// Thinking configuration for models that support thinking/reasoning
|
||||
message ThinkingConfig {
|
||||
optional int32 max_budget = 1; // Max allowed thinking budget tokens
|
||||
optional int64 max_budget = 1; // Max allowed thinking budget tokens
|
||||
optional double output_price = 2; // Output price per million tokens when budget > 0
|
||||
repeated PriceTier output_price_tiers = 3; // Optional: Tiered output price when budget > 0
|
||||
}
|
||||
|
||||
// Model tier for tiered pricing structures
|
||||
message ModelTier {
|
||||
int32 context_window = 1;
|
||||
int64 context_window = 1;
|
||||
optional double input_price = 2;
|
||||
optional double output_price = 3;
|
||||
optional double cache_writes_price = 4;
|
||||
@@ -68,8 +72,8 @@ message ModelTier {
|
||||
|
||||
// For OpenRouterCompatibleModelInfo structure in OpenRouterModels
|
||||
message OpenRouterModelInfo {
|
||||
optional int32 max_tokens = 1;
|
||||
optional int32 context_window = 2;
|
||||
optional int64 max_tokens = 1;
|
||||
optional int64 context_window = 2;
|
||||
optional bool supports_images = 3;
|
||||
bool supports_prompt_cache = 4;
|
||||
optional double input_price = 5;
|
||||
@@ -94,6 +98,22 @@ message OpenAiModelsRequest {
|
||||
string api_key = 3;
|
||||
}
|
||||
|
||||
// Request for fetching SAP AI Core models
|
||||
message SapAiCoreModelsRequest {
|
||||
Metadata metadata = 1;
|
||||
string client_id = 2;
|
||||
string client_secret = 3;
|
||||
string base_url = 4;
|
||||
string token_url = 5;
|
||||
string resource_group = 6;
|
||||
}
|
||||
|
||||
// Response for SAP AI Core models with orchestration availability
|
||||
message SapAiCoreModelsResponse {
|
||||
repeated string model_names = 1;
|
||||
bool orchestration_available = 2;
|
||||
}
|
||||
|
||||
// Request for updating API configuration
|
||||
message UpdateApiConfigurationRequest {
|
||||
Metadata metadata = 1;
|
||||
@@ -133,12 +153,16 @@ enum ApiProvider {
|
||||
HUGGINGFACE = 28;
|
||||
HUAWEI_CLOUD_MAAS = 29;
|
||||
BASETEN = 30;
|
||||
ZAI = 31;
|
||||
VERCEL_AI_GATEWAY = 32;
|
||||
QWEN_CODE = 33;
|
||||
DIFY = 34;
|
||||
}
|
||||
|
||||
// Model info for OpenAI-compatible models
|
||||
message OpenAiCompatibleModelInfo {
|
||||
optional int32 max_tokens = 1;
|
||||
optional int32 context_window = 2;
|
||||
optional int64 max_tokens = 1;
|
||||
optional int64 context_window = 2;
|
||||
optional bool supports_images = 3;
|
||||
bool supports_prompt_cache = 4;
|
||||
optional double input_price = 5;
|
||||
@@ -155,8 +179,8 @@ message OpenAiCompatibleModelInfo {
|
||||
|
||||
// Model info for LiteLLM models
|
||||
message LiteLLMModelInfo {
|
||||
optional int32 max_tokens = 1;
|
||||
optional int32 context_window = 2;
|
||||
optional int64 max_tokens = 1;
|
||||
optional int64 context_window = 2;
|
||||
optional bool supports_images = 3;
|
||||
bool supports_prompt_cache = 4;
|
||||
optional double input_price = 5;
|
||||
@@ -208,8 +232,8 @@ message ModelsApiConfiguration {
|
||||
optional string requesty_base_url = 33;
|
||||
optional string together_api_key = 34;
|
||||
optional string fireworks_api_key = 35;
|
||||
optional int32 fireworks_model_max_completion_tokens = 36;
|
||||
optional int32 fireworks_model_max_tokens = 37;
|
||||
optional int64 fireworks_model_max_completion_tokens = 36;
|
||||
optional int64 fireworks_model_max_tokens = 37;
|
||||
optional string qwen_api_key = 38;
|
||||
optional string doubao_api_key = 39;
|
||||
optional string mistral_api_key = 40;
|
||||
@@ -221,27 +245,35 @@ message ModelsApiConfiguration {
|
||||
optional string xai_api_key = 46;
|
||||
optional string sambanova_api_key = 47;
|
||||
optional string cerebras_api_key = 48;
|
||||
optional int32 request_timeout_ms = 49;
|
||||
optional int64 request_timeout_ms = 49;
|
||||
optional string sap_ai_core_client_id = 50;
|
||||
optional string sap_ai_core_client_secret = 51;
|
||||
optional string sap_ai_resource_group = 52;
|
||||
optional string sap_ai_core_token_url = 53;
|
||||
optional string sap_ai_core_base_url = 54;
|
||||
optional string moonshot_api_key = 55;
|
||||
optional string moonshot_api_line = 56;
|
||||
optional string aws_authentication = 57;
|
||||
optional string aws_bedrock_api_key = 58;
|
||||
optional string cline_account_id = 59;
|
||||
optional string groq_api_key = 60;
|
||||
optional string hugging_face_api_key = 61;
|
||||
optional string huawei_cloud_maas_api_key = 62;
|
||||
optional string baseten_api_key = 63;
|
||||
optional string ollama_api_key = 64;
|
||||
optional bool sap_ai_core_use_orchestration_mode = 55;
|
||||
optional string moonshot_api_key = 56;
|
||||
optional string moonshot_api_line = 57;
|
||||
optional string aws_authentication = 58;
|
||||
optional string aws_bedrock_api_key = 59;
|
||||
optional string cline_account_id = 60;
|
||||
optional string groq_api_key = 61;
|
||||
optional string hugging_face_api_key = 62;
|
||||
optional string huawei_cloud_maas_api_key = 63;
|
||||
optional string baseten_api_key = 64;
|
||||
optional string ollama_api_key = 65;
|
||||
optional string zai_api_key = 66;
|
||||
optional string zai_api_line = 67;
|
||||
optional string lm_studio_max_tokens = 68;
|
||||
optional string vercel_ai_gateway_api_key = 69;
|
||||
optional string qwen_code_oauth_path = 70;
|
||||
optional string dify_api_key = 71;
|
||||
optional string dify_base_url = 72;
|
||||
|
||||
// Plan mode configurations
|
||||
optional ApiProvider plan_mode_api_provider = 100;
|
||||
optional string plan_mode_api_model_id = 101;
|
||||
optional int32 plan_mode_thinking_budget_tokens = 102;
|
||||
optional int64 plan_mode_thinking_budget_tokens = 102;
|
||||
optional string plan_mode_reasoning_effort = 103;
|
||||
optional LanguageModelChatSelector plan_mode_vs_code_lm_model_selector = 104;
|
||||
optional bool plan_mode_aws_bedrock_custom_selected = 105;
|
||||
@@ -267,11 +299,13 @@ message ModelsApiConfiguration {
|
||||
optional OpenRouterModelInfo plan_mode_huawei_cloud_maas_model_info = 125;
|
||||
optional string plan_mode_baseten_model_id = 126;
|
||||
optional OpenRouterModelInfo plan_mode_baseten_model_info = 127;
|
||||
optional string plan_mode_vercel_ai_gateway_model_id = 128;
|
||||
optional OpenRouterModelInfo plan_mode_vercel_ai_gateway_model_info = 129;
|
||||
|
||||
// Act mode configurations
|
||||
optional ApiProvider act_mode_api_provider = 200;
|
||||
optional string act_mode_api_model_id = 201;
|
||||
optional int32 act_mode_thinking_budget_tokens = 202;
|
||||
optional int64 act_mode_thinking_budget_tokens = 202;
|
||||
optional string act_mode_reasoning_effort = 203;
|
||||
optional LanguageModelChatSelector act_mode_vs_code_lm_model_selector = 204;
|
||||
optional bool act_mode_aws_bedrock_custom_selected = 205;
|
||||
@@ -297,6 +331,8 @@ message ModelsApiConfiguration {
|
||||
optional OpenRouterModelInfo act_mode_huawei_cloud_maas_model_info = 225;
|
||||
optional string act_mode_baseten_model_id = 226;
|
||||
optional OpenRouterModelInfo act_mode_baseten_model_info = 227;
|
||||
optional string act_mode_vercel_ai_gateway_model_id = 228;
|
||||
optional OpenRouterModelInfo act_mode_vercel_ai_gateway_model_info = 229;
|
||||
|
||||
repeated string favorited_model_ids = 300;
|
||||
}
|
||||
|
||||
@@ -124,6 +124,8 @@ message UpdateSettingsRequest {
|
||||
optional OpenaiReasoningEffort openai_reasoning_effort = 15;
|
||||
optional bool strict_plan_mode_enabled = 16;
|
||||
optional FocusChainSettings focus_chain_settings = 17;
|
||||
optional bool use_auto_condense = 18;
|
||||
optional string custom_prompt = 19;
|
||||
}
|
||||
|
||||
// Complete API Configuration message
|
||||
@@ -187,6 +189,13 @@ message ApiConfiguration {
|
||||
optional string moonshot_api_line = 56;
|
||||
optional string huawei_cloud_maas_api_key = 57;
|
||||
optional string ollama_api_key = 58;
|
||||
optional string zai_api_key = 59;
|
||||
optional string zai_api_line = 60;
|
||||
optional string lm_studio_max_tokens = 61;
|
||||
optional string vercel_ai_gateway_api_key = 62;
|
||||
optional string qwen_code_oauth_path = 63;
|
||||
optional string dify_api_key = 64;
|
||||
optional string dify_base_url = 65;
|
||||
|
||||
// Plan mode configurations
|
||||
optional string plan_mode_api_provider = 100;
|
||||
@@ -211,6 +220,8 @@ message ApiConfiguration {
|
||||
optional string plan_mode_sap_ai_core_model_id = 119;
|
||||
optional string plan_mode_huawei_cloud_maas_model_id = 120;
|
||||
optional string plan_mode_huawei_cloud_maas_model_info = 121;
|
||||
optional string plan_mode_vercel_ai_gateway_model_id = 122;
|
||||
optional string plan_mode_vercel_ai_gateway_model_info = 123;
|
||||
|
||||
// Act mode configurations
|
||||
optional string act_mode_api_provider = 200;
|
||||
@@ -235,6 +246,8 @@ message ApiConfiguration {
|
||||
optional string act_mode_sap_ai_core_model_id = 219;
|
||||
optional string act_mode_huawei_cloud_maas_model_id = 220;
|
||||
optional string act_mode_huawei_cloud_maas_model_info = 221;
|
||||
optional string act_mode_vercel_ai_gateway_model_id = 222;
|
||||
optional string act_mode_vercel_ai_gateway_model_info = 223;
|
||||
|
||||
// Favorited model IDs
|
||||
repeated string favorited_model_ids = 300;
|
||||
|
||||
@@ -249,9 +249,6 @@ service UiService {
|
||||
// Subscribe to partial message updates (streaming Cline messages as they're built)
|
||||
rpc subscribeToPartialMessage(EmptyRequest) returns (stream ClineMessage);
|
||||
|
||||
// Subscribe to theme change events
|
||||
rpc subscribeToTheme(EmptyRequest) returns (stream String);
|
||||
|
||||
// Initialize webview when it launches
|
||||
rpc initializeWebview(EmptyRequest) returns (Empty);
|
||||
|
||||
|
||||
@@ -16,4 +16,13 @@ service EnvService {
|
||||
|
||||
// Returns a stable machine identifier for telemetry distinctId purposes.
|
||||
rpc getMachineId(cline.EmptyRequest) returns (cline.String);
|
||||
|
||||
rpc getHostVersion(cline.EmptyRequest) returns (GetHostVersionResponse);
|
||||
}
|
||||
|
||||
message GetHostVersionResponse {
|
||||
// The name of the host platform, e.g VSCode
|
||||
optional string platform = 1;
|
||||
// The version of the host platform, e.g. 1.103.0
|
||||
optional string version = 2;
|
||||
}
|
||||
|
||||
+53
-21
@@ -8,15 +8,35 @@ import "cline/common.proto";
|
||||
|
||||
// Provides methods for working with IDE windows and editors.
|
||||
service WindowService {
|
||||
// Opens a text document in the editor and returns editor information.
|
||||
// Opens a text document in the IDE editor and returns editor information.
|
||||
rpc showTextDocument(ShowTextDocumentRequest) returns (TextEditorInfo);
|
||||
|
||||
// Shows the open file dialogue / file picker.
|
||||
rpc showOpenDialogue(ShowOpenDialogueRequest) returns (SelectedResources);
|
||||
|
||||
// Shows a notification.
|
||||
rpc showMessage(ShowMessageRequest) returns (SelectedResponse);
|
||||
|
||||
// Prompts the user for input and returns the response.
|
||||
rpc showInputBox(ShowInputBoxRequest) returns (ShowInputBoxResponse);
|
||||
|
||||
// Shows the file save dialogue / file picker.
|
||||
rpc showSaveDialog(ShowSaveDialogRequest) returns (ShowSaveDialogResponse);
|
||||
|
||||
// Opens a file in the IDE.
|
||||
rpc openFile(OpenFileRequest) returns (OpenFileResponse);
|
||||
|
||||
// Opens the host settings UI, optionally focusing a specific query/section.
|
||||
rpc openSettings(OpenSettingsRequest) returns (OpenSettingsResponse);
|
||||
|
||||
// Returns the open tabs.
|
||||
rpc getOpenTabs(GetOpenTabsRequest) returns (GetOpenTabsResponse);
|
||||
|
||||
// Returns the visible tabs.
|
||||
rpc getVisibleTabs(GetVisibleTabsRequest) returns (GetVisibleTabsResponse);
|
||||
|
||||
// Returns information about the current editor
|
||||
rpc getActiveEditor(GetActiveEditorRequest) returns (GetActiveEditorResponse);
|
||||
}
|
||||
|
||||
message ShowTextDocumentRequest {
|
||||
@@ -60,10 +80,9 @@ enum ShowMessageType {
|
||||
}
|
||||
|
||||
message ShowMessageRequest {
|
||||
cline.Metadata metadata = 1;
|
||||
ShowMessageType type = 2;
|
||||
string message = 3;
|
||||
optional ShowMessageRequestOptions options = 4;
|
||||
ShowMessageType type = 1;
|
||||
string message = 2;
|
||||
optional ShowMessageRequestOptions options = 3;
|
||||
}
|
||||
|
||||
message ShowMessageRequestOptions {
|
||||
@@ -78,8 +97,7 @@ message SelectedResponse {
|
||||
}
|
||||
|
||||
message ShowSaveDialogRequest {
|
||||
cline.Metadata metadata = 1;
|
||||
optional ShowSaveDialogOptions options = 2;
|
||||
optional ShowSaveDialogOptions options = 1;
|
||||
}
|
||||
|
||||
message ShowSaveDialogOptions {
|
||||
@@ -90,6 +108,7 @@ message ShowSaveDialogOptions {
|
||||
}
|
||||
|
||||
message FileExtensionList {
|
||||
// A list of file extension (without the dot).
|
||||
repeated string extensions = 1;
|
||||
}
|
||||
|
||||
@@ -99,10 +118,9 @@ message ShowSaveDialogResponse {
|
||||
}
|
||||
|
||||
message ShowInputBoxRequest {
|
||||
cline.Metadata metadata = 1;
|
||||
string title = 2;
|
||||
optional string prompt = 3;
|
||||
optional string value = 4;
|
||||
string title = 1;
|
||||
optional string prompt = 2;
|
||||
optional string value = 3;
|
||||
}
|
||||
|
||||
message ShowInputBoxResponse {
|
||||
@@ -110,26 +128,40 @@ message ShowInputBoxResponse {
|
||||
}
|
||||
|
||||
message OpenFileRequest {
|
||||
cline.Metadata metadata = 1;
|
||||
string file_path = 2;
|
||||
string file_path = 1;
|
||||
}
|
||||
|
||||
message OpenFileResponse {
|
||||
// empty
|
||||
message OpenFileResponse {}
|
||||
|
||||
message OpenSettingsRequest {
|
||||
// Optional query to focus a particular settings section/key.
|
||||
// This value is host-specific. In VS Code, it is passed directly as the
|
||||
// Settings search query to the "workbench.action.openSettings" command.
|
||||
// Examples (VS Code, see - https://code.visualstudio.com/docs/getstarted/settings#settings-editor-filters.):
|
||||
// - "telemetry.telemetryLevel" → focuses the Telemetry Level setting
|
||||
// - "@id:telemetry.telemetryLevel" → navigates by exact setting id
|
||||
// - "@modified", "@ext:publisher.extension"
|
||||
// - Plain keywords/categories
|
||||
// If not provided the host opens the settings UI without specific focus.
|
||||
optional string query = 1;
|
||||
}
|
||||
|
||||
message GetOpenTabsRequest {
|
||||
// empty
|
||||
}
|
||||
message OpenSettingsResponse {}
|
||||
|
||||
message GetOpenTabsRequest {}
|
||||
|
||||
message GetOpenTabsResponse {
|
||||
repeated string paths = 1;
|
||||
}
|
||||
|
||||
message GetVisibleTabsRequest {
|
||||
// empty
|
||||
}
|
||||
message GetVisibleTabsRequest {}
|
||||
|
||||
message GetVisibleTabsResponse {
|
||||
repeated string paths = 1;
|
||||
}
|
||||
|
||||
message GetActiveEditorRequest {}
|
||||
|
||||
message GetActiveEditorResponse {
|
||||
optional string file_path = 1;
|
||||
}
|
||||
|
||||
@@ -10,12 +10,25 @@ import "cline/common.proto";
|
||||
service WorkspaceService {
|
||||
// Returns a list of the top level directories of the workspace.
|
||||
rpc getWorkspacePaths(GetWorkspacePathsRequest) returns (GetWorkspacePathsResponse);
|
||||
|
||||
// Saves an open document if it's open in the editor and has unsaved changes.
|
||||
// Returns true if the document was saved, returns false if the document was not found, or did not
|
||||
// need to be saved.
|
||||
rpc saveOpenDocumentIfDirty(SaveOpenDocumentIfDirtyRequest) returns (SaveOpenDocumentIfDirtyResponse);
|
||||
|
||||
// Get diagnostics from the workspace.
|
||||
rpc getDiagnostics(GetDiagnosticsRequest) returns (GetDiagnosticsResponse);
|
||||
// Returns workspace items (files/folders) matching a query for mention autocomplete
|
||||
rpc searchWorkspaceItems(SearchWorkspaceItemsRequest) returns (SearchWorkspaceItemsResponse);
|
||||
|
||||
// Makes the problems panel/pane visible in the IDE and focuses it.
|
||||
rpc openProblemsPanel(OpenProblemsPanelRequest) returns (OpenProblemsPanelResponse);
|
||||
|
||||
// Opens the IDE file explorer panel and selects a file or directory.
|
||||
rpc openInFileExplorerPanel(OpenInFileExplorerPanelRequest) returns (OpenInFileExplorerPanelResponse);
|
||||
|
||||
// Opens and focuses the Cline sidebar panel in the host IDE.
|
||||
rpc openClineSidebarPanel(OpenClineSidebarPanelRequest) returns (OpenClineSidebarPanelResponse);
|
||||
}
|
||||
|
||||
message GetWorkspacePathsRequest {
|
||||
@@ -46,3 +59,37 @@ message GetDiagnosticsRequest {
|
||||
message GetDiagnosticsResponse {
|
||||
repeated cline.FileDiagnostics file_diagnostics = 1;
|
||||
}
|
||||
|
||||
// Request for host-side workspace search (files/folders) used by mentions autocomplete
|
||||
message SearchWorkspaceItemsRequest {
|
||||
string query = 1; // Search query string
|
||||
optional int32 limit = 2; // Optional limit for results (default decided by host)
|
||||
// Optional selected type filter
|
||||
enum SearchItemType {
|
||||
FILE = 0;
|
||||
FOLDER = 1;
|
||||
}
|
||||
optional SearchItemType selected_type = 3;
|
||||
}
|
||||
|
||||
// Response for host-side workspace search
|
||||
message SearchWorkspaceItemsResponse {
|
||||
message SearchItem {
|
||||
string path = 1; // Workspace-relative path using platform separators
|
||||
SearchWorkspaceItemsRequest.SearchItemType type = 2;
|
||||
optional string label = 3; // Optional display label (e.g., basename)
|
||||
}
|
||||
repeated SearchItem items = 1;
|
||||
}
|
||||
|
||||
message OpenProblemsPanelRequest {}
|
||||
message OpenProblemsPanelResponse {}
|
||||
|
||||
message OpenInFileExplorerPanelRequest {
|
||||
string path = 1;
|
||||
}
|
||||
message OpenInFileExplorerPanelResponse {}
|
||||
|
||||
// Request/response for opening the Cline sidebar
|
||||
message OpenClineSidebarPanelRequest {}
|
||||
message OpenClineSidebarPanelResponse {}
|
||||
|
||||
@@ -8,8 +8,8 @@ import { createRequire } from "module"
|
||||
import os from "os"
|
||||
import * as path from "path"
|
||||
import { rmrf } from "./file-utils.mjs"
|
||||
import { main as generateProtoBusSetup } from "./generate-protobus-setup.mjs"
|
||||
import { main as generateHostBridgeClient } from "./generate-host-bridge-client.mjs"
|
||||
import { main as generateProtoBusSetup } from "./generate-protobus-setup.mjs"
|
||||
import { loadProtoDescriptorSet } from "./proto-utils.mjs"
|
||||
|
||||
const require = createRequire(import.meta.url)
|
||||
@@ -181,7 +181,7 @@ function checkAppleSiliconCompatibility() {
|
||||
console.log(chalk.red("Aborting build process."))
|
||||
process.exit(1)
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (_error) {
|
||||
console.log(chalk.yellow("Could not determine Rosetta installation status. Proceeding anyway."))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { writeFileWithMkdirs } from "./file-utils.mjs"
|
||||
import * as path from "path"
|
||||
import chalk from "chalk"
|
||||
import { loadServicesFromProtoDescriptor, getFqn } from "./proto-utils.mjs"
|
||||
import * as path from "path"
|
||||
import { writeFileWithMkdirs } from "./file-utils.mjs"
|
||||
import { getFqn, loadServicesFromProtoDescriptor } from "./proto-utils.mjs"
|
||||
|
||||
// Contains the interface definitions for the host bridge clients.
|
||||
const TYPES_FILE = path.resolve("src/generated/hosts/host-bridge-client-types.ts")
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { writeFileWithMkdirs } from "./file-utils.mjs"
|
||||
import path from "path"
|
||||
import { fileURLToPath } from "url"
|
||||
import { loadServicesFromProtoDescriptor, getFqn } from "./proto-utils.mjs"
|
||||
import { writeFileWithMkdirs } from "./file-utils.mjs"
|
||||
import { getFqn, loadServicesFromProtoDescriptor } from "./proto-utils.mjs"
|
||||
|
||||
const WEBVIEW_CLIENTS_FILE = path.resolve("webview-ui/src/services/grpc-client.ts")
|
||||
const VSCODE_SERVICES_FILE = path.resolve("src/generated/hosts/vscode/protobus-services.ts")
|
||||
@@ -55,7 +55,7 @@ ${rpcs.join("\n")}
|
||||
}
|
||||
|
||||
// Create output file
|
||||
let output = `// GENERATED CODE -- DO NOT EDIT!
|
||||
const output = `// GENERATED CODE -- DO NOT EDIT!
|
||||
// Generated by ${SCRIPT_NAME}
|
||||
import * as proto from "@shared/proto/index"
|
||||
import { ProtoBusClient, Callbacks } from "./grpc-client-base"
|
||||
@@ -94,7 +94,7 @@ async function generateVscodeServiceTypes(protobusServices) {
|
||||
}
|
||||
|
||||
// Create output file
|
||||
let output = `// GENERATED CODE -- DO NOT EDIT!
|
||||
const output = `// GENERATED CODE -- DO NOT EDIT!
|
||||
// Generated by ${SCRIPT_NAME}
|
||||
import * as proto from "@shared/proto/index"
|
||||
import { Controller } from "@core/controller"
|
||||
@@ -128,7 +128,7 @@ async function generateVscodeProtobusServers(protobusServices) {
|
||||
}
|
||||
|
||||
// Create output file
|
||||
let output = `// GENERATED CODE -- DO NOT EDIT!
|
||||
const output = `// GENERATED CODE -- DO NOT EDIT!
|
||||
// Generated by ${SCRIPT_NAME}
|
||||
import * as serviceTypes from "src/generated/hosts/vscode/protobus-service-types"
|
||||
|
||||
@@ -176,7 +176,7 @@ async function generateStandaloneProtobusServiceSetup(protobusServices) {
|
||||
}
|
||||
|
||||
// Create output file
|
||||
let output = `// GENERATED CODE -- DO NOT EDIT!
|
||||
const output = `// GENERATED CODE -- DO NOT EDIT!
|
||||
// Generated by ${SCRIPT_NAME}
|
||||
import * as grpc from "@grpc/grpc-js"
|
||||
import { cline } from "@generated/grpc-js"
|
||||
|
||||
@@ -37,7 +37,7 @@ function traverse(container, output, prefix = "") {
|
||||
const name = decl.getName()
|
||||
output.push(`${prefix}.${name} = createStub("${prefix}.${name}");`)
|
||||
}
|
||||
} else if (kind == SyntaxKind.ClassDeclaration) {
|
||||
} else if (kind === SyntaxKind.ClassDeclaration) {
|
||||
const name = node.getName()
|
||||
output.push(
|
||||
`${prefix}.${name} = class { constructor(...args) {
|
||||
@@ -55,13 +55,27 @@ function traverse(container, output, prefix = "") {
|
||||
}
|
||||
|
||||
function mapReturn(typeStr) {
|
||||
if (!typeStr) return ""
|
||||
if (typeStr.includes("void")) return ""
|
||||
if (typeStr.includes("string")) return `return '';`
|
||||
if (typeStr.includes("number")) return `return 0;`
|
||||
if (typeStr.includes("boolean")) return `return false;`
|
||||
if (typeStr.includes("[]")) return `return [];`
|
||||
if (typeStr.includes("Thenable")) return `return Promise.resolve(null);`
|
||||
if (!typeStr) {
|
||||
return ""
|
||||
}
|
||||
if (typeStr.includes("void")) {
|
||||
return ""
|
||||
}
|
||||
if (typeStr.includes("string")) {
|
||||
return `return '';`
|
||||
}
|
||||
if (typeStr.includes("number")) {
|
||||
return `return 0;`
|
||||
}
|
||||
if (typeStr.includes("boolean")) {
|
||||
return `return false;`
|
||||
}
|
||||
if (typeStr.includes("[]")) {
|
||||
return `return [];`
|
||||
}
|
||||
if (typeStr.includes("Thenable")) {
|
||||
return `return Promise.resolve(null);`
|
||||
}
|
||||
return `return createStub("unknown");`
|
||||
}
|
||||
|
||||
|
||||
@@ -1,25 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
DIR=${1:-src/}
|
||||
FILES=$(git ls-files src|grep -v test|grep -v vscode|grep -v extension.ts|grep -v evals|grep -v standalone|grep -v /dev/)
|
||||
DEST_DIR=dist-standalone
|
||||
SDK_DEST=$DEST_DIR/vscode-sdk-uses.txt
|
||||
CSS_DEST=$DEST_DIR/vscode-css-uses.txt
|
||||
TMP=/tmp/vscode-sdk-uses.txt.tmp
|
||||
mkdir -p $DEST_DIR
|
||||
|
||||
if [[ ${1:-} == "-v" ]]; then
|
||||
grep -Er --color=always 'vscode[?]?\.' $FILES
|
||||
fi
|
||||
|
||||
{
|
||||
git grep -h 'vscode\.' $DIR |
|
||||
grep -Ev '//.*vscode' | # remove commented out code
|
||||
grep -v vscode.commands.executeCommand | # executeCommand is handled separately
|
||||
grep -Ev '"vscode' | # remove command strings that get included because they start with vscode
|
||||
sed 's|.*vscode\.|vscode.|'| # remove everything before vscode.
|
||||
sed 's/[^a-zA-Z0-9_.].*$//' | # remove everything after last identifier
|
||||
grep -E '\.[a-z][^.]+$' | # remove types (last part of identifier should be lowercase)
|
||||
cat > $TMP
|
||||
grep -Ehr 'vscode[?]?\.' $FILES |
|
||||
grep -Ev '//.*vscode' | # remove commented out code
|
||||
grep -v vscode.commands.executeCommand | # executeCommand is handled separately
|
||||
#grep -Ev '"vscode' | # remove command strings that get included because they start with vscode
|
||||
sed 's|.*vscode|vscode|'| # remove everything before vscode.
|
||||
sed 's|?||g' | # remove ? from vcode?.env?.foo
|
||||
sed 's/[^a-zA-Z0-9_.?].*$//' | # remove everything after last identifier
|
||||
grep -E '\.[a-z][^.]+$' | # remove types (last part of identifier should be lowercase)
|
||||
cat > $TMP
|
||||
}
|
||||
{
|
||||
grep -rh vscode.commands.executeCommand $DIR |
|
||||
grep -hr 'vscode.commands.executeCommand' $FILES |
|
||||
perl -ne 'print if /["\x27"]/' | # Remove occurrences where the command is not on the same line (line doesnt contain quote chars) :(
|
||||
sed -n 's|.*\(vscode.commands.executeCommand[^,]*\).*|\1|p'| # Remove all params after the first one
|
||||
sed 's|\(".*"\).*|\1)|'| # Close the parantheses
|
||||
@@ -40,4 +45,3 @@ sed 's/[),"\\].*$//' | # remove from the end of the var name to the end of the l
|
||||
sort | uniq > $CSS_DEST
|
||||
}
|
||||
echo Wrote vscode vars used to $(realpath $CSS_DEST)
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import { cp } from "fs/promises"
|
||||
import { glob } from "glob"
|
||||
import minimatch from "minimatch"
|
||||
import path from "path"
|
||||
|
||||
const BUILD_DIR = "dist-standalone"
|
||||
const RUNTIME_DEPS_DIR = "standalone/runtime-files"
|
||||
|
||||
@@ -104,6 +105,7 @@ function createIsIgnored(standaloneIgnores) {
|
||||
".eslintrc*",
|
||||
".babelrc*",
|
||||
".prettierrc*",
|
||||
"biome.json*",
|
||||
".cz-config.js",
|
||||
".commitlintrc*",
|
||||
"webpack.config.js",
|
||||
@@ -140,7 +142,13 @@ function createIsIgnored(standaloneIgnores) {
|
||||
|
||||
// Combine with default ignore list
|
||||
// Also ignore the dist directory- the build directory for the extension.
|
||||
const allIgnore = [...defaultIgnore, ...expandedIgnore, ...standaloneIgnores]
|
||||
let allIgnore = [...defaultIgnore, ...expandedIgnore, ...standaloneIgnores]
|
||||
|
||||
// Map files need to be included in the debug build. Remove .map ignores when IS_DEBUG_BUILD is set
|
||||
if (process.env.IS_DEBUG_BUILD) {
|
||||
allIgnore = allIgnore.filter((pattern) => !pattern.endsWith(".map"))
|
||||
console.log("Debug build: Including .map files in package")
|
||||
}
|
||||
|
||||
// Split into ignore and negate list
|
||||
const [ignore, negate] = allIgnore.reduce(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import * as fs from "fs/promises"
|
||||
import * as path from "path"
|
||||
import * as grpc from "@grpc/grpc-js"
|
||||
import * as protoLoader from "@grpc/proto-loader"
|
||||
import * as fs from "fs/promises"
|
||||
import * as path from "path"
|
||||
|
||||
const DESCRIPTOR_SET = path.resolve("dist-standalone/proto/descriptor_set.pb")
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ const getClineVersion = () => {
|
||||
const extensions = execSync("code --list-extensions --show-versions").toString()
|
||||
const clineMatch = extensions.match(/claude-dev@(\d+\.\d+\.\d+)/)
|
||||
return clineMatch ? clineMatch[1] : "Not installed"
|
||||
} catch (err) {
|
||||
} catch (_err) {
|
||||
return "Error getting version"
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ const collectSystemInfo = () => {
|
||||
cpuInfo = execSync("lscpu").toString().split("\n").slice(0, 5).join("\n")
|
||||
memoryInfo = execSync("free -h").toString()
|
||||
}
|
||||
} catch (err) {
|
||||
} catch (_err) {
|
||||
// Fallback for unsupported systems
|
||||
cpuInfo = Array.from(new Set(os.cpus().map((c) => c.model))).join("\n")
|
||||
memoryInfo = `${Math.round(os.totalmem() / 1e9)} GB RAM`
|
||||
@@ -52,7 +52,7 @@ const checkGitHubAuth = async () => {
|
||||
try {
|
||||
execSync("gh auth status", { stdio: "ignore" })
|
||||
return true
|
||||
} catch (err) {
|
||||
} catch (_err) {
|
||||
console.log("\nGitHub authentication required.")
|
||||
console.log("\nPlease run the following command in your terminal to authenticate:")
|
||||
console.log("\n gh auth login\n")
|
||||
@@ -92,7 +92,7 @@ const openUrl = (url) => {
|
||||
console.log("\nPlease open this URL in your browser:")
|
||||
console.log(url)
|
||||
}
|
||||
} catch (err) {
|
||||
} catch (_err) {
|
||||
console.log("\nFailed to open URL automatically. Please open this URL in your browser:")
|
||||
console.log(url)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env npx tsx
|
||||
import * as grpc from "@grpc/grpc-js"
|
||||
import * as health from "grpc-health-check"
|
||||
import { ReflectionService } from "@grpc/reflection"
|
||||
import * as health from "grpc-health-check"
|
||||
import * as os from "os"
|
||||
import { host } from "src/generated/grpc-js/index"
|
||||
import { getPackageDefinition } from "./proto-utils.mjs"
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
import { Anthropic } from "@anthropic-ai/sdk"
|
||||
import { ApiHandlerOptions, ModelInfo } from "@shared/api"
|
||||
import { ApiHandler } from "../../core/api/index"
|
||||
import { ApiStream } from "../../core/api/transform/stream"
|
||||
|
||||
export class DifyHandler implements ApiHandler {
|
||||
private options: ApiHandlerOptions
|
||||
private baseUrl: string
|
||||
private apiKey: string
|
||||
private conversationId: string | null = null
|
||||
|
||||
constructor(options: ApiHandlerOptions) {
|
||||
this.options = options
|
||||
this.apiKey = options.difyApiKey || ""
|
||||
this.baseUrl = options.difyBaseUrl || ""
|
||||
|
||||
console.log("[DIFY DEBUG] Constructor called with:", {
|
||||
hasApiKey: !!this.apiKey,
|
||||
baseUrl: this.baseUrl,
|
||||
})
|
||||
|
||||
if (!this.apiKey) {
|
||||
throw new Error("Dify API key is required")
|
||||
}
|
||||
if (!this.baseUrl) {
|
||||
throw new Error("Dify base URL is required")
|
||||
}
|
||||
}
|
||||
|
||||
async *createMessage(systemPrompt: string, messages: Anthropic.Messages.MessageParam[]): ApiStream {
|
||||
console.log("[DIFY DEBUG] createMessage called with:", {
|
||||
systemPromptLength: systemPrompt?.length || 0,
|
||||
messagesCount: messages?.length || 0,
|
||||
})
|
||||
|
||||
// Convert messages to Dify format
|
||||
const query = this.convertMessagesToQuery(systemPrompt, messages)
|
||||
const requestBody = {
|
||||
inputs: {},
|
||||
query: query,
|
||||
response_mode: "streaming",
|
||||
conversation_id: this.conversationId || "",
|
||||
user: "cline-user", // A unique user identifier
|
||||
files: [],
|
||||
}
|
||||
|
||||
const fullUrl = `${this.baseUrl}/chat-messages`
|
||||
console.log("[DIFY DEBUG] Making request to:", fullUrl)
|
||||
console.log("[DIFY DEBUG] Request body:", JSON.stringify(requestBody, null, 2))
|
||||
console.log("[DIFY DEBUG] Current process environment variables (for proxy debugging):", process.env)
|
||||
|
||||
let response: Response
|
||||
try {
|
||||
response = await fetch(fullUrl, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Authorization: `Bearer ${this.apiKey}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(requestBody),
|
||||
})
|
||||
} catch (error: any) {
|
||||
console.error("[DIFY DEBUG] Network error during fetch:", error)
|
||||
// Log more detailed error information if available (e.g., from undici)
|
||||
const cause = error.cause ? ` | Cause: ${error.cause}` : ""
|
||||
throw new Error(`Dify API network error: ${error.message}${cause}`)
|
||||
}
|
||||
|
||||
console.log("[DIFY DEBUG] Response status:", response.status)
|
||||
const headersObj: Record<string, string> = {}
|
||||
response.headers.forEach((value, key) => {
|
||||
headersObj[key] = value
|
||||
})
|
||||
console.log("[DIFY DEBUG] Response headers:", headersObj)
|
||||
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text()
|
||||
console.error("[DIFY DEBUG] Error response:", errorText)
|
||||
throw new Error(`Dify API error: ${response.status} ${response.statusText} - ${errorText}`)
|
||||
}
|
||||
|
||||
if (!response.body) {
|
||||
throw new Error("No response body from Dify API")
|
||||
}
|
||||
|
||||
const reader = response.body.getReader()
|
||||
const decoder = new TextDecoder()
|
||||
let buffer = ""
|
||||
let fullText = ""
|
||||
|
||||
console.log("[DIFY DEBUG] Starting to read streaming response...")
|
||||
|
||||
try {
|
||||
while (true) {
|
||||
const { done, value } = await reader.read()
|
||||
if (done) {
|
||||
console.log("[DIFY DEBUG] Stream ended naturally")
|
||||
break
|
||||
}
|
||||
|
||||
const chunk = decoder.decode(value, { stream: true })
|
||||
console.log("[DIFY DEBUG] Raw chunk received:", JSON.stringify(chunk))
|
||||
|
||||
buffer += chunk
|
||||
const lines = buffer.split("\n")
|
||||
|
||||
// Keep the last incomplete line in the buffer
|
||||
buffer = lines.pop() || ""
|
||||
|
||||
for (const line of lines) {
|
||||
console.log("[DIFY DEBUG] Processing line:", JSON.stringify(line))
|
||||
|
||||
if (line.startsWith("data: ")) {
|
||||
const data = line.slice(6).trim()
|
||||
console.log("[DIFY DEBUG] Extracted data:", JSON.stringify(data))
|
||||
|
||||
if (data === "[DONE]") {
|
||||
console.log("[DIFY DEBUG] Received [DONE] signal")
|
||||
return // Explicitly return on [DONE]
|
||||
}
|
||||
|
||||
if (data === "") {
|
||||
console.log("[DIFY DEBUG] Empty data line, skipping")
|
||||
continue
|
||||
}
|
||||
|
||||
try {
|
||||
const parsed = JSON.parse(data)
|
||||
console.log("[DIFY DEBUG] Parsed JSON:", parsed)
|
||||
|
||||
// Capture conversation_id as soon as it's available
|
||||
if (parsed.conversation_id && !this.conversationId) {
|
||||
this.conversationId = parsed.conversation_id
|
||||
console.log("[DIFY DEBUG] Captured conversation_id:", this.conversationId)
|
||||
}
|
||||
|
||||
// Handle different Dify event types based on actual Dify API
|
||||
if (parsed.event === "message") {
|
||||
console.log("[DIFY DEBUG] Message event, answer:", parsed.answer)
|
||||
// Dify sends the full text in each "answer" chunk, so we replace.
|
||||
if (typeof parsed.answer === "string") {
|
||||
fullText = parsed.answer
|
||||
console.log("[DIFY DEBUG] Updated fullText length:", fullText.length)
|
||||
yield {
|
||||
type: "text",
|
||||
text: fullText,
|
||||
}
|
||||
}
|
||||
} else if (parsed.event === "message_replace") {
|
||||
console.log("[DIFY DEBUG] Replace message event:", parsed)
|
||||
if (parsed.answer) {
|
||||
fullText = parsed.answer // Replace instead of append
|
||||
console.log("[DIFY DEBUG] Replaced fullText length:", fullText.length)
|
||||
yield {
|
||||
type: "text",
|
||||
text: fullText,
|
||||
}
|
||||
}
|
||||
} else if (parsed.event === "message_end") {
|
||||
console.log("[DIFY DEBUG] Message end event", parsed)
|
||||
// Message completed. Yield final text if we have any.
|
||||
if (fullText) {
|
||||
yield {
|
||||
type: "text",
|
||||
text: fullText,
|
||||
}
|
||||
}
|
||||
// Yield usage data if available
|
||||
if (parsed.usage) {
|
||||
yield {
|
||||
type: "usage",
|
||||
inputTokens: parsed.usage.prompt_tokens || 0,
|
||||
outputTokens: parsed.usage.completion_tokens || parsed.usage.total_tokens || 0,
|
||||
totalCost: parsed.usage.total_price || 0,
|
||||
}
|
||||
}
|
||||
return // End of stream
|
||||
} else if (parsed.event === "error") {
|
||||
console.error("[DIFY DEBUG] Error event:", parsed)
|
||||
throw new Error(`Dify API error: ${parsed.message || "Unknown error"}`)
|
||||
} else if (parsed.event === "workflow_started" || parsed.event === "workflow_finished") {
|
||||
console.log("[DIFY DEBUG] Workflow event:", parsed.event)
|
||||
// These are informational events, continue processing
|
||||
} else if (parsed.event === "node_started" || parsed.event === "node_finished") {
|
||||
console.log("[DIFY DEBUG] Node event:", parsed.event, parsed.data)
|
||||
// These are informational events, continue processing
|
||||
} else if (parsed.event === "ping") {
|
||||
console.log("[DIFY DEBUG] Ping event received, keeping connection alive.")
|
||||
// Ping event, do nothing
|
||||
} else {
|
||||
console.log("[DIFY DEBUG] Unknown event type:", parsed.event, "Full object:", parsed)
|
||||
// Try to extract text from other possible fields
|
||||
if (parsed.text) {
|
||||
fullText += parsed.text
|
||||
yield {
|
||||
type: "text",
|
||||
text: fullText,
|
||||
}
|
||||
} else if (parsed.content) {
|
||||
fullText += parsed.content
|
||||
yield {
|
||||
type: "text",
|
||||
text: fullText,
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn("[DIFY DEBUG] Failed to parse JSON:", data, "Error:", e)
|
||||
}
|
||||
} else if (line.trim() !== "") {
|
||||
console.log(
|
||||
"[DIFY DEBUG] Non-data line (not starting with 'data:'), trying to parse as direct JSON:",
|
||||
JSON.stringify(line),
|
||||
)
|
||||
// Try to parse as direct JSON (fallback for non-SSE responses, though Dify uses SSE)
|
||||
try {
|
||||
const parsed = JSON.parse(line.trim())
|
||||
console.log("[DIFY DEBUG] Parsed direct JSON:", parsed)
|
||||
|
||||
// Handle the same event types as above
|
||||
if (parsed.event === "message" && parsed.answer) {
|
||||
fullText += parsed.answer
|
||||
yield {
|
||||
type: "text",
|
||||
text: fullText,
|
||||
}
|
||||
} else if (parsed.event === "message_end") {
|
||||
if (fullText) {
|
||||
yield {
|
||||
type: "text",
|
||||
text: fullText,
|
||||
}
|
||||
}
|
||||
return
|
||||
} else if (parsed.event === "error") {
|
||||
console.error("[DIFY DEBUG] Direct JSON Error event:", parsed)
|
||||
throw new Error(`Dify API error: ${parsed.message || "Unknown error"}`)
|
||||
}
|
||||
} catch (e) {
|
||||
// Not JSON, continue
|
||||
console.log("[DIFY DEBUG] Line is not direct JSON, continuing")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
reader.releaseLock()
|
||||
console.log("[DIFY DEBUG] Stream reader released")
|
||||
}
|
||||
}
|
||||
|
||||
private convertMessagesToQuery(systemPrompt: string, messages: Anthropic.Messages.MessageParam[]): string {
|
||||
// Dify's context is managed by `conversation_id`. The `query` should be the last user message.
|
||||
// The system prompt is typically configured in the Dify App itself.
|
||||
const lastUserMessage = messages.filter((m) => m.role === "user").pop()
|
||||
|
||||
if (!lastUserMessage) {
|
||||
return "" // Should not happen in normal flow
|
||||
}
|
||||
|
||||
const userQuery = Array.isArray(lastUserMessage.content)
|
||||
? lastUserMessage.content.map((c) => ("text" in c ? c.text : "")).join("\n")
|
||||
: (lastUserMessage.content as string)
|
||||
|
||||
// Only prepend the system prompt if it's the very first message of a new conversation.
|
||||
if (!this.conversationId && systemPrompt) {
|
||||
console.log("[DIFY DEBUG] Prepending system prompt for new conversation.")
|
||||
return `${systemPrompt}\n\n---\n\n${userQuery}`
|
||||
}
|
||||
|
||||
return userQuery
|
||||
}
|
||||
|
||||
getModel(): { id: string; info: ModelInfo } {
|
||||
return {
|
||||
id: "dify-workflow",
|
||||
info: {
|
||||
maxTokens: 8192,
|
||||
contextWindow: 128000,
|
||||
supportsImages: true,
|
||||
supportsPromptCache: false,
|
||||
inputPrice: 0,
|
||||
outputPrice: 0,
|
||||
description: "Dify workflow - model selection is configured in your Dify application",
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
-16
@@ -1,19 +1,22 @@
|
||||
import * as vscode from "vscode"
|
||||
import {
|
||||
migrateCustomInstructionsToGlobalRules,
|
||||
migrateTaskHistoryToFile,
|
||||
migrateWelcomeViewCompleted,
|
||||
migrateWorkspaceToGlobalStorage,
|
||||
} from "./core/storage/state-migrations"
|
||||
import { WebviewProvider } from "./core/webview"
|
||||
import { Logger } from "./services/logging/Logger"
|
||||
import { PostHogClientProvider } from "./services/posthog/PostHogClientProvider"
|
||||
import { EmptyRequest } from "./shared/proto/cline/common"
|
||||
import { WebviewProviderType } from "./shared/webview/types"
|
||||
import "./utils/path" // necessary to have access to String.prototype.toPosix
|
||||
|
||||
import { HostProvider } from "@/hosts/host-provider"
|
||||
import { FileContextTracker } from "./core/context/context-tracking/FileContextTracker"
|
||||
import { telemetryService } from "./services/posthog/PostHogClientProvider"
|
||||
import { errorService } from "./services/error"
|
||||
import { featureFlagsService } from "./services/feature-flags"
|
||||
import { initializeDistinctId } from "./services/logging/distinctId"
|
||||
import { PostHogClientProvider } from "./services/posthog/PostHogClientProvider"
|
||||
import { telemetryService } from "./services/telemetry"
|
||||
import { ShowMessageType } from "./shared/proto/host/window"
|
||||
import { getLatestAnnouncementId } from "./utils/announcements"
|
||||
/**
|
||||
@@ -23,18 +26,11 @@ import { getLatestAnnouncementId } from "./utils/announcements"
|
||||
* @returns The webview provider
|
||||
*/
|
||||
export async function initialize(context: vscode.ExtensionContext): Promise<WebviewProvider> {
|
||||
// Set the distinct ID for logging and telemetry
|
||||
await initializeDistinctId(context)
|
||||
|
||||
// Initialize PostHog client provider
|
||||
let distinctId = context.globalState.get<string>("cline.distinctId")
|
||||
if (!distinctId) {
|
||||
try {
|
||||
const response = await HostProvider.env.getMachineId(EmptyRequest.create({}))
|
||||
distinctId = response.value
|
||||
} catch (e) {
|
||||
Logger.warn(`Failed to get machine ID: ${e instanceof Error ? e.message : String(e)}`)
|
||||
// PostHogProvider will fall back to uuid
|
||||
}
|
||||
}
|
||||
PostHogClientProvider.getInstance(distinctId)
|
||||
PostHogClientProvider.getInstance()
|
||||
|
||||
// Migrate custom instructions to global Cline rules (one-time cleanup)
|
||||
await migrateCustomInstructionsToGlobalRules(context)
|
||||
@@ -45,6 +41,9 @@ export async function initialize(context: vscode.ExtensionContext): Promise<Webv
|
||||
// Migrate workspace storage values back to global storage (reverting previous migration)
|
||||
await migrateWorkspaceToGlobalStorage(context)
|
||||
|
||||
// Ensure taskHistory.json exists and migrate legacy state (runs once)
|
||||
await migrateTaskHistoryToFile(context)
|
||||
|
||||
// Clean up orphaned file context warnings (startup cleanup)
|
||||
await FileContextTracker.cleanupOrphanedWarnings(context)
|
||||
|
||||
@@ -75,7 +74,7 @@ async function showVersionUpdateAnnouncement(context: vscode.ExtensionContext) {
|
||||
const message = previousVersion
|
||||
? `Cline has been updated to v${currentVersion}`
|
||||
: `Welcome to Cline v${currentVersion}`
|
||||
await vscode.commands.executeCommand("claude-dev.SidebarProvider.focus")
|
||||
await HostProvider.workspace.openClineSidebarPanel({})
|
||||
await new Promise((resolve) => setTimeout(resolve, 200))
|
||||
HostProvider.window.showMessage({
|
||||
type: ShowMessageType.INFORMATION,
|
||||
@@ -96,7 +95,9 @@ async function showVersionUpdateAnnouncement(context: vscode.ExtensionContext) {
|
||||
*/
|
||||
export async function tearDown(): Promise<void> {
|
||||
PostHogClientProvider.getInstance().dispose()
|
||||
|
||||
telemetryService.dispose()
|
||||
errorService.dispose()
|
||||
featureFlagsService.dispose()
|
||||
// Dispose all webview instances
|
||||
await WebviewProvider.disposeAllInstances()
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user