mirror of
https://github.com/cline/cline.git
synced 2026-09-09 06:45:53 +08:00
Compare commits
47
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39d0c5467f | ||
|
|
dbd6174882 | ||
|
|
7d537ebfad | ||
|
|
09a3d8b6c9 | ||
|
|
1d8b99f900 | ||
|
|
b6e6d7afad | ||
|
|
a616b4c5f8 | ||
|
|
16774c7cd2 | ||
|
|
d5a577389d | ||
|
|
bba90e9af4 | ||
|
|
d566a79929 | ||
|
|
2484d24f97 | ||
|
|
7dfe88072e | ||
|
|
83a2824103 | ||
|
|
5198db81f7 | ||
|
|
576d126208 | ||
|
|
c878c663eb | ||
|
|
562b636481 | ||
|
|
82faedead3 | ||
|
|
770f3e0807 | ||
|
|
79c6381893 | ||
|
|
c9d051cc0b | ||
|
|
a5d6bcecea | ||
|
|
289ddd6922 | ||
|
|
65d93eedab | ||
|
|
2928f68fd0 | ||
|
|
c1e07f26a9 | ||
|
|
17018066a7 | ||
|
|
54fc8e2a7e | ||
|
|
af35bd28b2 | ||
|
|
bce75f9821 | ||
|
|
e272a8dfbb | ||
|
|
c516230809 | ||
|
|
50021c8c5a | ||
|
|
b953c3682a | ||
|
|
f3f5bdd902 | ||
|
|
1d91dbc894 | ||
|
|
401abd9434 | ||
|
|
79e99eb526 | ||
|
|
f1d2569931 | ||
|
|
efbacbbf33 | ||
|
|
69e6ab9069 | ||
|
|
cfc5abca02 | ||
|
|
4da5614863 | ||
|
|
cef0da35e2 | ||
|
|
62fa67d833 | ||
|
|
4a57450c07 |
@@ -1,5 +1,6 @@
|
||||
import { defineConfig } from "@vscode/test-cli"
|
||||
import path from "path"
|
||||
|
||||
const vscodeTestVersion = process.env.VSCODE_TEST_VERSION ?? "stable"
|
||||
|
||||
export default defineConfig({
|
||||
|
||||
@@ -69,7 +69,7 @@ cline auth
|
||||
cline auth -p cline -k "YOUR_API_KEY" -m anthropic/claude-sonnet-4-6
|
||||
```
|
||||
|
||||
See the [CLI Reference](/cline-cli/cli-reference#cline-auth) for all auth options.
|
||||
See the [CLI Reference](/cli/cli-reference#cline-auth) for all auth options.
|
||||
|
||||
## Security Best Practices
|
||||
|
||||
|
||||
+3
-3
@@ -54,7 +54,7 @@ Models with reasoning support include most Claude, Gemini 2.5, and Grok 3 models
|
||||
| Multi-modal (text + images) | `openai/gpt-4o` or `anthropic/claude-sonnet-4-6` |
|
||||
| Complex reasoning | Any model with reasoning support |
|
||||
|
||||
For a deeper comparison of model capabilities and pricing, see the [Model Selection Guide](/core-features/model-selection-guide).
|
||||
For setup and account flow details, see the [Cline provider guide](/getting-started/cline-provider).
|
||||
|
||||
## Image Support
|
||||
|
||||
@@ -83,7 +83,7 @@ Not all models support images. Check the model's `supportsImages` capability bef
|
||||
<Card title="Chat Completions" icon="message" href="/api/chat-completions">
|
||||
Use these models in your API requests.
|
||||
</Card>
|
||||
<Card title="Model Selection Guide" icon="scale-balanced" href="/core-features/model-selection-guide">
|
||||
In-depth comparison for choosing the right model.
|
||||
<Card title="Cline provider" icon="scale-balanced" href="/getting-started/cline-provider">
|
||||
Fastest setup path with built-in authentication and billing.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -1,257 +0,0 @@
|
||||
---
|
||||
title: "Cline API Reference"
|
||||
sidebarTitle: "API Reference"
|
||||
description: "Reference for the Cline Chat Completions API, an OpenAI-compatible endpoint for programmatic access."
|
||||
---
|
||||
|
||||
The Cline API provides an OpenAI-compatible Chat Completions endpoint. You can use it from the Cline extension, the CLI, or any HTTP client that speaks the OpenAI format.
|
||||
|
||||
## Base URL
|
||||
|
||||
```
|
||||
https://api.cline.bot/api/v1
|
||||
```
|
||||
|
||||
## Authentication
|
||||
|
||||
All requests require a Bearer token in the `Authorization` header. You can use either:
|
||||
|
||||
- **API key** created at [app.cline.bot](https://app.cline.bot) (Settings > API Keys)
|
||||
- **Account auth token** (used automatically by the Cline extension and CLI when you sign in)
|
||||
|
||||
```bash
|
||||
Authorization: Bearer YOUR_API_KEY
|
||||
```
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
<Steps>
|
||||
<Step title="Go to app.cline.bot">
|
||||
Open [app.cline.bot](https://app.cline.bot) and sign in.
|
||||
</Step>
|
||||
<Step title="Open Settings > API Keys">
|
||||
Navigate to **Settings**, then **API Keys**.
|
||||
</Step>
|
||||
<Step title="Create and copy your key">
|
||||
Create a new key and copy it. Store it securely. You will not be able to see it again.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Chat Completions
|
||||
|
||||
Create a chat completion with streaming support. This endpoint follows the [OpenAI Chat Completions](https://platform.openai.com/docs/api-reference/chat/create) format.
|
||||
|
||||
### Request
|
||||
|
||||
```
|
||||
POST /chat/completions
|
||||
```
|
||||
|
||||
**Headers:**
|
||||
|
||||
| Header | Required | Description |
|
||||
|--------|----------|-------------|
|
||||
| `Authorization` | Yes | `Bearer YOUR_API_KEY` |
|
||||
| `Content-Type` | Yes | `application/json` |
|
||||
| `HTTP-Referer` | No | Your application URL |
|
||||
| `X-Title` | No | Your application name |
|
||||
|
||||
**Body parameters:**
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
|-----------|------|----------|-------------|
|
||||
| `model` | string | Yes | Model ID in `provider/model` format (e.g., `anthropic/claude-sonnet-4-6`) |
|
||||
| `messages` | array | Yes | Array of message objects with `role` and `content` |
|
||||
| `stream` | boolean | No | Enable SSE streaming (default: `true`) |
|
||||
| `tools` | array | No | Tool definitions in OpenAI function calling format |
|
||||
| `temperature` | number | No | Sampling temperature |
|
||||
|
||||
### Example Request
|
||||
|
||||
```bash
|
||||
curl -X POST https://api.cline.bot/api/v1/chat/completions \
|
||||
-H "Authorization: Bearer YOUR_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"model": "anthropic/claude-sonnet-4-6",
|
||||
"messages": [
|
||||
{"role": "system", "content": "You are a helpful assistant."},
|
||||
{"role": "user", "content": "Explain what a context window is in 2 sentences."}
|
||||
],
|
||||
"stream": true
|
||||
}'
|
||||
```
|
||||
|
||||
### Response (Streaming)
|
||||
|
||||
When `stream: true`, the response is a series of [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-Sent_Events). Each event contains a JSON chunk:
|
||||
|
||||
```json
|
||||
data: {"id":"gen-abc123","choices":[{"delta":{"content":"A context"},"index":0}],"model":"anthropic/claude-sonnet-4-6"}
|
||||
|
||||
data: {"id":"gen-abc123","choices":[{"delta":{"content":" window is"},"index":0}],"model":"anthropic/claude-sonnet-4-6"}
|
||||
|
||||
data: [DONE]
|
||||
```
|
||||
|
||||
The final chunk includes a `usage` object with token counts and cost:
|
||||
|
||||
```json
|
||||
{
|
||||
"usage": {
|
||||
"prompt_tokens": 25,
|
||||
"completion_tokens": 42,
|
||||
"prompt_tokens_details": {
|
||||
"cached_tokens": 0
|
||||
},
|
||||
"cost": 0.000315
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Response (Non-Streaming)
|
||||
|
||||
When `stream: false`, the response is a single JSON object:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "gen-abc123",
|
||||
"model": "anthropic/claude-sonnet-4-6",
|
||||
"choices": [
|
||||
{
|
||||
"message": {
|
||||
"role": "assistant",
|
||||
"content": "A context window is the maximum amount of text..."
|
||||
},
|
||||
"finish_reason": "stop",
|
||||
"index": 0
|
||||
}
|
||||
],
|
||||
"usage": {
|
||||
"prompt_tokens": 25,
|
||||
"completion_tokens": 42
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Models
|
||||
|
||||
Model IDs use the `provider/model-name` format, the same format used by [OpenRouter](https://openrouter.ai). Some examples:
|
||||
|
||||
| Model ID | Description |
|
||||
|----------|-------------|
|
||||
| `anthropic/claude-sonnet-4-6` | Claude Sonnet 4.6 |
|
||||
| `anthropic/claude-sonnet-4-5` | Claude Sonnet 4.5 |
|
||||
| `google/gemini-2.5-pro` | Gemini 2.5 Pro |
|
||||
| `openai/gpt-4o` | GPT-4o |
|
||||
|
||||
### Free Models
|
||||
|
||||
The following models are available at no cost:
|
||||
|
||||
| Model ID | Provider |
|
||||
|----------|----------|
|
||||
| `minimax/minimax-m2.5` | MiniMax |
|
||||
| `kwaipilot/kat-coder-pro` | Kwaipilot |
|
||||
| `z-ai/glm-5` | Z-AI |
|
||||
|
||||
<Note>
|
||||
Model availability and pricing may change. Check [app.cline.bot](https://app.cline.bot) for the latest list.
|
||||
</Note>
|
||||
|
||||
## Error Handling
|
||||
|
||||
Errors follow the OpenAI error format:
|
||||
|
||||
```json
|
||||
{
|
||||
"error": {
|
||||
"code": 401,
|
||||
"message": "Invalid API key",
|
||||
"metadata": {}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Common error codes:
|
||||
|
||||
| Code | Meaning |
|
||||
|------|---------|
|
||||
| `401` | Invalid or missing API key |
|
||||
| `402` | Insufficient credits |
|
||||
| `429` | Rate limit exceeded |
|
||||
| `500` | Server error |
|
||||
| `error` (finish_reason) | Mid-stream error from the upstream model provider |
|
||||
|
||||
## Using with Cline
|
||||
|
||||
The easiest way to use the Cline API is through the Cline extension or CLI, which handle authentication and streaming for you.
|
||||
|
||||
### VS Code / JetBrains
|
||||
|
||||
Select **Cline** as your provider in the model picker dropdown. Sign in with your Cline account and your API key is managed automatically.
|
||||
|
||||
### Cline CLI
|
||||
|
||||
Configure the CLI with your API key in one command:
|
||||
|
||||
```bash
|
||||
cline auth -p cline -k "YOUR_API_KEY" -m anthropic/claude-sonnet-4-6
|
||||
```
|
||||
|
||||
Then run tasks normally:
|
||||
|
||||
```bash
|
||||
cline "Write a one-line hello world in Python."
|
||||
```
|
||||
|
||||
See the [CLI Reference](/cline-cli/cli-reference) for all available commands and options.
|
||||
|
||||
## Using with Other Tools
|
||||
|
||||
Because the Cline API is OpenAI-compatible, you can use it with any library or tool that supports custom OpenAI endpoints.
|
||||
|
||||
### Python (OpenAI SDK)
|
||||
|
||||
```python
|
||||
from openai import OpenAI
|
||||
|
||||
client = OpenAI(
|
||||
base_url="https://api.cline.bot/api/v1",
|
||||
api_key="YOUR_API_KEY",
|
||||
)
|
||||
|
||||
response = client.chat.completions.create(
|
||||
model="anthropic/claude-sonnet-4-6",
|
||||
messages=[{"role": "user", "content": "Hello!"}],
|
||||
)
|
||||
print(response.choices[0].message.content)
|
||||
```
|
||||
|
||||
### Node.js (OpenAI SDK)
|
||||
|
||||
```typescript
|
||||
import OpenAI from "openai"
|
||||
|
||||
const client = new OpenAI({
|
||||
baseURL: "https://api.cline.bot/api/v1",
|
||||
apiKey: "YOUR_API_KEY",
|
||||
})
|
||||
|
||||
const response = await client.chat.completions.create({
|
||||
model: "anthropic/claude-sonnet-4-6",
|
||||
messages: [{ role: "user", content: "Hello!" }],
|
||||
})
|
||||
console.log(response.choices[0].message.content)
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="CLI Reference" icon="terminal" href="/cline-cli/cli-reference">
|
||||
Full command reference for the Cline CLI, including auth setup.
|
||||
</Card>
|
||||
<Card title="Enterprise API" icon="building" href="/enterprise-solutions/api-reference">
|
||||
Admin endpoints for user management, organizations, billing, and API keys.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -214,7 +214,7 @@ console.log(data.choices[0].message.content)
|
||||
|
||||
## Cline CLI
|
||||
|
||||
The [Cline CLI](/cline-cli/cli-reference) is the fastest way to use the Cline API from your terminal. It handles authentication, streaming, and tool execution for you.
|
||||
The [Cline CLI](/cli/cli-reference) is the fastest way to use the Cline API from your terminal. It handles authentication, streaming, and tool execution for you.
|
||||
|
||||
### Setup
|
||||
|
||||
@@ -242,7 +242,7 @@ cline -m google/gemini-2.5-pro "Analyze this codebase."
|
||||
cline -y "Run tests and fix failures."
|
||||
```
|
||||
|
||||
See the [CLI Reference](/cline-cli/cli-reference) for all commands and options.
|
||||
See the [CLI Reference](/cli/cli-reference) for all commands and options.
|
||||
|
||||
## VS Code / JetBrains
|
||||
|
||||
@@ -269,7 +269,7 @@ For setup instructions, see [Installing Cline](/getting-started/installing-cline
|
||||
<Card title="Models" icon="brain" href="/api/models">
|
||||
Browse available models.
|
||||
</Card>
|
||||
<Card title="CLI Reference" icon="terminal" href="/cline-cli/cli-reference">
|
||||
<Card title="CLI Reference" icon="terminal" href="/cli/cli-reference">
|
||||
Complete Cline CLI command reference.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -198,11 +198,11 @@ If Cline can't access files or run commands:
|
||||
## Learn More
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="CLI Overview" icon="terminal" href="/cline-cli/overview">
|
||||
<Card title="CLI Overview" icon="terminal" href="/usage/cli-overview">
|
||||
Learn about Cline CLI's core capabilities and use cases.
|
||||
</Card>
|
||||
|
||||
<Card title="Headless Mode" icon="robot" href="/cline-cli/three-core-flows">
|
||||
<Card title="Headless Mode" icon="robot" href="/usage/cli-overview#headless-mode">
|
||||
Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows.
|
||||
</Card>
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
title: "Agent Teams"
|
||||
sidebarTitle: "Agent Teams"
|
||||
description: "Coordinate multiple agents working together on complex tasks from the CLI."
|
||||
---
|
||||
<Warning>
|
||||
This feature currently only applies to Cline SDK, CLI, and Kanban. This feature is not applicable on VSCode and JetBrains Extension for now.
|
||||
</Warning>
|
||||
|
||||
|
||||
Agent teams let you break complex work across multiple agents that coordinate through a shared task board. One agent acts as the coordinator, delegating subtasks to specialist agents.
|
||||
|
||||
## Starting a Team
|
||||
|
||||
```bash
|
||||
cline --team-name auth-sprint "Plan and implement user authentication with tests"
|
||||
```
|
||||
|
||||
The `--team-name` flag enables team mode. The coordinator agent gets additional tools for spawning teammates and delegating tasks.
|
||||
|
||||
## Resuming Team Work
|
||||
|
||||
Team state persists across sessions. Resume where you left off:
|
||||
|
||||
```bash
|
||||
cline --team-name auth-sprint "Continue with incomplete tasks"
|
||||
```
|
||||
|
||||
## Interactive Mode
|
||||
|
||||
In interactive mode, use the `/team` slash command:
|
||||
|
||||
```
|
||||
/team Plan and implement a REST API with tests
|
||||
```
|
||||
|
||||
## Team State
|
||||
|
||||
Team state is stored at `~/.cline/data/teams/[team-name]/` and includes:
|
||||
|
||||
- Task board with current tasks and status
|
||||
- Inter-agent mailbox
|
||||
- Mission log with activity history
|
||||
|
||||
## Disabling Teams
|
||||
|
||||
Teams are enabled by default. Disable them with:
|
||||
|
||||
```bash
|
||||
cline --no-teams "your prompt"
|
||||
```
|
||||
|
||||
## Sub-Agents
|
||||
|
||||
For simpler delegation within a single session (no persistent state), use [sub-agents](/features/subagents). Sub-agents run in parallel for read-only research and return focused reports to the main agent.
|
||||
|
||||
See the [SDK Multi-Agent Teams guide](/sdk/guides/multi-agent-teams) for the programmatic API.
|
||||
@@ -0,0 +1,305 @@
|
||||
---
|
||||
title: "CLI Reference"
|
||||
description: "Complete command reference for Cline CLI including all commands, flags, and configuration options."
|
||||
---
|
||||
|
||||
```bash
|
||||
cline --help # Show all commands
|
||||
cline <command> --help # Show help for a specific command
|
||||
```
|
||||
|
||||
## Synopsis
|
||||
|
||||
```bash
|
||||
cline [options] [command] [prompt]
|
||||
```
|
||||
|
||||
## Help Menu (Source of Truth)
|
||||
|
||||
```text
|
||||
Usage: cline [options] [command] [prompt]
|
||||
|
||||
Cline CLI - AI coding assistant in your terminal
|
||||
|
||||
Arguments:
|
||||
prompt Your prompt. Default to start in act mode with auto-approve enabled.
|
||||
|
||||
Options:
|
||||
-V, --version Output the version number
|
||||
-p, --plan Run in plan mode
|
||||
--json Output messages as JSON instead of styled text
|
||||
--auto-approve <boolean> Set tool auto-approval for all tools (default: true)
|
||||
-t, --timeout <seconds> Optional timeout in seconds (default: 0 for no timeout)
|
||||
-m, --model <model-id> Model to use for the session with the selected provider
|
||||
-v, --verbose Show verbose output
|
||||
-c, --cwd <path> Working directory
|
||||
--config <path> Configuration directory (default: ~/.cline/data/settings)
|
||||
--data-dir <path> Use isolated local state at this directory path (default: ~/.cline)
|
||||
--thinking <level> Set reasoning effort level between none|low|medium|high|xhigh (default: medium)
|
||||
--retries <count> Maximum consecutive mistakes (retries) before halting
|
||||
--hooks-dir <path> Directory path to additional hooks for runtime hook injection (default: ~/.cline/hooks)
|
||||
--acp Run in Agent Client Protocol (ACP) mode for editor integration
|
||||
-i, --tui Open the terminal user interface (TUI) for interactive sessions
|
||||
--id <session-id> Resume an existing session by ID
|
||||
-k, --key <api-key> API key override for this run
|
||||
-P, --provider <id> Provider id (default: cline)
|
||||
-s, --system <system-prompt> Override the default system prompt
|
||||
-z, --zen Start a session that runs in the background hub
|
||||
-h, --help display help for command
|
||||
|
||||
Commands:
|
||||
auth [options] [provider] Authenticate a provider and configure what model is used
|
||||
config [options] Show current configuration
|
||||
connect [options] [adapter] Connect to an editor or IDE adapter
|
||||
mcp Manage MCP servers
|
||||
dev Developer tools and utilities
|
||||
doctor Diagnose and fix configuration issues
|
||||
history|h [options] List session history or manage saved sessions
|
||||
hook Handle a hook payload from stdin
|
||||
plugin Manage Cline Plugins
|
||||
schedule Manage scheduled tasks
|
||||
hub Manage the local hub daemon
|
||||
update [options] Check for updates and install if available
|
||||
version Show Cline CLI version number
|
||||
kanban Launch the kanban app and exit
|
||||
```
|
||||
|
||||
## Global Options
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `-V, --version` | Output the version number |
|
||||
| `-p, --plan` | Run in plan mode |
|
||||
| `--json` | Output messages as JSON instead of styled text |
|
||||
| `--auto-approve <boolean>` | Set tool auto-approval for all tools (default: `true`) |
|
||||
| `-t, --timeout <seconds>` | Optional timeout in seconds (default: `0` for no timeout) |
|
||||
| `-m, --model <model-id>` | Model to use for the session with the selected provider |
|
||||
| `-v, --verbose` | Show verbose output |
|
||||
| `-c, --cwd <path>` | Working directory |
|
||||
| `--config <path>` | Configuration directory (default: `~/.cline/data/settings`) |
|
||||
| `--data-dir <path>` | Use isolated local state at this directory path (default: `~/.cline`) |
|
||||
| `--thinking <level>` | Set reasoning effort: `none\|low\|medium\|high\|xhigh` (default `medium`) |
|
||||
| `--retries <count>` | Maximum consecutive mistakes (retries) before halting |
|
||||
| `--hooks-dir <path>` | Directory path to additional hooks for runtime hook injection (default: `~/.cline/hooks`) |
|
||||
| `--acp` | Run in Agent Client Protocol (ACP) mode for editor integration |
|
||||
| `-i, --tui` | Open the terminal user interface (TUI) for interactive sessions |
|
||||
| `--id <session-id>` | Resume an existing session by ID |
|
||||
| `-k, --key <api-key>` | API key override for this run |
|
||||
| `-P, --provider <id>` | Provider id (default: `cline`) |
|
||||
| `-s, --system <system-prompt>` | Override the default system prompt |
|
||||
| `-z, --zen` | Start a session that runs in the background hub |
|
||||
| `-h, --help` | Display help for command |
|
||||
|
||||
## Commands
|
||||
|
||||
### `cline` (default)
|
||||
|
||||
Start a task or enter interactive mode.
|
||||
|
||||
```bash
|
||||
cline
|
||||
cline "your prompt here"
|
||||
cline "Run tests and fix failures"
|
||||
echo "prompt" | cline
|
||||
```
|
||||
|
||||
### `auth [options] [provider]`
|
||||
|
||||
Configure authentication with an AI provider.
|
||||
|
||||
```bash
|
||||
cline auth
|
||||
```
|
||||
|
||||
### `config [options]`
|
||||
|
||||
Show current configuration.
|
||||
|
||||
```bash
|
||||
cline config
|
||||
```
|
||||
|
||||
### `connect [options] [adapter]`
|
||||
|
||||
Connect to messaging platforms. See [Connectors](/cli/connectors).
|
||||
|
||||
```bash
|
||||
cline connect
|
||||
cline connect [adapter]
|
||||
```
|
||||
|
||||
### `mcp`
|
||||
|
||||
Manage MCP servers. See [MCP](/mcp/mcp-overview).
|
||||
|
||||
```bash
|
||||
cline mcp
|
||||
```
|
||||
|
||||
### `dev`
|
||||
|
||||
Developer tools and utilities.
|
||||
|
||||
```bash
|
||||
cline dev
|
||||
```
|
||||
|
||||
### `doctor`
|
||||
|
||||
Diagnose and fix configuration issues.
|
||||
|
||||
```bash
|
||||
cline doctor
|
||||
```
|
||||
|
||||
### `history|h [options]`
|
||||
|
||||
List session history or manage saved sessions.
|
||||
|
||||
```bash
|
||||
cline history
|
||||
cline h
|
||||
```
|
||||
|
||||
### `hook`
|
||||
|
||||
Handle a hook payload from stdin.
|
||||
|
||||
```bash
|
||||
cat payload.json | cline hook
|
||||
```
|
||||
|
||||
### `plugin`
|
||||
|
||||
Manage Cline plugins. Install plugins from npm, git repositories, or local paths. See [Plugins](/customization/plugins) for full details and the plugin manifest format.
|
||||
|
||||
```bash
|
||||
cline plugin install <source> # Install a plugin
|
||||
cline plugin i <source> # Shorthand alias
|
||||
```
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `--npm` | Treat source as an npm package |
|
||||
| `--git` | Treat source as a git repository |
|
||||
| `--force` | Replace an existing install for the same source |
|
||||
| `--json` | Output result as JSON |
|
||||
| `--cwd <path>` | Install to `<path>/.cline/plugins` instead of the global directory |
|
||||
|
||||
Try it with the [TypeScript Navigation Plugin](https://github.com/cline/typescript-lsp-plugin):
|
||||
|
||||
```bash
|
||||
cline plugin install https://github.com/cline/typescript-lsp-plugin.git
|
||||
```
|
||||
|
||||
### `schedule`
|
||||
|
||||
Manage scheduled agents. See [Scheduling](/cli/scheduling).
|
||||
|
||||
```bash
|
||||
cline schedule
|
||||
```
|
||||
|
||||
### `hub`
|
||||
|
||||
Manage the local hub daemon.
|
||||
|
||||
```bash
|
||||
cline hub
|
||||
```
|
||||
|
||||
### `update [options]`
|
||||
|
||||
Check for updates and install if available.
|
||||
|
||||
```bash
|
||||
cline update
|
||||
```
|
||||
|
||||
### `version`
|
||||
|
||||
Show Cline CLI version number.
|
||||
|
||||
```bash
|
||||
cline version
|
||||
cline -V
|
||||
```
|
||||
|
||||
### `kanban`
|
||||
|
||||
Launch the kanban app and exit.
|
||||
|
||||
```bash
|
||||
cline kanban
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Description |
|
||||
|----------|-------------|
|
||||
| `CLINE_DATA_DIR` | Custom configuration directory (replaces `~/.cline/data/`) |
|
||||
| `CLINE_HUB_ADDRESS` | Override hub address (default: `127.0.0.1:25463`) |
|
||||
| `CLINE_SESSION_BACKEND_MODE` | Force backend mode (`local`, `hub`, `remote`, `auto`) |
|
||||
| `CLINE_SANDBOX_DATA_DIR` | Sandbox session storage directory |
|
||||
| `CLINE_SANDBOX` | Enable sandbox mode |
|
||||
| `CLINE_HOOKS_DIR` | Additional hooks directory |
|
||||
| `CLINE_BUILD_ENV` | Set to `development` for debug features |
|
||||
| `CLINE_DEBUG_PORT_BASE` | Base port for Node.js inspector |
|
||||
| `CLINE_COMMAND_PERMISSIONS` | JSON policy restricting shell commands (see below) |
|
||||
|
||||
### CLINE_COMMAND_PERMISSIONS
|
||||
|
||||
Restrict which shell commands the agent can execute:
|
||||
|
||||
```bash
|
||||
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"], "deny": ["rm -rf *", "sudo *"]}'
|
||||
```
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `allow` | `string[]` | Glob patterns for allowed commands. If set, only matching commands are permitted. |
|
||||
| `deny` | `string[]` | Glob patterns for denied commands. Deny rules always take precedence. |
|
||||
| `allowRedirects` | `boolean` | Whether to allow shell redirects (`>`, `>>`, `<`). Default: `false`. |
|
||||
|
||||
## JSON Output Format
|
||||
|
||||
When using `--json`, each message is a JSON object on its own line:
|
||||
|
||||
```json
|
||||
{"type": "say", "text": "I'll create the file now.", "ts": 1760501486669, "say": "text"}
|
||||
```
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `type` | `"ask"` or `"say"` | Message category |
|
||||
| `text` | `string` | Message content |
|
||||
| `ts` | `number` | Unix timestamp in milliseconds |
|
||||
| `say` | `string` | Subtype when `type` is `"say"` |
|
||||
| `ask` | `string` | Subtype when `type` is `"ask"` |
|
||||
| `reasoning` | `string` | Model reasoning (if available) |
|
||||
| `partial` | `boolean` | `true` while streaming |
|
||||
|
||||
## Configuration Files
|
||||
|
||||
```
|
||||
~/.cline/
|
||||
data/
|
||||
settings/
|
||||
providers.json # API keys and provider config
|
||||
rules/ # Global rules
|
||||
skills/ # Global skills
|
||||
teams/ # Team state
|
||||
sessions/ # Session database (SQLite)
|
||||
logs/
|
||||
hub-daemon.log # Hub logs
|
||||
plugins/ # Global plugins
|
||||
_installed/ # Managed by `cline plugin install`
|
||||
|
||||
.cline/ # Project root
|
||||
rules/ # Project rules
|
||||
skills/ # Project skills
|
||||
hooks/ # Lifecycle hooks
|
||||
plugins/ # Project plugins
|
||||
mcp.json # MCP server config
|
||||
agents.yaml # Agent definitions
|
||||
```
|
||||
@@ -0,0 +1,156 @@
|
||||
---
|
||||
title: "Connectors"
|
||||
sidebarTitle: "Connectors"
|
||||
description: "Connect the CLI to Telegram, Slack, Discord, Google Chat, WhatsApp, etc."
|
||||
---
|
||||
<Warning>
|
||||
This feature currently only applies to Cline CLI.
|
||||
</Warning>
|
||||
|
||||
Connectors let you chat with your agent from messaging platforms. Each incoming message creates or continues an agent session, and the agent's response is sent back to the conversation.
|
||||
|
||||
## Setup Wizard
|
||||
|
||||
Run `cline connect` to open an interactive wizard that guides you through platform selection, credential entry, security configuration, and advanced options (provider, model, system prompt, agent mode).
|
||||
|
||||
```bash
|
||||
cline connect
|
||||
```
|
||||
|
||||
## Supported Platforms
|
||||
|
||||
| Platform | Direct Command | Required Credentials |
|
||||
|----------|---------------|---------------------|
|
||||
| Telegram | `cline connect telegram` | Bot username, bot token |
|
||||
| Slack | `cline connect slack` | Bot token, signing secret, base URL |
|
||||
| Discord | `cline connect discord` | Application ID, bot token, public key, base URL |
|
||||
| Google Chat | `cline connect gchat` | Service account credentials JSON, base URL |
|
||||
| WhatsApp | `cline connect whatsapp` | Phone number ID, access token, app secret, verify token, base URL |
|
||||
| Linear | `cline connect linear` | API key, webhook signing secret, base URL |
|
||||
|
||||
## Telegram
|
||||
|
||||
<Steps>
|
||||
<Step title="Create a Telegram bot">
|
||||
Open Telegram and start a chat with [@BotFather](https://t.me/BotFather). Send `/newbot` and follow the prompts:
|
||||
|
||||
1. Enter a display name (e.g., "Cline")
|
||||
2. Enter a username ending in `bot` (e.g., `cline_myname_bot`). Must be unique across Telegram.
|
||||
3. BotFather responds with your bot token (looks like `7123456789:AAH...`)
|
||||
</Step>
|
||||
|
||||
<Step title="Start the connector">
|
||||
```bash
|
||||
cline connect telegram -m <BOT-USERNAME> -k <BOT-TOKEN>
|
||||
```
|
||||
</Step>
|
||||
|
||||
<Step title="Chat with your bot">
|
||||
Open Telegram, search for your bot's username, and send a message. The agent processes it and replies in the chat.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Security
|
||||
|
||||
By default, anyone who finds your bot can message it and it will execute tasks on your machine. Lock it down with the `--hook-command` flag.
|
||||
|
||||
<Steps>
|
||||
<Step title="Get your Telegram user ID">
|
||||
Message [@userinfobot](https://t.me/userinfobot) on Telegram. It replies with your user ID immediately.
|
||||
</Step>
|
||||
|
||||
<Step title="Start with access control">
|
||||
Replace `12345` with your actual Telegram user ID:
|
||||
|
||||
```bash
|
||||
cline connect telegram -m <BOT-USERNAME> -k <BOT-TOKEN> \
|
||||
--hook-command 'jq -r ".payload.actor.participantKey" | grep -q "telegram:id:12345" && echo "{\"action\":\"allow\"}" || echo "{\"action\":\"deny\",\"message\":\"unauthorized\"}"'
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
The `--hook-command` receives each incoming message with sender info via stdin. Your script returns `{"action": "allow"}` or `{"action": "deny", "message": "reason"}`. Without `--hook-command`, everything is auto-approved.
|
||||
|
||||
## Slack
|
||||
|
||||
Requires a bot token, signing secret, and public base URL.
|
||||
|
||||
```bash
|
||||
cline connect slack --token <BOT-TOKEN> --signing-secret <SECRET> --base-url <URL>
|
||||
```
|
||||
|
||||
Each Slack thread maps to an agent session, so the agent maintains conversation context within a thread.
|
||||
|
||||
## Discord
|
||||
|
||||
Requires an application ID, bot token, public key, and public base URL.
|
||||
|
||||
```bash
|
||||
cline connect discord --app-id <ID> --token <TOKEN> --public-key <KEY> --base-url <URL>
|
||||
```
|
||||
|
||||
## Google Chat
|
||||
|
||||
Requires a service account credentials JSON file and public base URL.
|
||||
|
||||
```bash
|
||||
cline connect gchat --credentials <JSON> --base-url <URL>
|
||||
```
|
||||
|
||||
## WhatsApp
|
||||
|
||||
Requires a phone number ID, access token, app secret, webhook verify token, and public base URL.
|
||||
|
||||
```bash
|
||||
cline connect whatsapp --phone-id <ID> --token <TOKEN> --app-secret <SECRET> --base-url <URL>
|
||||
```
|
||||
|
||||
## Linear
|
||||
|
||||
Requires an API key, webhook signing secret, and public base URL.
|
||||
|
||||
```bash
|
||||
cline connect linear --api-key <KEY> --signing-secret <SECRET> --base-url <URL>
|
||||
```
|
||||
|
||||
## Managing Connectors
|
||||
|
||||
```bash
|
||||
# Stop all connectors
|
||||
cline connect --stop
|
||||
|
||||
# Stop a specific connector
|
||||
cline connect telegram --stop
|
||||
```
|
||||
|
||||
## Hook Command Protocol
|
||||
|
||||
The `--hook-command` pattern works across all connectors. The script receives a JSON payload via stdin:
|
||||
|
||||
```json
|
||||
{
|
||||
"payload": {
|
||||
"actor": {
|
||||
"participantKey": "telegram:id:12345",
|
||||
"displayName": "User Name"
|
||||
},
|
||||
"message": "The incoming message text"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Return `{"action": "allow"}` or `{"action": "deny", "message": "reason"}`.
|
||||
|
||||
## Running Multiple Connectors
|
||||
|
||||
Multiple connectors can run simultaneously. They all share the same hub:
|
||||
|
||||
```bash
|
||||
# Terminal 1
|
||||
cline connect telegram -m my_bot -k $TELEGRAM_TOKEN
|
||||
|
||||
# Terminal 2
|
||||
cline connect slack --token $SLACK_TOKEN --signing-secret $SECRET --base-url $URL
|
||||
```
|
||||
|
||||
Connectors require the hub. Start it with `cline hub start` if it doesn't auto-start.
|
||||
+8
-11
@@ -7,7 +7,7 @@ Automate GitHub issue analysis with AI. Mention `@cline` in any issue comment to
|
||||
|
||||
|
||||
<Note>
|
||||
**New to Cline CLI?** This sample assumes you understand Cline CLI basics and have completed the [Installation Guide](https://docs.cline.bot/cline-cli/installation). If you're new to Cline CLI, we recommend starting with the [GitHub RCA sample](./github-issue-rca) first, as it's simpler and will help you understand the fundamentals before setting up GitHub Actions.
|
||||
**New to Cline CLI?** This sample assumes you understand Cline CLI basics and have completed the [Installation Guide](https://docs.cline.bot/getting-started/installing-cline). If you're new to Cline CLI, we recommend starting with the [GitHub RCA sample](./github-issue-rca) first, as it's simpler and will help you understand the fundamentals before setting up GitHub Actions.
|
||||
</Note>
|
||||
|
||||
## The Workflow
|
||||
@@ -32,7 +32,7 @@ Let's configure your repository.
|
||||
|
||||
Before you begin, you'll need:
|
||||
|
||||
- **Cline CLI knowledge** - Completed the [Installation Guide](https://docs.cline.bot/cline-cli/installation) and understand basic usage
|
||||
- **Cline CLI knowledge** - Completed the [Installation Guide](https://docs.cline.bot/getting-started/installing-cline) and understand basic usage
|
||||
- **GitHub repository** - With admin access to configure Actions and secrets
|
||||
- **GitHub Actions familiarity** - Basic understanding of workflows and CI/CD
|
||||
- **API provider account** - OpenRouter, Anthropic, or similar with API key
|
||||
@@ -95,7 +95,7 @@ jobs:
|
||||
|
||||
- name: Install Cline CLI
|
||||
if: steps.detect.outputs.hit == 'true'
|
||||
run: npm install -g cline
|
||||
run: npm install -g @cline/cli
|
||||
|
||||
- name: Configure Cline Authentication
|
||||
if: steps.detect.outputs.hit == 'true'
|
||||
@@ -120,7 +120,6 @@ jobs:
|
||||
env:
|
||||
ISSUE_URL: ${{ steps.detect.outputs.issue_url }}
|
||||
COMMENT: ${{ steps.detect.outputs.comment_body }}
|
||||
CLINE_ADDRESS: ${{ env.CLINE_ADDRESS }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
@@ -231,10 +230,9 @@ nano git-scripts/analyze-issue.sh # or use vim, code, etc.
|
||||
# Analyze a GitHub issue using Cline CLI
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <github-issue-url> [prompt] [address]"
|
||||
echo "Usage: $0 <github-issue-url> [prompt]"
|
||||
echo "Example: $0 https://github.com/owner/repo/issues/123"
|
||||
echo "Example: $0 https://github.com/owner/repo/issues/123 'What is the root cause of this issue?'"
|
||||
echo "Example: $0 https://github.com/owner/repo/issues/123 'What is the root cause of this issue?'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -243,9 +241,8 @@ ISSUE_URL="$1"
|
||||
PROMPT="${2:-What is the root cause of this issue?}"
|
||||
|
||||
# Ask Cline for its analysis, showing only the summary
|
||||
cline -y "$PROMPT: $ISSUE_URL" --mode act -F json | \
|
||||
sed -n '/^{/,$p' | \
|
||||
jq -r 'select(.say == "completion_result") | .text' | \
|
||||
cline --auto-approve true --json "$PROMPT: $ISSUE_URL" | \
|
||||
jq -r 'select(.type == "agent_event" and .event.type == "done") | .event.text' | \
|
||||
sed 's/\\n/\n/g'
|
||||
```
|
||||
|
||||
@@ -283,7 +280,7 @@ GitHub Actions will:
|
||||
1. Detect the `@cline` mention
|
||||
2. Start a Cline CLI instance
|
||||
3. Download the analysis script
|
||||
4. Analyze the issue using act mode with yolo (fully autonomous)
|
||||
4. Analyze the issue using Act mode with auto-approval enabled
|
||||
5. Post Cline's analysis as a new comment
|
||||
|
||||
**Note**: The workflow only triggers on issue comments, not pull request
|
||||
@@ -296,7 +293,7 @@ The workflow (`cline-responder.yml`):
|
||||
1. **Triggers** on issue comments (created or edited)
|
||||
2. **Detects** `@cline` mentions (case-insensitive)
|
||||
3. **Installs** Cline CLI globally using npm
|
||||
4. **Configures** authentication using `cline config set open-router-api-key=...`
|
||||
4. **Configures** authentication using `cline auth --provider openrouter --apikey ...`
|
||||
6. **Downloads** the reusable `analyze-issue.sh` script from the
|
||||
`github-issue-rca` sample
|
||||
7. **Runs** analysis in Cline CLI
|
||||
+21
-62
@@ -6,7 +6,7 @@ description: "Automated GitHub issue analysis using Cline CLI to identify root c
|
||||
Automated GitHub issue analysis using Cline CLI. This script uses Cline's autonomous AI capabilities to fetch, analyze, and identify root causes of GitHub issues, outputting clean, parseable results that can be easily integrated into your development workflows.
|
||||
|
||||
<Note>
|
||||
**New to Cline CLI?** This sample assumes you have already completed the [Installation Guide](https://docs.cline.bot/cline-cli/installation) and authenticated with `cline auth`. If you haven't set up Cline CLI yet, please start there first.
|
||||
**New to Cline CLI?** This sample assumes you have already completed the [Installation Guide](https://docs.cline.bot/getting-started/installing-cline) and authenticated with `cline auth`. If you haven't set up Cline CLI yet, please start there first.
|
||||
</Note>
|
||||
|
||||
<Frame>
|
||||
@@ -17,7 +17,7 @@ Automated GitHub issue analysis using Cline CLI. This script uses Cline's autono
|
||||
|
||||
This sample assumes you have already:
|
||||
|
||||
- **Cline CLI** installed and authenticated ([Installation Guide](https://docs.cline.bot/cline-cli/installation))
|
||||
- **Cline CLI** installed and authenticated ([Installation Guide](https://docs.cline.bot/getting-started/installing-cline))
|
||||
- **At least one AI model provider** configured (e.g., OpenRouter, Anthropic, OpenAI)
|
||||
- **Basic familiarity** with Cline CLI commands
|
||||
|
||||
@@ -80,24 +80,18 @@ curl -O https://raw.githubusercontent.com/cline/cline/main/src/samples/cli/githu
|
||||
# Analyze a GitHub issue using Cline CLI
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <github-issue-url> [prompt] [address]"
|
||||
echo "Usage: $0 <github-issue-url> [prompt]"
|
||||
echo "Example: $0 https://github.com/owner/repo/issues/123"
|
||||
echo "Example: $0 https://github.com/owner/repo/issues/123 'What is the root cause of this issue?'"
|
||||
echo "Example: $0 https://github.com/owner/repo/issues/123 'What is the root cause of this issue?' 127.0.0.1:46529"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Gather the args
|
||||
ISSUE_URL="$1"
|
||||
PROMPT="${2:-What is the root cause of this issue?}"
|
||||
if [ -n "$3" ]; then
|
||||
ADDRESS="--address $3"
|
||||
fi
|
||||
|
||||
# Ask Cline for its analysis, showing only the summary
|
||||
cline -y "$PROMPT: $ISSUE_URL" --mode act $ADDRESS -F json | \
|
||||
sed -n '/^{/,$p' | \
|
||||
jq -r 'select(.say == "completion_result") | .text' | \
|
||||
cline --auto-approve true --json "$PROMPT: $ISSUE_URL" | \
|
||||
jq -r 'select(.type == "agent_event" and .event.type == "done") | .event.text' | \
|
||||
sed 's/\\n/\n/g'
|
||||
```
|
||||
|
||||
@@ -133,23 +127,6 @@ Ask specific questions about the issue:
|
||||
./analyze-issue.sh https://github.com/owner/repo/issues/456 "What is the security impact?"
|
||||
```
|
||||
|
||||
### Using Specific Cline Instance
|
||||
|
||||
Target a particular Cline instance by address:
|
||||
|
||||
```bash
|
||||
./analyze-issue.sh https://github.com/owner/repo/issues/123 \
|
||||
"What is the root cause of this issue?" \
|
||||
127.0.0.1:46529
|
||||
```
|
||||
|
||||
<Warning>
|
||||
This is useful when:
|
||||
- Running multiple Cline instances
|
||||
- Using a remote Cline server
|
||||
- Testing with specific configurations
|
||||
</Warning>
|
||||
|
||||
<Note>
|
||||
The script will automatically handle everything: fetching the issue, analyzing it with Cline, and displaying the results. The analysis typically takes 30-60 seconds depending on the issue complexity.
|
||||
</Note>
|
||||
@@ -164,10 +141,9 @@ The script validates input and provides usage instructions:
|
||||
|
||||
```bash
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 <github-issue-url> [prompt] [address]"
|
||||
echo "Usage: $0 <github-issue-url> [prompt]"
|
||||
echo "Example: $0 https://github.com/owner/repo/issues/123"
|
||||
echo "Example: $0 https://github.com/owner/repo/issues/123 'What is the root cause?'"
|
||||
echo "Example: $0 https://github.com/owner/repo/issues/123 'Analyze security impact' 127.0.0.1:46529"
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
@@ -176,7 +152,6 @@ fi
|
||||
- Validates required GitHub issue URL
|
||||
- Shows clear usage examples
|
||||
- Supports optional custom prompt
|
||||
- Supports optional Cline instance address
|
||||
|
||||
### Argument Parsing
|
||||
|
||||
@@ -186,15 +161,12 @@ The script extracts and sets up the arguments:
|
||||
# Gather the args
|
||||
ISSUE_URL="$1"
|
||||
PROMPT="${2:-What is the root cause of this issue?}"
|
||||
if [ -n "$3" ]; then
|
||||
ADDRESS="--address $3"
|
||||
fi
|
||||
```
|
||||
|
||||
**Explanation:**
|
||||
- `ISSUE_URL="$1"` - First argument is always the issue URL
|
||||
- `PROMPT="${2:-...}"` - Second argument is optional, defaults to root cause analysis
|
||||
- `ADDRESS` - Third argument is optional, only set if provided
|
||||
- The SDK CLI runs the task directly, so no address flag is required.
|
||||
|
||||
### The Core Analysis Pipeline
|
||||
|
||||
@@ -202,39 +174,26 @@ This is where the magic happens:
|
||||
|
||||
```bash
|
||||
# Ask Cline for its analysis, showing only the summary
|
||||
cline -y "$PROMPT: $ISSUE_URL" --mode act $ADDRESS -F json | \
|
||||
sed -n '/^{/,$p' | \
|
||||
jq -r 'select(.say == "completion_result") | .text' | \
|
||||
cline --auto-approve true --json "$PROMPT: $ISSUE_URL" | \
|
||||
jq -r 'select(.type == "agent_event" and .event.type == "done") | .event.text' | \
|
||||
sed 's/\\n/\n/g'
|
||||
```
|
||||
|
||||
<Accordion title="Pipeline Breakdown: Understanding Each Component">
|
||||
|
||||
**1. `cline -y "$PROMPT: $ISSUE_URL"`**
|
||||
- `-y` enables yolo mode (no user interaction)
|
||||
**1. `cline --auto-approve true --json "$PROMPT: $ISSUE_URL"`**
|
||||
- `cline` is the Cline CLI binary
|
||||
- Act mode is the default for prompt runs
|
||||
- `--auto-approve true` allows tool use without interactive prompts
|
||||
- `--json` emits newline-delimited JSON for parsing
|
||||
- Constructs prompt with issue URL
|
||||
|
||||
**2. `--mode act`**
|
||||
- Enables act mode for active investigation
|
||||
- Allows Cline to use tools (read files, run commands, etc.)
|
||||
|
||||
**3. `$ADDRESS`**
|
||||
- Optional address flag for specific instance
|
||||
- Expands to `--address <ip:port>` if set
|
||||
|
||||
**4. `-F json`**
|
||||
- Outputs in JSON format for parsing
|
||||
|
||||
**5. `sed -n '/^{/,$p'`**
|
||||
- Extracts JSON from output
|
||||
- Skips any non-JSON prefix lines
|
||||
|
||||
**6. `jq -r 'select(.say == "completion_result") | .text'`**
|
||||
- Filters for completion result messages
|
||||
- Extracts the text field
|
||||
**2. `jq -r 'select(.type == "agent_event" and .event.type == "done") | .event.text'`**
|
||||
- Filters for the final agent `done` event
|
||||
- Extracts the final text field
|
||||
- `-r` outputs raw strings (no JSON quotes)
|
||||
|
||||
**7. `sed 's/\\n/\n/g'`**
|
||||
**3. `sed 's/\\n/\n/g'`**
|
||||
- Converts escaped newlines to actual newlines
|
||||
- Makes output readable
|
||||
|
||||
@@ -376,6 +335,6 @@ This pattern can be adapted for many other automation scenarios, from pull reque
|
||||
|
||||
## Related Resources
|
||||
|
||||
- [CLI Installation Guide](https://docs.cline.bot/cline-cli/installation)
|
||||
- [CLI Reference Documentation](https://docs.cline.bot/cline-cli/cli-reference)
|
||||
- [Headless Mode](https://docs.cline.bot/cline-cli/three-core-flows)
|
||||
- [CLI Installation Guide](https://docs.cline.bot/getting-started/installing-cline)
|
||||
- [CLI Reference Documentation](https://docs.cline.bot/cli/cli-reference)
|
||||
- [Headless Mode](https://docs.cline.bot/usage/cli-overview#headless-mode)
|
||||
@@ -69,7 +69,7 @@ jobs:
|
||||
cache: "npm"
|
||||
|
||||
- name: Install Cline CLI
|
||||
run: npm install -g cline
|
||||
run: npm install -g @cline/cli
|
||||
|
||||
- name: Configure Cline Authentication
|
||||
# Replace 'anthropic' with your provider of choice (openai, openrouter, etc.)
|
||||
@@ -110,7 +110,7 @@ jobs:
|
||||
]
|
||||
}
|
||||
run: |
|
||||
cline --yolo 'You are a GitHub PR reviewer for this repository. Your goal is to give the PR author helpful feedback and give maintainers the context they need to review efficiently.
|
||||
cline --auto-approve true 'You are a GitHub PR reviewer for this repository. Your goal is to give the PR author helpful feedback and give maintainers the context they need to review efficiently.
|
||||
|
||||
PR: #'"${PR_NUMBER}"'
|
||||
|
||||
@@ -175,11 +175,11 @@ cline auth --provider anthropic --apikey "..."
|
||||
```
|
||||
The `auth` command configures Cline in the CI environment without interactive prompts. You can switch providers (e.g., `openai`, `openrouter`) by changing the flags.
|
||||
|
||||
### Autonomous Mode (`--yolo`)
|
||||
### Autonomous Mode (`--auto-approve true`)
|
||||
```bash
|
||||
cline --yolo '...'
|
||||
cline --auto-approve true '...'
|
||||
```
|
||||
The `--yolo` flag tells Cline to run autonomously, executing commands without waiting for user approval. This is essential for CI/CD workflows.
|
||||
The `--auto-approve true` flag tells Cline to run autonomously, executing approved tools without waiting for interactive confirmation. Prompt runs start in Act mode by default, so CI/CD workflows can perform the requested work immediately.
|
||||
|
||||
### Command Permissions
|
||||
We explicitly restrict what commands Cline can run using `CLINE_COMMAND_PERMISSIONS`. This ensures Cline can only use `gh` and `git` commands relevant to reviewing, preventing any accidental or malicious system modifications.
|
||||
+27
-27
@@ -43,20 +43,20 @@ Use different models for different phases of work. Route simple tasks to cheap m
|
||||
ISSUE_CONTENT=$(gh issue view $(gh issue list -L 1 | awk '{print $1}'))
|
||||
|
||||
# Phase 1: Quick summary with cheap model
|
||||
SUMMARY=$(echo "$ISSUE_CONTENT" | cline -y --config ~/.cline-haiku \
|
||||
SUMMARY=$(echo "$ISSUE_CONTENT" | cline --auto-approve true --config ~/.cline-haiku \
|
||||
"summarize this issue in 2-3 sentences")
|
||||
|
||||
# Phase 2: Detailed plan with expensive model + thinking
|
||||
PLAN=$(echo "$SUMMARY" | cline -y --thinking --config ~/.cline-opus \
|
||||
PLAN=$(echo "$SUMMARY" | cline --auto-approve true --thinking high --config ~/.cline-opus \
|
||||
"create detailed implementation plan with edge cases")
|
||||
|
||||
# Phase 3: Execute with mid-tier model
|
||||
echo "$PLAN" | cline -y --config ~/.cline-sonnet \
|
||||
echo "$PLAN" | cline --auto-approve true --config ~/.cline-sonnet \
|
||||
"implement the plan from above"
|
||||
```
|
||||
|
||||
<Note>
|
||||
Each cline invocation needs to complete before passing output to the next phase. Use shell variables to store intermediate results rather than piping cline commands directly.
|
||||
Each `cline` invocation needs to complete before passing output to the next phase. Use shell variables to store intermediate results rather than piping `cline` commands directly.
|
||||
</Note>
|
||||
|
||||
**Cost impact:**
|
||||
@@ -102,19 +102,19 @@ Get multiple AI perspectives on the same change, then synthesize their feedback.
|
||||
DIFF=$(git show)
|
||||
|
||||
# Review 1: Gemini's perspective
|
||||
echo "$DIFF" | cline -y --config ~/.cline-gemini \
|
||||
echo "$DIFF" | cline --auto-approve true --config ~/.cline-gemini \
|
||||
"review this diff and write your analysis to gemini-review.md"
|
||||
|
||||
# Review 2: Codex's perspective
|
||||
echo "$DIFF" | cline -y --config ~/.cline-codex \
|
||||
echo "$DIFF" | cline --auto-approve true --config ~/.cline-codex \
|
||||
"review this diff and write your analysis to codex-review.md"
|
||||
|
||||
# Review 3: Opus's perspective
|
||||
echo "$DIFF" | cline -y --config ~/.cline-opus \
|
||||
echo "$DIFF" | cline --auto-approve true --config ~/.cline-opus \
|
||||
"review this diff and write your analysis to opus-review.md"
|
||||
|
||||
# Synthesize all reviews into a consensus
|
||||
cat gemini-review.md codex-review.md opus-review.md | cline -y \
|
||||
cat gemini-review.md codex-review.md opus-review.md | cline --auto-approve true \
|
||||
"summarize these 3 reviews and identify: 1) issues all models agree on, 2) issues only one model caught, 3) your final recommendation"
|
||||
```
|
||||
|
||||
@@ -130,19 +130,19 @@ Run reviews in parallel for faster feedback:
|
||||
|
||||
```bash
|
||||
# Run all reviews simultaneously
|
||||
git show | cline -y --config ~/.cline-gemini "review and save to gemini-review.md" &
|
||||
git show | cline -y --config ~/.cline-codex "review and save to codex-review.md" &
|
||||
git show | cline -y --config ~/.cline-opus "review and save to opus-review.md" &
|
||||
git show | cline --auto-approve true --config ~/.cline-gemini "review and save to gemini-review.md" &
|
||||
git show | cline --auto-approve true --config ~/.cline-codex "review and save to codex-review.md" &
|
||||
git show | cline --auto-approve true --config ~/.cline-opus "review and save to opus-review.md" &
|
||||
|
||||
# Wait for all to complete
|
||||
wait
|
||||
|
||||
# Synthesize
|
||||
cat *-review.md | cline -y "create consensus review"
|
||||
cat *-review.md | cline --auto-approve true "create consensus review"
|
||||
```
|
||||
|
||||
<Note>
|
||||
Parallel execution requires managing multiple Cline instances. See [Multi-instance workflows](/cline-cli/three-core-flows#3-multi-instance-run-parallel-agents) for details.
|
||||
Parallel execution requires managing multiple Cline instances. See [Multi-instance workflows](/usage/cli-overview#automation-patterns) for details.
|
||||
</Note>
|
||||
|
||||
## Extended Thinking for Complex Tasks
|
||||
@@ -151,14 +151,14 @@ Use the `--thinking` flag when Cline needs to analyze multiple approaches:
|
||||
|
||||
```bash
|
||||
# Without thinking: Fast but may miss nuances
|
||||
cline -y "refactor this codebase"
|
||||
cline --auto-approve true "refactor this codebase"
|
||||
|
||||
# With thinking: Slower but more thorough
|
||||
cline -y --thinking \
|
||||
cline --auto-approve true --thinking high \
|
||||
"refactor this codebase - consider: performance, maintainability, backward compatibility"
|
||||
```
|
||||
|
||||
The `--thinking` flag allocates 1024 tokens for internal reasoning before Cline responds. Best for:
|
||||
The `--thinking <level>` flag sets reasoning effort. Use `--thinking high` or `--thinking xhigh` when you want the model to spend more effort on complex tradeoffs. Best for:
|
||||
- Architectural decisions
|
||||
- Security analysis
|
||||
- Complex refactoring
|
||||
@@ -178,12 +178,12 @@ The `--thinking` flag allocates 1024 tokens for internal reasoning before Cline
|
||||
|
||||
```bash
|
||||
# Haiku: Quick summary and issue identification
|
||||
gh pr view $PR | cline -y --config ~/.cline-haiku \
|
||||
gh pr view $PR | cline --auto-approve true --config ~/.cline-haiku \
|
||||
"list all issues to fix, output as JSON"
|
||||
|
||||
# Opus with thinking: Deep analysis only if issues found
|
||||
if [ -s issues.json ]; then
|
||||
cline -y --thinking --config ~/.cline-opus \
|
||||
cline --auto-approve true --thinking high --config ~/.cline-opus \
|
||||
"analyze these issues and recommend fixes"
|
||||
fi
|
||||
```
|
||||
@@ -192,31 +192,31 @@ fi
|
||||
|
||||
```bash
|
||||
# Different models have different security perspectives
|
||||
git diff main | cline -y --config ~/.cline-gemini "security review" > gemini-sec.md &
|
||||
git diff main | cline -y --config ~/.cline-opus "security review" > opus-sec.md &
|
||||
git diff main | cline -y --config ~/.cline-codex "security review" > codex-sec.md &
|
||||
git diff main | cline --auto-approve true --config ~/.cline-gemini "security review" > gemini-sec.md &
|
||||
git diff main | cline --auto-approve true --config ~/.cline-opus "security review" > opus-sec.md &
|
||||
git diff main | cline --auto-approve true --config ~/.cline-codex "security review" > codex-sec.md &
|
||||
wait
|
||||
|
||||
# High-priority: Issues all 3 models found
|
||||
cat *-sec.md | cline -y "find security issues all 3 reviews mentioned"
|
||||
cat *-sec.md | cline --auto-approve true "find security issues all 3 reviews mentioned"
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="CLI Reference" icon="terminal" href="/cline-cli/cli-reference">
|
||||
<Card title="CLI Reference" icon="terminal" href="/cli/cli-reference">
|
||||
Complete documentation for --config and --thinking flags
|
||||
</Card>
|
||||
|
||||
<Card title="Headless Mode" icon="robot" href="/cline-cli/three-core-flows">
|
||||
<Card title="Headless Mode" icon="robot" href="/usage/cli-overview#headless-mode">
|
||||
Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows.
|
||||
</Card>
|
||||
|
||||
<Card title="Model Selection Guide" icon="brain" href="/core-features/model-selection-guide">
|
||||
Compare models and choose the right one for your needs
|
||||
<Card title="Cline provider" icon="brain" href="/getting-started/cline-provider">
|
||||
Fastest built-in model access setup and account workflow
|
||||
</Card>
|
||||
|
||||
<Card title="CI/CD Integration" icon="github" href="/cline-cli/samples/github-integration">
|
||||
<Card title="CI/CD Integration" icon="github" href="/cli/samples/github-integration">
|
||||
Automate GitHub workflows with Cline CLI
|
||||
</Card>
|
||||
</Columns>
|
||||
@@ -0,0 +1,110 @@
|
||||
---
|
||||
title: "Scheduling"
|
||||
sidebarTitle: "Scheduling"
|
||||
description: "Run agents on cron schedules for recurring automations like daily summaries and code reviews."
|
||||
---
|
||||
<Warning>
|
||||
This feature currently only applies to Cline SDK, CLI, and Kanban. This feature is not applicable on VSCode and JetBrains Extension for now.
|
||||
</Warning>
|
||||
|
||||
The CLI supports running agents on cron schedules through the hub. Scheduled agents persist across process restarts and run independently of any terminal session.
|
||||
|
||||
## Schedule Wizard
|
||||
|
||||
Run `cline schedule` to open an interactive menu for creating and managing schedules, browsing execution history, and viewing performance statistics.
|
||||
|
||||
```bash
|
||||
cline schedule
|
||||
```
|
||||
|
||||
The wizard provides:
|
||||
|
||||
| Action | Description |
|
||||
|--------|-------------|
|
||||
| Create new schedule | Set up a recurring task with cron timing and prompt |
|
||||
| List schedules | View all schedules with status and next run time |
|
||||
| Upcoming runs | Preview the next 10 scheduled executions |
|
||||
| Active executions | Show currently running tasks |
|
||||
| Trigger now | Immediately run a selected schedule |
|
||||
| Pause / Resume | Suspend or restart a schedule |
|
||||
| Execution history | View past runs with status, duration, tokens, and cost |
|
||||
| Statistics | Success rate, average duration, last failure |
|
||||
| Delete | Remove a schedule |
|
||||
|
||||
## Creating Schedules with Flags
|
||||
|
||||
```bash
|
||||
cline schedule create "PR summary" \
|
||||
--cron "0 9 * * MON-FRI" \
|
||||
--prompt "List all open PRs and their review status" \
|
||||
--workspace /path/to/repo \
|
||||
--model anthropic/claude-sonnet-4-6
|
||||
```
|
||||
|
||||
## Managing Schedules
|
||||
|
||||
```bash
|
||||
cline schedule list
|
||||
cline schedule trigger <schedule-id>
|
||||
cline schedule pause <schedule-id>
|
||||
cline schedule resume <schedule-id>
|
||||
cline schedule delete <schedule-id>
|
||||
cline schedule executions <schedule-id>
|
||||
```
|
||||
|
||||
## Cron Expression Reference
|
||||
|
||||
| Expression | Schedule |
|
||||
|-----------|----------|
|
||||
| `*/5 * * * *` | Every 5 minutes |
|
||||
| `*/15 * * * *` | Every 15 minutes |
|
||||
| `0 * * * *` | Every hour |
|
||||
| `0 */6 * * *` | Every 6 hours |
|
||||
| `0 0 * * *` | Daily at midnight |
|
||||
| `0 9 * * *` | Daily at 9am |
|
||||
| `0 9 * * 1-5` | Every weekday at 9am |
|
||||
| `0 9 * * 1` | Every Monday at 9am |
|
||||
| `0 0 1 * *` | First of every month |
|
||||
|
||||
## Examples
|
||||
|
||||
### Daily Standup Summary
|
||||
|
||||
```bash
|
||||
cline schedule create "Standup prep" \
|
||||
--cron "0 8 * * MON-FRI" \
|
||||
--prompt "Summarize: (1) PRs merged yesterday, (2) PRs currently in review, (3) open issues assigned to team members." \
|
||||
--workspace /path/to/repo
|
||||
```
|
||||
|
||||
### Weekly Dependency Check
|
||||
|
||||
```bash
|
||||
cline schedule create "Dependency check" \
|
||||
--cron "0 10 * * MON" \
|
||||
--prompt "Check for outdated npm dependencies. For any with security vulnerabilities, create a branch with the update and open a PR." \
|
||||
--workspace /path/to/project
|
||||
```
|
||||
|
||||
### Codebase Health Report
|
||||
|
||||
```bash
|
||||
cline schedule create "Code health" \
|
||||
--cron "0 6 * * MON" \
|
||||
--prompt "Analyze the codebase for: (1) files with no test coverage, (2) TODO/FIXME comments older than 30 days, (3) functions longer than 100 lines." \
|
||||
--workspace /path/to/project
|
||||
```
|
||||
|
||||
## Routing Results
|
||||
|
||||
Combine schedules with [connectors](/cli/connectors) to send results to messaging platforms:
|
||||
|
||||
```bash
|
||||
cline connect telegram -m my_bot -k $BOT_TOKEN
|
||||
|
||||
cline schedule create "Morning briefing" \
|
||||
--cron "0 8 * * *" \
|
||||
--prompt "Summarize overnight activity in the repo"
|
||||
```
|
||||
|
||||
Scheduling requires the hub. It starts automatically when you create a schedule.
|
||||
@@ -1,428 +0,0 @@
|
||||
---
|
||||
title: "CLI Reference"
|
||||
description: "Complete command reference for Cline CLI including all commands, flags, and configuration options"
|
||||
---
|
||||
|
||||
This page documents all available commands, flags, and configuration options for Cline CLI. For quick help in your terminal, use:
|
||||
|
||||
```bash
|
||||
cline --help # Show all commands
|
||||
cline task --help # Show task command options
|
||||
cline auth --help # Show auth command options
|
||||
man cline # View the full manual page (if installed)
|
||||
```
|
||||
|
||||
## Synopsis
|
||||
|
||||
```bash
|
||||
cline [prompt] [options]
|
||||
cline <command> [options] [arguments]
|
||||
```
|
||||
|
||||
## Global Options
|
||||
|
||||
These options work with any command:
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `--config <path>` | Use a custom configuration directory instead of `~/.cline/data/` |
|
||||
| `-c, --cwd <path>` | Set the working directory for the task |
|
||||
| `-v, --verbose` | Show detailed output including model reasoning |
|
||||
| `--help` | Show help for the command |
|
||||
|
||||
## Modes of Operation
|
||||
|
||||
Cline CLI automatically detects the best output mode based on how you invoke it:
|
||||
|
||||
| Mode | When Activated | Description |
|
||||
|------|----------------|-------------|
|
||||
| **Interactive** | `cline` with no args, TTY connected | Rich terminal UI with real-time streaming, keyboard shortcuts, and visual feedback. |
|
||||
| **Task** | `cline "prompt"` with TTY connected | Interactive UI starts immediately with your task. |
|
||||
| **Plain Text** | stdin piped, stdout redirected, or `--yolo`/`--json` flags | Clean text output without UI, suitable for scripting and CI/CD. |
|
||||
|
||||
## Agent Behavior
|
||||
|
||||
Cline operates in two primary modes that control how it approaches tasks:
|
||||
|
||||
| Mode | Description |
|
||||
|------|-------------|
|
||||
| **Act Mode** (default) | Cline actively uses tools to accomplish tasks. It can read files, write code, execute commands, use a headless browser, and more. |
|
||||
| **Plan Mode** | Cline gathers information and creates a detailed plan before implementation. It explores the codebase, asks clarifying questions, and presents a strategy for your approval before switching to Act Mode. |
|
||||
|
||||
Use `-a, --act` or `-p, --plan` flags to explicitly set the mode.
|
||||
|
||||
## Commands
|
||||
|
||||
### cline (default)
|
||||
|
||||
Run Cline without a subcommand to start a task or enter interactive mode.
|
||||
|
||||
```bash
|
||||
# Interactive mode (no arguments)
|
||||
cline
|
||||
|
||||
# Start a task directly
|
||||
cline "your prompt here"
|
||||
|
||||
# Resume the latest task for the current directory
|
||||
cline --continue
|
||||
```
|
||||
|
||||
**Options:**
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `-a, --act` | Start in Act mode (default). Cline executes actions directly. |
|
||||
| `-p, --plan` | Start in Plan mode. Cline analyzes and creates a strategy before acting. |
|
||||
| `-y, --yolo` | YOLO mode: auto-approve all actions, use plain text output, exit when complete. Ideal for CI/CD. |
|
||||
| `-m, --model <id>` | Use a specific model (e.g., `claude-sonnet-4-5-20250929`, `gpt-4o`). |
|
||||
| `-i, --images <paths...>` | Include image files with the prompt. |
|
||||
| `--thinking` | Enable extended thinking with a 1024 token budget. |
|
||||
| `--json` | Output messages as JSON (one object per line). Forces plain text mode. |
|
||||
| `--timeout <seconds>` | Maximum execution time before the task is stopped. |
|
||||
| `--continue` | Resume the most recent task from the current working directory. |
|
||||
|
||||
**Mode Behavior:**
|
||||
|
||||
| Invocation | Output Mode | Why |
|
||||
|------------|-------------|-----|
|
||||
| `cline` | Interactive UI | No arguments, TTY connected |
|
||||
| `cline "prompt"` | Interactive UI | TTY connected |
|
||||
| `cline -y "prompt"` | Plain text | YOLO flag forces plain text |
|
||||
| `cline --json "prompt"` | JSON | JSON flag forces plain text |
|
||||
| `cat file \| cline "prompt"` | Plain text | stdin is piped |
|
||||
| `cline "prompt" > out.txt` | Plain text | stdout is redirected |
|
||||
|
||||
---
|
||||
|
||||
### cline task (alias: t)
|
||||
|
||||
Run a task with a prompt. This is equivalent to `cline "prompt"`.
|
||||
|
||||
```bash
|
||||
cline task "Create a REST API endpoint"
|
||||
cline t "Fix the bug in utils.js"
|
||||
```
|
||||
|
||||
**Options:** Same as the default command above.
|
||||
|
||||
---
|
||||
|
||||
### cline auth
|
||||
|
||||
Configure authentication with an AI provider.
|
||||
|
||||
```bash
|
||||
# Interactive wizard
|
||||
cline auth
|
||||
|
||||
# Quick setup with flags
|
||||
cline auth -p anthropic -k sk-ant-api-xxxxx -m claude-sonnet-4-5-20250929
|
||||
```
|
||||
|
||||
**Options:**
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `-p, --provider <id>` | Provider ID. See [Supported Providers](#supported-providers) below. |
|
||||
| `-k, --apikey <key>` | API key for the provider. |
|
||||
| `-m, --modelid <id>` | Model ID to use (e.g., `claude-sonnet-4-5-20250929`, `gpt-4o`). |
|
||||
| `-b, --baseurl <url>` | Base URL for OpenAI-compatible providers. |
|
||||
|
||||
**Supported Providers:**
|
||||
|
||||
| Provider ID | Description |
|
||||
|-------------|-------------|
|
||||
| `anthropic` | Anthropic Claude (direct API) |
|
||||
| `openai-native` | OpenAI GPT models |
|
||||
| `openai-codex` | ChatGPT subscription via OAuth |
|
||||
| `openrouter` | OpenRouter (access multiple providers) |
|
||||
| `bedrock` | AWS Bedrock |
|
||||
| `gemini` | Google Gemini |
|
||||
| `xai` | X AI (Grok) |
|
||||
| `cerebras` | Cerebras (fast inference) |
|
||||
| `deepseek` | DeepSeek |
|
||||
| `ollama` | Ollama (local models) |
|
||||
| `lmstudio` | LM Studio (local models) |
|
||||
| `openai` | OpenAI-compatible API (custom base URL) |
|
||||
|
||||
---
|
||||
|
||||
### cline history (alias: h)
|
||||
|
||||
Browse task history with pagination.
|
||||
|
||||
```bash
|
||||
# Show recent tasks (default: 10)
|
||||
cline history
|
||||
|
||||
# Show more tasks
|
||||
cline history -n 20
|
||||
|
||||
# Paginate through history
|
||||
cline history -n 10 -p 2
|
||||
```
|
||||
|
||||
**Options:**
|
||||
|
||||
| Option | Description |
|
||||
|--------|-------------|
|
||||
| `-n, --limit <number>` | Number of tasks to show (default: 10) |
|
||||
| `-p, --page <number>` | Page number, 1-based (default: 1) |
|
||||
|
||||
---
|
||||
|
||||
### cline config
|
||||
|
||||
View and manage configuration settings.
|
||||
|
||||
```bash
|
||||
cline config
|
||||
```
|
||||
|
||||
Opens an interactive configuration view with tabs for:
|
||||
- **Settings** - Global and workspace-specific settings
|
||||
- **Rules** - `.clinerules` files and imported rules
|
||||
- **Workflows** - Available workflows (appear as slash commands)
|
||||
- **Hooks** - Configured hook scripts
|
||||
- **Skills** - Enabled skills
|
||||
|
||||
---
|
||||
|
||||
### cline update
|
||||
|
||||
Check for updates and install the latest version.
|
||||
|
||||
```bash
|
||||
cline update
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### cline version
|
||||
|
||||
Show the installed CLI version.
|
||||
|
||||
```bash
|
||||
cline version
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### cline dev
|
||||
|
||||
Developer tools for debugging.
|
||||
|
||||
```bash
|
||||
# Open the log file
|
||||
cline dev log
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
### CLINE_DIR
|
||||
|
||||
Override the default configuration directory:
|
||||
|
||||
```bash
|
||||
export CLINE_DIR=/path/to/custom/config
|
||||
cline "your task"
|
||||
```
|
||||
|
||||
When set, all Cline data (settings, secrets, task history) is stored in this directory instead of `~/.cline/data/`.
|
||||
|
||||
**Use cases:**
|
||||
- Running isolated Cline instances with different settings
|
||||
- CI/CD environments with custom state directories
|
||||
- Testing configuration changes without affecting your main setup
|
||||
|
||||
### CLINE_COMMAND_PERMISSIONS
|
||||
|
||||
Restrict which shell commands Cline can execute:
|
||||
|
||||
```bash
|
||||
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"], "deny": ["rm -rf *"]}'
|
||||
```
|
||||
|
||||
**Format:**
|
||||
|
||||
```json
|
||||
{
|
||||
"allow": ["pattern1", "pattern2"],
|
||||
"deny": ["pattern3"],
|
||||
"allowRedirects": true
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `allow` | `string[]` | Glob patterns for allowed commands. If set, **only** matching commands are permitted. |
|
||||
| `deny` | `string[]` | Glob patterns for denied commands. Deny rules **always take precedence** over allow rules. |
|
||||
| `allowRedirects` | `boolean` | Whether to allow shell redirects (`>`, `>>`, `<`). Default: `false`. |
|
||||
|
||||
**Examples:**
|
||||
|
||||
```bash
|
||||
# Allow only npm and git commands (deny everything else)
|
||||
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"]}'
|
||||
|
||||
# Allow dev commands but explicitly deny dangerous ones
|
||||
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *", "node *"], "deny": ["rm -rf *", "sudo *"]}'
|
||||
|
||||
# Allow file reading with redirects
|
||||
export CLINE_COMMAND_PERMISSIONS='{"allow": ["cat *", "echo *"], "allowRedirects": true}'
|
||||
```
|
||||
|
||||
**How commands are evaluated:**
|
||||
|
||||
1. Check for dangerous characters (backticks outside single quotes, unquoted newlines)
|
||||
2. Parse command into segments split by operators (`&&`, `||`, `|`, `;`)
|
||||
3. If redirects are detected and `allowRedirects` is not true, command is denied
|
||||
4. Each segment is validated against deny rules first, then allow rules
|
||||
5. Subshell contents (`$(...)` and `(...)`) are recursively validated
|
||||
6. All segments must pass for the command to be allowed
|
||||
|
||||
## JSON Output Format
|
||||
|
||||
When using `--json`, each message is output as a JSON object (one per line):
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "say",
|
||||
"text": "I'll create the file now.",
|
||||
"ts": 1760501486669,
|
||||
"say": "text"
|
||||
}
|
||||
```
|
||||
|
||||
**Required fields:**
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `type` | `"ask"` \| `"say"` | Message category |
|
||||
| `text` | `string` | Human-readable message content |
|
||||
| `ts` | `number` | Unix timestamp in milliseconds |
|
||||
|
||||
**Optional fields:**
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `say` | `string` | Subtype when `type` is `"say"` (e.g., `"text"`, `"tool"`) |
|
||||
| `ask` | `string` | Subtype when `type` is `"ask"` (e.g., `"tool"`, `"followup"`) |
|
||||
| `reasoning` | `string` | Model reasoning (omitted when empty) |
|
||||
| `partial` | `boolean` | `true` while streaming (omitted when complete) |
|
||||
| `images` | `string[]` | Image URIs (omitted when empty) |
|
||||
| `files` | `string[]` | File paths (omitted when empty) |
|
||||
|
||||
## Configuration Files
|
||||
|
||||
Cline stores all data in `~/.cline/` by default:
|
||||
|
||||
```text
|
||||
~/.cline/
|
||||
├── data/ # Configuration directory
|
||||
│ ├── globalState.json # Global settings
|
||||
│ ├── secrets.json # API keys (stored securely)
|
||||
│ ├── workspace/ # Workspace-specific state
|
||||
│ └── tasks/ # Task history and conversations
|
||||
└── log/ # Debug logs (view with cline dev log)
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### Interactive Development
|
||||
|
||||
```bash
|
||||
# Start interactive mode
|
||||
cline
|
||||
|
||||
# Start with a task and use interactive UI
|
||||
cline "Help me refactor this codebase"
|
||||
```
|
||||
|
||||
### Direct Task Execution
|
||||
|
||||
```bash
|
||||
# Run a task directly
|
||||
cline "Add error handling to utils.js"
|
||||
|
||||
# Start in Plan mode to review strategy first
|
||||
cline -p "Design a caching layer for the API"
|
||||
|
||||
# Use a specific model
|
||||
cline -m gpt-4o "Explain this code"
|
||||
```
|
||||
|
||||
### Piped Input
|
||||
|
||||
```bash
|
||||
# Pipe file contents
|
||||
cat README.md | cline "Summarize this document"
|
||||
|
||||
# Review git changes
|
||||
git diff | cline "Review these changes"
|
||||
|
||||
# Analyze test output
|
||||
npm test 2>&1 | cline "Fix any failing tests"
|
||||
```
|
||||
|
||||
### Automation and CI/CD
|
||||
|
||||
```bash
|
||||
# YOLO mode for automated workflows
|
||||
cline -y "Run tests and fix failures"
|
||||
|
||||
# JSON output for scripting
|
||||
cline --json "List all TODO comments" | jq '.text'
|
||||
|
||||
# With timeout
|
||||
cline -y --timeout 600 "Run the full test suite"
|
||||
|
||||
# Chain commands
|
||||
git diff | cline -y "explain" | cline -y "write a commit message"
|
||||
```
|
||||
|
||||
### Authentication
|
||||
|
||||
```bash
|
||||
# Interactive wizard
|
||||
cline auth
|
||||
|
||||
# Quick setup: Anthropic
|
||||
cline auth -p anthropic -k sk-ant-api-xxxxx -m claude-sonnet-4-5-20250929
|
||||
|
||||
# Quick setup: OpenAI
|
||||
cline auth -p openai-native -k sk-xxxxx -m gpt-4o
|
||||
|
||||
# Quick setup: OpenRouter
|
||||
cline auth -p openrouter -k sk-or-xxxxx
|
||||
|
||||
# OpenAI-compatible with custom URL
|
||||
cline auth -p openai -k your-key -b https://api.example.com/v1
|
||||
```
|
||||
|
||||
## Support
|
||||
|
||||
- **Report bugs:** https://github.com/cline/cline/issues
|
||||
- **Discord community:** https://discord.gg/cline
|
||||
- **Documentation:** https://docs.cline.bot
|
||||
|
||||
## See Also
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="Installation & Setup" icon="download" href="/cline-cli/installation">
|
||||
Install Cline CLI and configure authentication.
|
||||
</Card>
|
||||
|
||||
<Card title="Interactive Mode" icon="terminal" href="/cline-cli/interactive-mode">
|
||||
Keyboard shortcuts, slash commands, and file mentions.
|
||||
</Card>
|
||||
|
||||
<Card title="Headless Mode" icon="robot" href="/cline-cli/three-core-flows">
|
||||
Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows.
|
||||
</Card>
|
||||
|
||||
<Card title="Configuration" icon="gear" href="/cline-cli/configuration">
|
||||
Environment variables and advanced settings.
|
||||
</Card>
|
||||
</Columns>
|
||||
@@ -1,330 +0,0 @@
|
||||
---
|
||||
title: "Configuration"
|
||||
description: "Manage Cline CLI settings with cline config, environment variables, and configuration files"
|
||||
---
|
||||
|
||||
Cline CLI provides multiple ways to configure settings, from the interactive `cline config` command to environment variables for automation.
|
||||
|
||||
## The Config Command
|
||||
|
||||
Launch the configuration interface:
|
||||
|
||||
```bash
|
||||
cline config
|
||||
```
|
||||
|
||||
This opens an interactive view with tabs for different configuration categories.
|
||||
|
||||
## Configuration Tabs
|
||||
|
||||
Navigate between tabs using arrow keys.
|
||||
|
||||
### Settings Tab
|
||||
|
||||
View and edit global and workspace-specific settings:
|
||||
|
||||
- **Global State**: Settings that apply across all workspaces
|
||||
- **Workspace State**: Settings specific to the current directory
|
||||
|
||||
### Rules Tab
|
||||
|
||||
Manage Cline rules that guide AI behavior:
|
||||
|
||||
- **`.clinerules` files**: Project-specific rules in your workspace
|
||||
- **Cursor rules**: Import rules from Cursor editor format
|
||||
- **Windsurf rules**: Import rules from Windsurf editor format
|
||||
|
||||
Rules help Cline understand your project's conventions, coding standards, and preferences.
|
||||
|
||||
### Workflows Tab
|
||||
|
||||
View and manage [workflows](/customization/workflows):
|
||||
|
||||
- List available workflows
|
||||
- View workflow definitions
|
||||
- Workflows appear as slash commands in interactive mode
|
||||
|
||||
### Hooks Tab
|
||||
|
||||
Configure [hooks](/customization/hooks) for custom logic integration:
|
||||
|
||||
- Enable/disable hooks globally
|
||||
- View configured hook scripts
|
||||
- Hooks run at key points in Cline's workflow
|
||||
|
||||
<Note>
|
||||
Hooks must be enabled via settings. Use `cline config` to toggle `hooks-enabled`.
|
||||
</Note>
|
||||
|
||||
### Skills Tab
|
||||
|
||||
Manage [skills](/customization/skills) that extend Cline's capabilities:
|
||||
|
||||
- View available skills
|
||||
- Enable/disable specific skills
|
||||
- Skills provide specialized instructions for specific tasks
|
||||
|
||||
## Configuration Directory
|
||||
|
||||
Cline stores configuration in `~/.cline/data/`:
|
||||
|
||||
```text
|
||||
~/.cline/
|
||||
├── data/ # Configuration directory
|
||||
│ ├── globalState.json # Global settings
|
||||
│ ├── secrets.json # API keys (encrypted)
|
||||
│ ├── settings/ # Settings files
|
||||
│ │ └── cline_mcp_settings.json # MCP server configuration
|
||||
│ ├── workspace/ # Workspace-specific state
|
||||
│ └── tasks/ # Task history and data
|
||||
└── log/ # Log files
|
||||
```
|
||||
|
||||
### Viewing Logs
|
||||
|
||||
For debugging, view the log file:
|
||||
|
||||
```bash
|
||||
cline dev log
|
||||
```
|
||||
|
||||
This opens the log file in your default editor.
|
||||
|
||||
## Environment Variables
|
||||
|
||||
### CLINE_DIR
|
||||
|
||||
Override the default configuration directory:
|
||||
|
||||
```bash
|
||||
export CLINE_DIR=/custom/path/to/cline
|
||||
cline "your task"
|
||||
```
|
||||
|
||||
When set, all Cline data is stored in this directory instead of `~/.cline/data/`.
|
||||
|
||||
**Use cases:**
|
||||
- Running multiple isolated Cline configurations
|
||||
- Team-shared configurations
|
||||
- CI/CD with custom state directories
|
||||
|
||||
### CLINE_COMMAND_PERMISSIONS
|
||||
|
||||
Restrict which shell commands Cline can execute:
|
||||
|
||||
```bash
|
||||
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"], "deny": ["rm -rf *"]}'
|
||||
```
|
||||
|
||||
**Format:**
|
||||
|
||||
```json
|
||||
{
|
||||
"allow": ["pattern1", "pattern2"],
|
||||
"deny": ["pattern3"],
|
||||
"allowRedirects": true
|
||||
}
|
||||
```
|
||||
|
||||
**Fields:**
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `allow` | `string[]` | Glob patterns for allowed commands. If set, only matching commands are permitted. |
|
||||
| `deny` | `string[]` | Glob patterns for denied commands. Deny rules take precedence over allow. |
|
||||
| `allowRedirects` | `boolean` | Whether to allow shell redirects (`>`, `>>`, `<`). Default: `false` |
|
||||
|
||||
**Examples:**
|
||||
|
||||
```bash
|
||||
# Allow only npm and git commands
|
||||
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"]}'
|
||||
|
||||
# Allow dev commands but deny dangerous ones
|
||||
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *", "node *"], "deny": ["rm -rf *", "sudo *"]}'
|
||||
|
||||
# Allow file operations with redirects
|
||||
export CLINE_COMMAND_PERMISSIONS='{"allow": ["cat *", "echo *"], "allowRedirects": true}'
|
||||
```
|
||||
|
||||
<Warning>
|
||||
When `allow` is set, all commands not matching the allow patterns are denied. Use this for security-sensitive environments.
|
||||
</Warning>
|
||||
|
||||
## Using --config Flag
|
||||
|
||||
Run Cline with a custom configuration directory:
|
||||
|
||||
```bash
|
||||
cline --config /path/to/custom/config "your task"
|
||||
```
|
||||
|
||||
This is useful for:
|
||||
- Running isolated Cline instances
|
||||
- Testing different configurations
|
||||
- Separating work and personal setups
|
||||
|
||||
**Example: Multiple configurations**
|
||||
|
||||
```bash
|
||||
# Work configuration
|
||||
cline --config ~/.cline-work "review this PR"
|
||||
|
||||
# Personal projects
|
||||
cline --config ~/.cline-personal "help me with this side project"
|
||||
```
|
||||
|
||||
## MCP Server Configuration
|
||||
|
||||
Cline CLI supports [MCP (Model Context Protocol)](/mcp/mcp-overview) servers, giving you access to external tools and data sources directly from the terminal. The CLI uses the same MCP configuration format as the VS Code extension.
|
||||
|
||||
### Setting Up MCP Servers
|
||||
|
||||
You can add MCP servers from the CLI:
|
||||
|
||||
```bash
|
||||
# STDIO server
|
||||
cline mcp add kanban -- kanban mcp
|
||||
|
||||
# Remote HTTP server
|
||||
cline mcp add linear https://mcp.linear.app/mcp --type http
|
||||
```
|
||||
|
||||
These commands update:
|
||||
|
||||
```
|
||||
~/.cline/data/settings/cline_mcp_settings.json
|
||||
```
|
||||
|
||||
You can still edit this file directly. It uses the same JSON format as the VS Code extension:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-server": {
|
||||
"command": "node",
|
||||
"args": ["/path/to/server.js"],
|
||||
"env": {
|
||||
"API_KEY": "your_api_key"
|
||||
},
|
||||
"alwaysAllow": ["tool1", "tool2"],
|
||||
"disabled": false
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For the full configuration reference including STDIO and SSE transport types, see [Adding and Configuring MCP Servers](/mcp/adding-and-configuring-servers).
|
||||
|
||||
<Note>
|
||||
The CLI does not yet have a `/mcp` slash command for interactive management inside the terminal UI. Use `cline mcp add` or edit `cline_mcp_settings.json` directly.
|
||||
</Note>
|
||||
|
||||
### Custom Config Directory
|
||||
|
||||
If you use the `CLINE_DIR` environment variable or `--config` flag, the MCP settings file will be located at `<your-config-dir>/data/settings/cline_mcp_settings.json` instead.
|
||||
|
||||
## Configuration for Local Providers
|
||||
|
||||
### Ollama
|
||||
|
||||
Configure context window size for Ollama:
|
||||
|
||||
```bash
|
||||
# In settings or via config
|
||||
cline config
|
||||
# Navigate to Settings tab, find ollama-api-options-ctx-num
|
||||
```
|
||||
|
||||
Or set via environment:
|
||||
|
||||
```bash
|
||||
# Set context window to 32K tokens
|
||||
cline -m ollama/llama3 "your task"
|
||||
```
|
||||
|
||||
### LM Studio
|
||||
|
||||
Configure max tokens for LM Studio:
|
||||
|
||||
```bash
|
||||
cline config
|
||||
# Navigate to Settings tab, find lm-studio-max-tokens
|
||||
```
|
||||
|
||||
## Importing Configuration
|
||||
|
||||
### From VS Code Extension
|
||||
|
||||
If you use the Cline VS Code extension, the CLI automatically detects and can share some settings. However, the CLI maintains its own configuration for terminal-specific features.
|
||||
|
||||
### From Other CLI Tools
|
||||
|
||||
See [Installation & Setup](/cline-cli/installation#option-3-import-from-existing-tools) for importing configurations from:
|
||||
- Codex CLI
|
||||
- OpenCode
|
||||
|
||||
## Configuration Best Practices
|
||||
|
||||
### For Development
|
||||
|
||||
Use the default configuration with workspace-specific rules:
|
||||
|
||||
```bash
|
||||
# Add project-specific rules
|
||||
echo "Use TypeScript strict mode" > .clinerules/typescript.md
|
||||
```
|
||||
|
||||
### For CI/CD
|
||||
|
||||
Use environment variables and `--yolo` mode:
|
||||
|
||||
```bash
|
||||
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm test", "npm run build"]}'
|
||||
cline -y "run tests and fix any failures"
|
||||
```
|
||||
|
||||
### For Teams
|
||||
|
||||
Share configuration via version control:
|
||||
|
||||
```bash
|
||||
# Commit .clinerules/ to your repo
|
||||
git add .clinerules/
|
||||
git commit -m "Add Cline rules for team"
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Configuration Not Persisting
|
||||
|
||||
1. Check write permissions on `~/.cline/data/`
|
||||
2. Ensure `CLINE_DIR` isn't set to a read-only location
|
||||
3. Verify the config directory exists
|
||||
|
||||
### Environment Variables Not Working
|
||||
|
||||
1. Ensure variables are exported: `export CLINE_DIR=/path`
|
||||
2. Check for typos in variable names
|
||||
3. Verify JSON syntax for `CLINE_COMMAND_PERMISSIONS`
|
||||
|
||||
### Reset Configuration
|
||||
|
||||
To start fresh, remove the configuration directory:
|
||||
|
||||
```bash
|
||||
rm -rf ~/.cline/data/
|
||||
cline auth # Re-authenticate
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="Headless Mode" icon="robot" href="/cline-cli/three-core-flows">
|
||||
Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows.
|
||||
</Card>
|
||||
|
||||
<Card title="CLI Reference" icon="terminal" href="/cline-cli/cli-reference">
|
||||
Complete command documentation with all flags and options.
|
||||
</Card>
|
||||
</Columns>
|
||||
@@ -1,457 +0,0 @@
|
||||
---
|
||||
title: "Getting Started"
|
||||
description: "Run Cline AI coding agents directly in your terminal with an interactive CLI or automated workflows"
|
||||
---
|
||||
|
||||
## What is Cline CLI?
|
||||
|
||||
Cline CLI brings the full power of Cline to your terminal. Whether you prefer an interactive experience or automated workflows for CI/CD pipelines, the CLI adapts to your needs.
|
||||
|
||||
The CLI supports macOS, Linux, and Windows, and works with all the same AI providers as the VS Code extension.
|
||||
|
||||
## Two Ways to Use Cline CLI
|
||||
|
||||
The CLI operates in two distinct modes, automatically selecting the appropriate one based on how you invoke it:
|
||||
|
||||
### Interactive Mode
|
||||
|
||||
Interactive mode is designed for **hands-on development sessions** where you want to collaborate with Cline in real-time. It provides a rich terminal interface that feels like chatting with an AI assistant.
|
||||
|
||||
**When it activates:** Running `cline` without arguments, or when stdin is a TTY (terminal).
|
||||
|
||||
```bash
|
||||
cline
|
||||
```
|
||||
|
||||
Key features:
|
||||
|
||||
- **Real-time conversation** - Type messages, see Cline's responses, and iterate on tasks
|
||||
- **Visual feedback** - Animated welcome screen, syntax-highlighted code, and progress indicators
|
||||
- **File mentions** with `@` - Reference workspace files with fuzzy search autocomplete
|
||||
- **Slash commands** with `/` - Quick access to `/settings`, `/history`, `/models`, and workflows
|
||||
- **Keyboard shortcuts** - `Tab` to toggle Plan/Act, `Shift+Tab` for auto-approve all
|
||||
- **Session summaries** - See tasks completed, files modified, and token usage on exit
|
||||
- **Settings panel** - Configure providers, models, and features without leaving the CLI
|
||||
|
||||
Interactive mode keeps you in control. You review Cline's plan, approve or modify actions, and guide the conversation.
|
||||
|
||||
[Learn more about interactive mode →](/cline-cli/interactive-mode)
|
||||
|
||||
### Headless Mode (Non-Interactive)
|
||||
|
||||
Headless mode is designed for **automation, scripting, and CI/CD pipelines** where human interaction isn't possible or desired.
|
||||
|
||||
**When it activates:** Using the `-y`/`--yolo` flag, `--json` flag, piping input/output, or when stdin is not a TTY.
|
||||
|
||||
```bash
|
||||
# Headless with auto-approval (YOLO mode)
|
||||
cline -y "Run tests and fix any failures"
|
||||
|
||||
# Headless with JSON output for parsing
|
||||
cline --json "List all TODO comments" | jq '.text'
|
||||
|
||||
# Headless via piped input
|
||||
cat README.md | cline "Summarize this document"
|
||||
|
||||
# Chain multiple headless commands
|
||||
git diff | cline -y "explain these changes" | cline -y "write a commit message"
|
||||
```
|
||||
|
||||
Key features:
|
||||
|
||||
- **No visual interface** - Clean text or JSON output suitable for scripting
|
||||
- **Automatic execution** - With `-y`, Cline approves all actions and runs autonomously
|
||||
- **Process control** - Exits automatically when the task completes
|
||||
- **Piped workflows** - Read from stdin, write to stdout, chain with other commands
|
||||
- **Machine-readable output** - Use `--json` to get structured output for parsing
|
||||
|
||||
<Warning>
|
||||
Headless mode with `-y` gives Cline full autonomy. Run on a clean git branch so you can easily revert changes if needed.
|
||||
</Warning>
|
||||
|
||||
### Mode Detection Summary
|
||||
|
||||
Cline automatically detects which mode to use based on your invocation. This table shows how different command patterns trigger each mode, helping you predict behavior in scripts and interactive sessions.
|
||||
|
||||
| Invocation | Mode | Reason |
|
||||
|------------|------|--------|
|
||||
| `cline` | Interactive | No arguments, TTY connected |
|
||||
| `cline "task"` | Interactive | TTY connected |
|
||||
| `cline -y "task"` | Headless | YOLO flag forces headless |
|
||||
| `cline --json "task"` | Headless | JSON flag forces headless |
|
||||
| `cat file \| cline "task"` | Headless | stdin is piped |
|
||||
| `cline "task" > output.txt` | Headless | stdout is redirected |
|
||||
|
||||
[Learn more about headless mode →](/cline-cli/three-core-flows)
|
||||
|
||||
## Supported Model Providers
|
||||
|
||||
Cline CLI supports all providers available in the VS Code extension:
|
||||
|
||||
- **Anthropic** (Claude)
|
||||
- **OpenAI** (GPT-4o, GPT-4)
|
||||
- **OpenAI Codex** (ChatGPT subscription)
|
||||
- **OpenRouter**
|
||||
- **AWS Bedrock**
|
||||
- **Google Gemini**
|
||||
- **X AI (Grok)**
|
||||
- **Cerebras**
|
||||
- **DeepSeek**
|
||||
- **Ollama** (local models)
|
||||
- **LM Studio** (local models)
|
||||
- **OpenAI Compatible** (any compatible API)
|
||||
|
||||
During setup, authenticate with `cline auth` to configure your preferred provider. [See authentication →](#authenticate)
|
||||
|
||||
## What You Can Build
|
||||
|
||||
### Automated Code Maintenance
|
||||
|
||||
Keep your codebase healthy with automated fixes. Cline scans for issues and applies corrections across multiple files.
|
||||
|
||||
```bash
|
||||
cline -y "Fix all ESLint errors in src/"
|
||||
```
|
||||
Finds and fixes linting violations throughout your source directory.
|
||||
|
||||
```bash
|
||||
cline -y "Update all deprecated React lifecycle methods"
|
||||
```
|
||||
Migrates legacy code patterns to modern equivalents (e.g., `componentWillMount` → `useEffect`).
|
||||
|
||||
```bash
|
||||
cline -y "Update dependencies with known vulnerabilities"
|
||||
```
|
||||
Identifies outdated packages with security issues and updates them to safe versions.
|
||||
|
||||
### CI/CD Integration
|
||||
|
||||
Integrate Cline into your continuous integration pipelines for automated code review and documentation.
|
||||
|
||||
```bash
|
||||
git diff origin/main | cline -y "Review these changes for issues"
|
||||
```
|
||||
Pipes your PR diff to Cline for automated code review, catching bugs and style issues before merge.
|
||||
|
||||
```bash
|
||||
git log --oneline v1.0..v1.1 | cline -y "Write release notes"
|
||||
```
|
||||
Generates human-readable release notes from your commit history between two tags.
|
||||
|
||||
```bash
|
||||
cline -y "Run tests and fix failures" --timeout 600
|
||||
```
|
||||
Executes your test suite, analyzes failures, and attempts fixes with a 10-minute timeout.
|
||||
|
||||
### Development Workflows
|
||||
|
||||
From quick edits to complex refactors, Cline adapts to your workflow.
|
||||
|
||||
```bash
|
||||
cline
|
||||
```
|
||||
Launches interactive mode for exploratory development and back-and-forth collaboration.
|
||||
|
||||
```bash
|
||||
cline "Refactor this function to use async/await"
|
||||
```
|
||||
Executes a focused task directly from the command line with approval prompts at key steps.
|
||||
|
||||
```bash
|
||||
cline "Based on @src/api.ts, add error handling to all endpoints"
|
||||
```
|
||||
Uses file mentions (`@`) to give Cline context about specific files in your workspace.
|
||||
|
||||
### Custom Shell Pipelines
|
||||
|
||||
Chain Cline with other CLI tools to build powerful automation workflows.
|
||||
|
||||
```bash
|
||||
gh pr diff 123 | cline -y "Review this PR"
|
||||
```
|
||||
Fetches a GitHub PR diff and pipes it directly to Cline for review.
|
||||
|
||||
```bash
|
||||
cline --json "List all TODO comments" | jq '.text'
|
||||
```
|
||||
Outputs structured JSON that you can process with tools like `jq` for scripting.
|
||||
|
||||
```bash
|
||||
git diff | cline -y "explain" | cline -y "write a haiku about these changes"
|
||||
```
|
||||
Chains multiple Cline invocations together for creative multi-step workflows.
|
||||
|
||||
## Features at a Glance
|
||||
|
||||
| Feature | Interactive Mode | Non-Interactive Mode |
|
||||
|---------|------------------|----------------------|
|
||||
| Interactive chat | ✓ | - |
|
||||
| File mentions (@) | ✓ | ✓ (inline) |
|
||||
| Slash commands (/) | ✓ | - |
|
||||
| Settings panel | ✓ | `cline config` |
|
||||
| Plan/Act toggle | ✓ (Tab) | `-p` / `-a` flags |
|
||||
| Auto-approve | ✓ (Shift+Tab) | `-y` flag |
|
||||
| Session summary | ✓ | - |
|
||||
| JSON output | - | `--json` |
|
||||
| Piped input | - | ✓ |
|
||||
|
||||
---
|
||||
|
||||
## Installation & Setup
|
||||
|
||||
In just a few minutes, you can install the CLI, authenticate with your preferred AI provider, and start running tasks from any directory on your machine.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
Cline CLI requires **Node.js version 20 or higher**. We recommend Node.js 22 for the best experience.
|
||||
|
||||
Check your Node.js version:
|
||||
|
||||
```bash
|
||||
node --version
|
||||
```
|
||||
|
||||
If you need to install or update Node.js, visit [nodejs.org](https://nodejs.org) or use a version manager like [nvm](https://github.com/nvm-sh/nvm).
|
||||
|
||||
### Install Cline CLI
|
||||
|
||||
Install globally via npm:
|
||||
|
||||
```bash
|
||||
npm install -g cline
|
||||
```
|
||||
|
||||
Verify the installation:
|
||||
|
||||
```bash
|
||||
cline version
|
||||
```
|
||||
|
||||
<Tip>
|
||||
To install a specific version, use `npm install -g cline@2.0.0`. Check [npm](https://www.npmjs.com/package/cline) for available versions.
|
||||
</Tip>
|
||||
|
||||
### Authenticate
|
||||
|
||||
After installation, run the authentication wizard:
|
||||
|
||||
```bash
|
||||
cline auth
|
||||
```
|
||||
|
||||
This launches an interactive wizard with multiple options. Choose the method that works best for your workflow.
|
||||
|
||||
#### Option 1: Sign in with Cline (Recommended)
|
||||
|
||||
Select **"Sign in with Cline"** to authenticate with your Cline account via OAuth. Your browser opens automatically to complete sign-in.
|
||||
|
||||
#### Option 2: Sign in with ChatGPT Subscription
|
||||
|
||||
If you have a ChatGPT Plus or Pro subscription, select **"Sign in with ChatGPT Subscription"**. This uses OpenAI's Codex OAuth to authenticate with your existing subscription.
|
||||
|
||||
#### Option 3: Import from Existing Tools
|
||||
|
||||
Already using another AI coding CLI? Cline can import your existing configuration:
|
||||
|
||||
- **Import from Codex CLI** - Imports credentials from `~/.codex/auth.json`
|
||||
- **Import from OpenCode** - Imports configuration from `~/.local/share/opencode/auth.json`
|
||||
|
||||
#### Option 4: Bring Your Own API Key
|
||||
|
||||
Select **"Bring your own API key"** to manually configure any supported provider. Or skip the wizard entirely with flags:
|
||||
|
||||
```bash
|
||||
# Anthropic (Claude)
|
||||
cline auth -p anthropic -k sk-ant-api-xxxxx -m claude-sonnet-4-5-20250929
|
||||
|
||||
# OpenAI
|
||||
cline auth -p openai-native -k sk-xxxxx -m gpt-4o
|
||||
|
||||
# OpenRouter
|
||||
cline auth -p openrouter -k sk-or-xxxxx -m anthropic/claude-sonnet-4-5-20250929
|
||||
|
||||
# OpenAI-compatible provider with custom base URL
|
||||
cline auth -p openai -k your-api-key -b https://api.example.com/v1
|
||||
```
|
||||
|
||||
**Quick Setup Flags:**
|
||||
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `-p, --provider <id>` | Provider ID (e.g., `anthropic`, `openai-native`, `openrouter`) |
|
||||
| `-k, --apikey <key>` | Your API key |
|
||||
| `-m, --modelid <id>` | Model ID (e.g., `claude-sonnet-4-5-20250929`, `gpt-4o`) |
|
||||
| `-b, --baseurl <url>` | Base URL for OpenAI-compatible providers |
|
||||
|
||||
<Tip>
|
||||
Flags are especially useful for scripting, CI/CD environments, or setting up multiple machines.
|
||||
</Tip>
|
||||
|
||||
#### Supported Providers
|
||||
|
||||
| Provider | Provider ID | Notes |
|
||||
|----------|-------------|-------|
|
||||
| Anthropic | `anthropic` | Direct Claude API access |
|
||||
| OpenAI | `openai-native` | GPT-4o, GPT-4, etc. |
|
||||
| OpenAI Codex | `openai-codex` | ChatGPT subscription OAuth |
|
||||
| OpenRouter | `openrouter` | Access multiple providers |
|
||||
| AWS Bedrock | `bedrock` | Claude via AWS |
|
||||
| Google Gemini | `gemini` | Gemini Pro, etc. |
|
||||
| X AI (Grok) | `xai` | Grok models |
|
||||
| Cerebras | `cerebras` | Fast inference |
|
||||
| DeepSeek | `deepseek` | DeepSeek models |
|
||||
| Ollama | `ollama` | Local models |
|
||||
| LM Studio | `lmstudio` | Local models |
|
||||
| OpenAI Compatible | `openai` | Any OpenAI-compatible API |
|
||||
|
||||
### Verify Your Setup
|
||||
|
||||
Confirm everything is working with a simple test:
|
||||
|
||||
```bash
|
||||
cline "What is 2 + 2?"
|
||||
```
|
||||
|
||||
If Cline responds with an answer, your installation and authentication are complete.
|
||||
|
||||
Check your current configuration:
|
||||
|
||||
```bash
|
||||
cline config
|
||||
```
|
||||
|
||||
### Quick Start
|
||||
|
||||
Now you're ready to use Cline. Choose how you want to work:
|
||||
|
||||
#### Interactive Mode
|
||||
|
||||
Launch the interactive CLI for development:
|
||||
|
||||
```bash
|
||||
cline
|
||||
```
|
||||
|
||||
You'll see the Cline welcome screen. Type your task and press Enter. Use:
|
||||
- `Tab` to toggle between Plan and Act modes
|
||||
- `Shift+Tab` to enable auto-approve
|
||||
- `/help` for available commands
|
||||
|
||||
[Learn more about interactive mode →](/cline-cli/interactive-mode)
|
||||
|
||||
#### Direct Task Execution
|
||||
|
||||
Run a task directly from your shell:
|
||||
|
||||
```bash
|
||||
cline "Add error handling to utils.js"
|
||||
```
|
||||
|
||||
For non-interactive execution (perfect for scripts and CI/CD):
|
||||
|
||||
```bash
|
||||
cline -y "Run tests and fix any failures"
|
||||
```
|
||||
|
||||
[Learn more about headless mode →](/cline-cli/three-core-flows)
|
||||
|
||||
### Switching Providers
|
||||
|
||||
To change your configured provider at any time:
|
||||
|
||||
```bash
|
||||
cline auth
|
||||
```
|
||||
|
||||
You can also use the settings panel in interactive mode:
|
||||
|
||||
```bash
|
||||
cline
|
||||
# Then type: /settings
|
||||
# Navigate to the API tab
|
||||
```
|
||||
|
||||
### Updating
|
||||
|
||||
Check for updates and install the latest version:
|
||||
|
||||
```bash
|
||||
cline update
|
||||
```
|
||||
|
||||
Or update manually via npm:
|
||||
|
||||
```bash
|
||||
npm update -g cline
|
||||
```
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
#### Command Not Found
|
||||
|
||||
If `cline` is not found after installation:
|
||||
|
||||
1. Ensure npm global bin is in your PATH:
|
||||
```bash
|
||||
npm bin -g
|
||||
```
|
||||
|
||||
2. Add the path to your shell configuration (`.bashrc`, `.zshrc`, etc.):
|
||||
```bash
|
||||
export PATH="$PATH:$(npm bin -g)"
|
||||
```
|
||||
|
||||
3. Restart your terminal or source your shell config.
|
||||
|
||||
#### Permission Errors
|
||||
|
||||
If you get permission errors during installation:
|
||||
|
||||
```bash
|
||||
# Option 1: Use a Node version manager (recommended)
|
||||
# nvm, fnm, or volta handle permissions automatically
|
||||
|
||||
# Option 2: Fix npm permissions
|
||||
# See: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
|
||||
```
|
||||
|
||||
#### OAuth Flow Issues
|
||||
|
||||
If the browser doesn't open automatically during OAuth:
|
||||
1. Copy the URL from the terminal
|
||||
2. Paste it in your browser manually
|
||||
3. Complete the sign-in flow
|
||||
4. Return to the terminal
|
||||
|
||||
#### API Key Validation
|
||||
|
||||
If your API key is rejected:
|
||||
1. Verify the key is correct and hasn't expired
|
||||
2. Check that you've selected the correct provider
|
||||
3. Ensure your API account has the necessary permissions
|
||||
|
||||
**Provider-specific tips:**
|
||||
- **Anthropic**: Keys start with `sk-ant-`
|
||||
- **OpenAI**: Keys start with `sk-`
|
||||
- **AWS Bedrock**: Requires AWS credentials configured separately. See [AWS Bedrock documentation](/provider-config/aws-bedrock/api-key).
|
||||
|
||||
### Uninstallation
|
||||
|
||||
To remove Cline CLI:
|
||||
|
||||
```bash
|
||||
npm uninstall -g cline
|
||||
```
|
||||
|
||||
To also remove configuration data:
|
||||
|
||||
```bash
|
||||
rm -rf ~/.cline
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
- **[Interactive Mode](/cline-cli/interactive-mode)** - Master the interactive CLI with shortcuts and slash commands
|
||||
- **[Headless Mode](/cline-cli/three-core-flows)** - Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows
|
||||
- **[Configuration](/cline-cli/configuration)** - Configure settings, rules, workflows, and environment variables
|
||||
- **[CLI Reference](/cline-cli/cli-reference)** - Complete command documentation with all flags and options
|
||||
@@ -1,278 +0,0 @@
|
||||
---
|
||||
title: "Installation & Setup"
|
||||
description: "Install Cline CLI on macOS, Linux, or Windows and configure your AI provider"
|
||||
---
|
||||
|
||||
Cline CLI brings the full power of Cline to your terminal. In just a few minutes, you can install the CLI, authenticate with your preferred AI provider, and start running tasks from any directory on your machine.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Cline CLI requires **Node.js version 20 or higher**. We recommend Node.js 22 for the best experience.
|
||||
|
||||
Check your Node.js version:
|
||||
|
||||
```bash
|
||||
node --version
|
||||
```
|
||||
|
||||
If you need to install or update Node.js, visit [nodejs.org](https://nodejs.org) or use a version manager like [nvm](https://github.com/nvm-sh/nvm).
|
||||
|
||||
## Install Cline CLI
|
||||
|
||||
Install globally via npm:
|
||||
|
||||
```bash
|
||||
npm install -g cline
|
||||
```
|
||||
|
||||
Verify the installation:
|
||||
|
||||
```bash
|
||||
cline version
|
||||
```
|
||||
|
||||
<Tip>
|
||||
To install a specific version, use `npm install -g cline@2.0.0`. Check [npm](https://www.npmjs.com/package/cline) for available versions.
|
||||
</Tip>
|
||||
|
||||
## Authenticate
|
||||
|
||||
After installation, run the authentication wizard:
|
||||
|
||||
```bash
|
||||
cline auth
|
||||
```
|
||||
|
||||
This launches an interactive wizard with multiple options. Choose the method that works best for your workflow.
|
||||
|
||||
### Option 1: Sign in with Cline (Recommended)
|
||||
|
||||
Select **"Sign in with Cline"** to authenticate with your Cline account via OAuth. Your browser opens automatically to complete sign-in.
|
||||
|
||||
### Option 2: Sign in with ChatGPT Subscription
|
||||
|
||||
If you have a ChatGPT Plus or Pro subscription, select **"Sign in with ChatGPT Subscription"**. This uses OpenAI's Codex OAuth to authenticate with your existing subscription.
|
||||
|
||||
### Option 3: Import from Existing Tools
|
||||
|
||||
Already using another AI coding CLI? Cline can import your existing configuration:
|
||||
|
||||
- **Import from Codex CLI** - Imports credentials from `~/.codex/auth.json`
|
||||
- **Import from OpenCode** - Imports configuration from `~/.local/share/opencode/auth.json`
|
||||
|
||||
### Option 4: Bring Your Own API Key
|
||||
|
||||
Select **"Bring your own API key"** to manually configure any supported provider. Or skip the wizard entirely with flags:
|
||||
|
||||
```bash
|
||||
# Anthropic (Claude)
|
||||
cline auth -p anthropic -k sk-ant-api-xxxxx -m claude-sonnet-4-5-20250929
|
||||
|
||||
# OpenAI
|
||||
cline auth -p openai-native -k sk-xxxxx -m gpt-4o
|
||||
|
||||
# OpenRouter
|
||||
cline auth -p openrouter -k sk-or-xxxxx -m anthropic/claude-sonnet-4-5-20250929
|
||||
|
||||
# Moonshot
|
||||
cline auth -p moonshot -k sk-xxxxx -m kimi-k2.5
|
||||
|
||||
# OpenAI-compatible provider with custom base URL
|
||||
cline auth -p openai -k your-api-key -b https://api.example.com/v1
|
||||
```
|
||||
|
||||
**Quick Setup Flags:**
|
||||
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `-p, --provider <id>` | Provider ID (e.g., `anthropic`, `openai-native`, `openrouter`, `moonshot`) |
|
||||
| `-k, --apikey <key>` | Your API key |
|
||||
| `-m, --modelid <id>` | Model ID (e.g., `claude-sonnet-4-5-20250929`, `gpt-4o`) |
|
||||
| `-b, --baseurl <url>` | Base URL for OpenAI-compatible providers |
|
||||
|
||||
<Tip>
|
||||
Flags are especially useful for scripting, CI/CD environments, or setting up multiple machines.
|
||||
</Tip>
|
||||
|
||||
### Supported Providers
|
||||
|
||||
| Provider | Provider ID | Notes |
|
||||
|----------|-------------|-------|
|
||||
| Anthropic | `anthropic` | Direct Claude API access |
|
||||
| OpenAI | `openai-native` | GPT-4o, GPT-4, etc. |
|
||||
| OpenAI Codex | `openai-codex` | ChatGPT subscription OAuth |
|
||||
| OpenRouter | `openrouter` | Access multiple providers |
|
||||
| AWS Bedrock | `bedrock` | Claude via AWS |
|
||||
| Google Gemini | `gemini` | Gemini Pro, etc. |
|
||||
| X AI (Grok) | `xai` | Grok models |
|
||||
| Cerebras | `cerebras` | Fast inference |
|
||||
| DeepSeek | `deepseek` | DeepSeek models |
|
||||
| Moonshot | `moonshot` | Kimi models via Moonshot AI |
|
||||
| Ollama | `ollama` | Local models |
|
||||
| LM Studio | `lmstudio` | Local models |
|
||||
| OpenAI Compatible | `openai` | Any OpenAI-compatible API |
|
||||
|
||||
## Verify Your Setup
|
||||
|
||||
Confirm everything is working with a simple test:
|
||||
|
||||
```bash
|
||||
cline "What is 2 + 2?"
|
||||
```
|
||||
|
||||
If Cline responds with an answer, your installation and authentication are complete.
|
||||
|
||||
Check your current configuration:
|
||||
|
||||
```bash
|
||||
cline config
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
||||
Now you're ready to use Cline. Choose how you want to work:
|
||||
|
||||
### Interactive Mode
|
||||
|
||||
Launch the interactive CLI for development:
|
||||
|
||||
```bash
|
||||
cline
|
||||
```
|
||||
|
||||
You'll see the Cline welcome screen. Type your task and press Enter. Use:
|
||||
- `Tab` to toggle between Plan and Act modes
|
||||
- `Shift+Tab` to enable auto-approve
|
||||
- `/help` for available commands
|
||||
|
||||
[Learn more about interactive mode →](/cline-cli/interactive-mode)
|
||||
|
||||
### Direct Task Execution
|
||||
|
||||
Run a task directly from your shell:
|
||||
|
||||
```bash
|
||||
cline "Add error handling to utils.js"
|
||||
```
|
||||
|
||||
For non-interactive execution (perfect for scripts and CI/CD):
|
||||
|
||||
```bash
|
||||
cline -y "Run tests and fix any failures"
|
||||
```
|
||||
|
||||
[Learn more about headless mode →](/cline-cli/three-core-flows)
|
||||
|
||||
## Switching Providers
|
||||
|
||||
To change your configured provider at any time:
|
||||
|
||||
```bash
|
||||
cline auth
|
||||
```
|
||||
|
||||
You can also use the settings panel in interactive mode:
|
||||
|
||||
```bash
|
||||
cline
|
||||
# Then type: /settings
|
||||
# Navigate to the API tab
|
||||
```
|
||||
|
||||
## Updating
|
||||
|
||||
Check for updates and install the latest version:
|
||||
|
||||
```bash
|
||||
cline update
|
||||
```
|
||||
|
||||
Or update manually via npm:
|
||||
|
||||
```bash
|
||||
npm update -g cline
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Command Not Found
|
||||
|
||||
If `cline` is not found after installation:
|
||||
|
||||
1. Ensure npm global bin is in your PATH:
|
||||
```bash
|
||||
npm bin -g
|
||||
```
|
||||
|
||||
2. Add the path to your shell configuration (`.bashrc`, `.zshrc`, etc.):
|
||||
```bash
|
||||
export PATH="$PATH:$(npm bin -g)"
|
||||
```
|
||||
|
||||
3. Restart your terminal or source your shell config.
|
||||
|
||||
### Permission Errors
|
||||
|
||||
If you get permission errors during installation:
|
||||
|
||||
```bash
|
||||
# Option 1: Use a Node version manager (recommended)
|
||||
# nvm, fnm, or volta handle permissions automatically
|
||||
|
||||
# Option 2: Fix npm permissions
|
||||
# See: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
|
||||
```
|
||||
|
||||
### OAuth Flow Issues
|
||||
|
||||
If the browser doesn't open automatically during OAuth:
|
||||
1. Copy the URL from the terminal
|
||||
2. Paste it in your browser manually
|
||||
3. Complete the sign-in flow
|
||||
4. Return to the terminal
|
||||
|
||||
### API Key Validation
|
||||
|
||||
If your API key is rejected:
|
||||
1. Verify the key is correct and hasn't expired
|
||||
2. Check that you've selected the correct provider
|
||||
3. Ensure your API account has the necessary permissions
|
||||
|
||||
**Provider-specific tips:**
|
||||
- **Anthropic**: Keys start with `sk-ant-`
|
||||
- **OpenAI**: Keys start with `sk-`
|
||||
- **AWS Bedrock**: Requires AWS credentials configured separately. See [AWS Bedrock documentation](/provider-config/aws-bedrock/api-key).
|
||||
|
||||
## Uninstallation
|
||||
|
||||
To remove Cline CLI:
|
||||
|
||||
```bash
|
||||
npm uninstall -g cline
|
||||
```
|
||||
|
||||
To also remove configuration data:
|
||||
|
||||
```bash
|
||||
rm -rf ~/.cline
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="Interactive Mode" icon="terminal" href="/cline-cli/interactive-mode">
|
||||
Master the interactive CLI with shortcuts and slash commands.
|
||||
</Card>
|
||||
|
||||
<Card title="Headless Mode" icon="robot" href="/cline-cli/three-core-flows">
|
||||
Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows.
|
||||
</Card>
|
||||
|
||||
<Card title="Configuration" icon="gear" href="/cline-cli/configuration">
|
||||
Configure settings, rules, workflows, and environment variables.
|
||||
</Card>
|
||||
|
||||
<Card title="CLI Reference" icon="book" href="/cline-cli/cli-reference">
|
||||
Complete command documentation with all flags and options.
|
||||
</Card>
|
||||
</Columns>
|
||||
@@ -1,252 +0,0 @@
|
||||
---
|
||||
title: "Interactive Mode"
|
||||
description: "Master the interactive CLI with keyboard shortcuts, slash commands, and file mentions"
|
||||
---
|
||||
|
||||
Interactive mode is the primary way to work with Cline CLI when you want a collaborative, conversational experience. Unlike headless mode (which runs a single task and exits), interactive mode keeps a session open where you can have back-and-forth conversations with Cline, refine your requests, and guide the AI as it works.
|
||||
|
||||
## Why Use Interactive Mode?
|
||||
|
||||
Interactive mode is ideal when you:
|
||||
|
||||
- **Don't know exactly what you need yet** - Explore a codebase, ask questions, and let Cline help you understand the architecture before making changes
|
||||
- **Want to review before acting** - Toggle Plan mode to see Cline's strategy, then switch to Act mode when you're ready
|
||||
- **Need iterative refinement** - Build on previous responses, ask follow-up questions, and guide Cline to the right solution
|
||||
- **Prefer human oversight** - Review each action, approve file changes, and maintain control over what Cline does
|
||||
- **Working on complex tasks** - Multi-step refactoring, debugging sessions, or feature development that requires judgment calls
|
||||
|
||||
For automated workflows, scripts, or CI/CD pipelines, see [headless mode](/cline-cli/overview#headless-mode-non-interactive) instead.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before using interactive mode, you need to have Cline CLI installed and authenticated. If you haven't done this yet, follow the [Installation & Setup guide](/cline-cli/installation) first.
|
||||
|
||||
## Launching Interactive Mode
|
||||
|
||||
Start interactive mode by running `cline` without any arguments:
|
||||
|
||||
```bash
|
||||
cline
|
||||
```
|
||||
|
||||
You'll see an animated welcome screen with the Cline robot. Start typing your task in the input field at the bottom of the screen.
|
||||
|
||||
## Keyboard Shortcuts
|
||||
|
||||
Keyboard shortcuts are the primary way to navigate and control the interactive CLI. Since there's no mouse interaction in the terminal, learning these shortcuts will help you work efficiently and switch between modes, manage input, and control your session without breaking your flow.
|
||||
|
||||
### Mode Controls
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| `Tab` | Toggle between Plan and Act mode |
|
||||
| `Shift+Tab` | Toggle auto-approve all actions |
|
||||
| `Esc` | Exit or cancel current operation |
|
||||
|
||||
### Input Controls
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| `Enter` | Submit your message |
|
||||
| `↑` / `↓` | Navigate message history |
|
||||
| `Home` / `End` | Move cursor to start/end of line |
|
||||
| `Ctrl+A` | Move cursor to beginning |
|
||||
| `Ctrl+E` | Move cursor to end |
|
||||
| `Ctrl+W` | Delete word before cursor |
|
||||
| `Ctrl+U` | Delete entire line |
|
||||
|
||||
### Session Controls
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| `Ctrl+C` | Exit with session summary |
|
||||
|
||||
## File Mentions with @
|
||||
|
||||
Reference files from your workspace by typing `@` followed by the filename:
|
||||
|
||||
```text
|
||||
@src/utils.ts can you add error handling to this file?
|
||||
```
|
||||
|
||||
As you type after `@`, Cline shows a fuzzy search dropdown of matching files. Use arrow keys to navigate and `Enter` to select.
|
||||
|
||||
<Tip>
|
||||
File search uses ripgrep for fast, fuzzy matching. You can type partial paths like `@utils` to find `src/utils/helpers.ts`.
|
||||
</Tip>
|
||||
|
||||
### Multiple File Mentions
|
||||
|
||||
Include multiple files in a single message:
|
||||
|
||||
```text
|
||||
Compare @src/old-api.ts with @src/new-api.ts and list the breaking changes
|
||||
```
|
||||
|
||||
## Slash Commands
|
||||
|
||||
Type `/` to see available commands. Slash commands provide quick access to settings, history, and workflows.
|
||||
|
||||
### Built-in Commands
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `/settings` | Open the settings panel |
|
||||
| `/models` | Quick model switching |
|
||||
| `/history` | Browse and resume previous tasks |
|
||||
| `/clear` | Start a fresh task (clears current conversation) |
|
||||
| `/help` | Show help and available commands |
|
||||
| `/exit` | Exit the CLI |
|
||||
|
||||
### Workflow Commands
|
||||
|
||||
If you have [workflows](/customization/workflows) configured, they appear as additional slash commands. For example, if you have a workflow named `code-review`, you can invoke it with:
|
||||
|
||||
```text
|
||||
/code-review
|
||||
```
|
||||
|
||||
## Settings Panel
|
||||
|
||||
Access the settings panel with `/settings`. Navigate between tabs using arrow keys.
|
||||
|
||||
| Tab | Description | Settings |
|
||||
|-----|-------------|----------|
|
||||
| **API** | Configure your AI provider and model | Provider selection, model choice, extended thinking toggle, thinking budget |
|
||||
| **Auto-approve** | Control which actions Cline can perform without prompting | Read files, write files, execute commands, browser actions, MCP tools |
|
||||
| **Features** | Toggle Cline capabilities | Hooks, skills, auto-compact, sound notifications |
|
||||
| **Account** | Manage your Cline account | View account status, sign in/out, manage subscription |
|
||||
| **Other** | Additional preferences | Theme preferences, debug options |
|
||||
|
||||
## Plan and Act Modes
|
||||
|
||||
Cline operates in two modes, toggled with `Tab`. These modes work the same way in the CLI as they do in the VS Code extension. For a deeper explanation of how Plan and Act modes work, see the [Plan and Act documentation](/core-workflows/plan-and-act).
|
||||
|
||||
### Plan Mode
|
||||
|
||||
In Plan mode, Cline analyzes your request and creates a strategy before making changes. Use this when:
|
||||
- Exploring a new codebase
|
||||
- Working on complex refactoring
|
||||
- You want to review the approach first
|
||||
|
||||
### Act Mode
|
||||
|
||||
In Act mode, Cline executes tasks directly. Use this when:
|
||||
- You're confident in the task
|
||||
- Making straightforward changes
|
||||
- Running quick operations
|
||||
|
||||
<Tip>
|
||||
Press `Tab` anytime to switch modes. Starting in Plan mode and switching to Act after reviewing is a common workflow.
|
||||
</Tip>
|
||||
|
||||
## Auto-approve Toggle
|
||||
|
||||
Press `Shift+Tab` to toggle auto-approve for all actions. This removes the approval prompts that appear before each action, letting Cline work continuously without interruption.
|
||||
|
||||
### When to Enable Auto-approve
|
||||
|
||||
Auto-approve is useful when:
|
||||
- **You trust the task** - Well-defined tasks where you're confident in the outcome
|
||||
- **Speed matters** - Long-running tasks where constant approvals slow you down
|
||||
- **You're watching anyway** - You can see Cline's work in real-time and can interrupt if needed
|
||||
- **Iterating quickly** - Rapid prototyping where you want to see results fast
|
||||
|
||||
### What Gets Auto-approved
|
||||
|
||||
When enabled, these actions happen without prompting:
|
||||
- File reads
|
||||
- File writes
|
||||
- Command execution
|
||||
- Browser actions
|
||||
- MCP tool calls
|
||||
|
||||
You can also configure granular auto-approve settings (e.g., auto-approve reads but not writes) via `/settings` → Auto-approve tab, or see the [Auto-approve documentation](/features/auto-approve) for more details.
|
||||
|
||||
<Warning>
|
||||
Auto-approve gives Cline full autonomy. Use on a clean git branch so you can easily revert changes if needed. You can always press `Ctrl+C` to stop Cline immediately.
|
||||
</Warning>
|
||||
|
||||
## Session Summary
|
||||
|
||||
When you exit with `Ctrl+C`, Cline displays a session summary showing:
|
||||
- Tasks completed
|
||||
- Files modified
|
||||
- Commands executed
|
||||
- Token usage
|
||||
|
||||
This helps you track what was accomplished during your session.
|
||||
|
||||
## Running Multiple Instances
|
||||
|
||||
By default, all CLI instances share the same settings and state. However, you may want to run isolated instances with separate configurations for scenarios like:
|
||||
|
||||
- **Different models for different tasks** - Use a fast, cheap model for quick questions in one terminal and a more capable model for complex refactoring in another
|
||||
- **Separate work and personal projects** - Keep API keys, rules, and task history isolated between contexts
|
||||
- **Testing configuration changes** - Experiment with new settings without affecting your main setup
|
||||
- **Team vs. individual settings** - Use shared team configuration for work projects and personal preferences for side projects
|
||||
|
||||
To run isolated instances, use the `--config` flag with different directories:
|
||||
|
||||
```bash
|
||||
# Work instance with team configuration
|
||||
cline --config ~/.cline-work
|
||||
|
||||
# Personal instance with different model/provider
|
||||
cline --config ~/.cline-personal
|
||||
|
||||
# Experimental instance for testing new settings
|
||||
cline --config ~/.cline-test
|
||||
```
|
||||
|
||||
Each config directory maintains its own provider settings, API keys, task history, and preferences.
|
||||
|
||||
<Tip>
|
||||
Use terminal multiplexers like tmux or split terminals to run multiple Cline instances in parallel, each working on different parts of your project with different models or settings.
|
||||
</Tip>
|
||||
|
||||
## Tips for Effective Usage
|
||||
|
||||
### Start with Context
|
||||
|
||||
Give Cline context about what you're working on:
|
||||
|
||||
```text
|
||||
I'm building a REST API with Express. The routes are in @src/routes/ and models in @src/models/. Help me add user authentication.
|
||||
```
|
||||
|
||||
### Use Plan Mode for Exploration
|
||||
|
||||
When you're unsure about the best approach:
|
||||
|
||||
```text
|
||||
[Tab to Plan mode]
|
||||
How should I structure the database schema for a multi-tenant SaaS app?
|
||||
```
|
||||
|
||||
### Iterate with Follow-ups
|
||||
|
||||
The interactive CLI maintains conversation context. Build on previous messages:
|
||||
|
||||
```text
|
||||
> Add a login endpoint
|
||||
[Cline creates the endpoint]
|
||||
|
||||
> Now add rate limiting to it
|
||||
[Cline modifies the same endpoint]
|
||||
|
||||
> Add tests for both features
|
||||
[Cline creates test files]
|
||||
```
|
||||
|
||||
## Next Steps
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="Headless Mode" icon="robot" href="/cline-cli/three-core-flows">
|
||||
Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows.
|
||||
</Card>
|
||||
|
||||
<Card title="Configuration" icon="gear" href="/cline-cli/configuration">
|
||||
Explore `cline config` and advanced configuration options.
|
||||
</Card>
|
||||
</Columns>
|
||||
@@ -1,246 +0,0 @@
|
||||
---
|
||||
title: "Overview"
|
||||
description: "Run Cline AI coding agents directly in your terminal with an interactive CLI or automated workflows"
|
||||
---
|
||||
|
||||
## What is Cline CLI?
|
||||
|
||||
Cline CLI brings the full power of Cline to your terminal. Whether you prefer an interactive experience or automated workflows for CI/CD pipelines, the CLI adapts to your needs.
|
||||
|
||||
The CLI supports macOS, Linux, and Windows, and works with all the same AI providers as the VS Code extension.
|
||||
|
||||
<Tip>
|
||||
Ready to get started? Check out the [installation guide](/cline-cli/installation) to install Cline CLI and run your first task.
|
||||
</Tip>
|
||||
|
||||
## Two Ways to Use Cline CLI
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="Interactive Mode" icon="terminal" href="/cline-cli/interactive-mode">
|
||||
**For hands-on development.** Launch `cline` in your terminal and collaborate with Cline in real-time — chat, review plans, approve actions, and iterate on tasks with a rich visual interface.
|
||||
</Card>
|
||||
<Card title="Headless Mode" icon="robot" href="/cline-cli/three-core-flows">
|
||||
**For automation & CI/CD.** Run `cline -y "task"` to let Cline work autonomously — no interaction needed. Pipe input/output, get JSON results, and chain commands in scripts and pipelines.
|
||||
</Card>
|
||||
</Columns>
|
||||
|
||||
The CLI operates in two distinct modes, automatically selecting the appropriate one based on how you invoke it:
|
||||
|
||||
### Interactive Mode
|
||||
|
||||
Interactive mode is designed for **hands-on development sessions** where you want to collaborate with Cline in real-time. It provides a rich terminal interface that feels like chatting with an AI assistant.
|
||||
|
||||
**When it activates:** Running `cline` without arguments, or when stdin is a TTY (terminal).
|
||||
|
||||
```bash
|
||||
cline
|
||||
```
|
||||
|
||||
Key features:
|
||||
|
||||
- **Real-time conversation** - Type messages, see Cline's responses, and iterate on tasks
|
||||
- **Visual feedback** - Animated welcome screen, syntax-highlighted code, and progress indicators
|
||||
- **File mentions** with `@` - Reference workspace files with fuzzy search autocomplete
|
||||
- **Slash commands** with `/` - Quick access to `/settings`, `/history`, `/models`, and workflows
|
||||
- **Keyboard shortcuts** - `Tab` to toggle Plan/Act, `Shift+Tab` for auto-approve all
|
||||
- **Session summaries** - See tasks completed, files modified, and token usage on exit
|
||||
- **Settings panel** - Configure providers, models, and features without leaving the CLI
|
||||
|
||||
Interactive mode keeps you in control. You review Cline's plan, approve or modify actions, and guide the conversation.
|
||||
|
||||
[Learn more about interactive mode →](/cline-cli/interactive-mode)
|
||||
|
||||
### Headless Mode (Non-Interactive)
|
||||
|
||||
Headless mode is designed for **automation, scripting, and CI/CD pipelines** where human interaction isn't possible or desired.
|
||||
|
||||
**When it activates:** Using the `-y`/`--yolo` flag, `--json` flag, piping input/output, or when stdin is not a TTY.
|
||||
|
||||
```bash
|
||||
# Headless with auto-approval (YOLO mode)
|
||||
cline -y "Run tests and fix any failures"
|
||||
|
||||
# Headless with JSON output for parsing
|
||||
cline --json "List all TODO comments" | jq '.text'
|
||||
|
||||
# Headless via piped input
|
||||
cat README.md | cline "Summarize this document"
|
||||
|
||||
# Chain multiple headless commands
|
||||
git diff | cline -y "explain these changes" | cline -y "write a commit message"
|
||||
```
|
||||
|
||||
Key features:
|
||||
|
||||
- **No visual interface** - Clean text or JSON output suitable for scripting
|
||||
- **Automatic execution** - With `-y`, Cline approves all actions and runs autonomously
|
||||
- **Process control** - Exits automatically when the task completes
|
||||
- **Piped workflows** - Read from stdin, write to stdout, chain with other commands
|
||||
- **Machine-readable output** - Use `--json` to get structured output for parsing
|
||||
|
||||
<Warning>
|
||||
Headless mode with `-y` gives Cline full autonomy. Run on a clean git branch so you can easily revert changes if needed.
|
||||
</Warning>
|
||||
|
||||
### Mode Detection Summary
|
||||
|
||||
Cline automatically detects which mode to use based on your invocation. This table shows how different command patterns trigger each mode, helping you predict behavior in scripts and interactive sessions.
|
||||
|
||||
| Invocation | Mode | Reason |
|
||||
|------------|------|--------|
|
||||
| `cline` | Interactive | No arguments, TTY connected |
|
||||
| `cline "task"` | Interactive | TTY connected |
|
||||
| `cline -y "task"` | Headless | YOLO flag forces headless |
|
||||
| `cline --json "task"` | Headless | JSON flag forces headless |
|
||||
| `cat file \| cline "task"` | Headless | stdin is piped |
|
||||
| `cline "task" > output.txt` | Headless | stdout is redirected |
|
||||
|
||||
[Learn more about headless mode →](/cline-cli/three-core-flows)
|
||||
|
||||
## Supported Model Providers
|
||||
|
||||
Cline CLI supports all providers available in the VS Code extension:
|
||||
|
||||
- **Anthropic** (Claude)
|
||||
- **OpenAI** (GPT-4o, GPT-4)
|
||||
- **OpenAI Codex** (ChatGPT subscription)
|
||||
- **OpenRouter**
|
||||
- **AWS Bedrock**
|
||||
- **Google Gemini**
|
||||
- **X AI (Grok)**
|
||||
- **Cerebras**
|
||||
- **DeepSeek**
|
||||
- **Ollama** (local models)
|
||||
- **LM Studio** (local models)
|
||||
- **OpenAI Compatible** (any compatible API)
|
||||
|
||||
During setup, authenticate with `cline auth` to configure your preferred provider. [See setup guide →](/cline-cli/installation#authenticate)
|
||||
|
||||
## What You Can Build
|
||||
|
||||
### Automated Code Maintenance
|
||||
|
||||
Keep your codebase healthy with automated fixes. Cline scans for issues and applies corrections across multiple files.
|
||||
|
||||
```bash
|
||||
cline -y "Fix all ESLint errors in src/"
|
||||
```
|
||||
Finds and fixes linting violations throughout your source directory.
|
||||
|
||||
```bash
|
||||
cline -y "Update all deprecated React lifecycle methods"
|
||||
```
|
||||
Migrates legacy code patterns to modern equivalents (e.g., `componentWillMount` → `useEffect`).
|
||||
|
||||
```bash
|
||||
cline -y "Update dependencies with known vulnerabilities"
|
||||
```
|
||||
Identifies outdated packages with security issues and updates them to safe versions.
|
||||
|
||||
### CI/CD Integration
|
||||
|
||||
Integrate Cline into your continuous integration pipelines for automated code review and documentation.
|
||||
|
||||
```bash
|
||||
git diff origin/main | cline -y "Review these changes for issues"
|
||||
```
|
||||
Pipes your PR diff to Cline for automated code review, catching bugs and style issues before merge.
|
||||
|
||||
```bash
|
||||
git log --oneline v1.0..v1.1 | cline -y "Write release notes"
|
||||
```
|
||||
Generates human-readable release notes from your commit history between two tags.
|
||||
|
||||
```bash
|
||||
cline -y "Run tests and fix failures" --timeout 600
|
||||
```
|
||||
Executes your test suite, analyzes failures, and attempts fixes with a 10-minute timeout.
|
||||
|
||||
### Development Workflows
|
||||
|
||||
From quick edits to complex refactors, Cline adapts to your workflow.
|
||||
|
||||
```bash
|
||||
cline
|
||||
```
|
||||
Launches interactive mode for exploratory development and back-and-forth collaboration.
|
||||
|
||||
```bash
|
||||
cline "Refactor this function to use async/await"
|
||||
```
|
||||
Executes a focused task directly from the command line with approval prompts at key steps.
|
||||
|
||||
```bash
|
||||
cline "Based on @src/api.ts, add error handling to all endpoints"
|
||||
```
|
||||
Uses file mentions (`@`) to give Cline context about specific files in your workspace.
|
||||
|
||||
### Custom Shell Pipelines
|
||||
|
||||
Chain Cline with other CLI tools to build powerful automation workflows.
|
||||
|
||||
```bash
|
||||
gh pr diff 123 | cline -y "Review this PR"
|
||||
```
|
||||
Fetches a GitHub PR diff and pipes it directly to Cline for review.
|
||||
|
||||
```bash
|
||||
cline --json "List all TODO comments" | jq '.text'
|
||||
```
|
||||
Outputs structured JSON that you can process with tools like `jq` for scripting.
|
||||
|
||||
```bash
|
||||
git diff | cline -y "explain" | cline -y "write a haiku about these changes"
|
||||
```
|
||||
Chains multiple Cline invocations together for creative multi-step workflows.
|
||||
|
||||
## Features at a Glance
|
||||
|
||||
| Feature | Interactive Mode | Non-Interactive Mode |
|
||||
|---------|------------------|----------------------|
|
||||
| Interactive chat | ✓ | - |
|
||||
| File mentions (@) | ✓ | ✓ (inline) |
|
||||
| Slash commands (/) | ✓ | - |
|
||||
| Settings panel | ✓ | `cline config` |
|
||||
| Plan/Act toggle | ✓ (Tab) | `-p` / `-a` flags |
|
||||
| Auto-approve | ✓ (Shift+Tab) | `-y` flag |
|
||||
| Session summary | ✓ | - |
|
||||
| JSON output | - | `--json` |
|
||||
| Piped input | - | ✓ |
|
||||
| [MCP servers](/cline-cli/configuration#mcp-server-configuration) | ✓ | ✓ |
|
||||
|
||||
## MCP Server Support
|
||||
|
||||
Cline CLI supports [MCP (Model Context Protocol)](/mcp/mcp-overview) servers, the same extensibility system available in the VS Code extension. MCP servers give Cline access to external tools and data sources, from databases and APIs to browser automation and project management.
|
||||
|
||||
To use MCP servers with the CLI, add your server configuration to `~/.cline/data/settings/cline_mcp_settings.json`. The format is identical to the VS Code extension.
|
||||
|
||||
[Configure MCP servers for the CLI →](/cline-cli/configuration#mcp-server-configuration)
|
||||
|
||||
## Learn More
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="Installation & Setup" icon="download" href="/cline-cli/installation">
|
||||
Install Cline CLI and authenticate with your preferred provider.
|
||||
</Card>
|
||||
|
||||
<Card title="Interactive Mode" icon="terminal" href="/cline-cli/interactive-mode">
|
||||
Master the interactive CLI with keyboard shortcuts and slash commands.
|
||||
</Card>
|
||||
|
||||
<Card title="Headless Mode" icon="robot" href="/cline-cli/three-core-flows">
|
||||
Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows.
|
||||
</Card>
|
||||
|
||||
<Card title="Configuration" icon="gear" href="/cline-cli/configuration">
|
||||
Configure settings, rules, workflows, and environment variables.
|
||||
</Card>
|
||||
|
||||
<Card title="Use in Other Editors" icon="code" href="/cline-cli/acp-editor-integrations">
|
||||
Run Cline as an ACP agent in JetBrains, Neovim, Zed, and more.
|
||||
</Card>
|
||||
|
||||
<Card title="CLI Samples" icon="flask" href="/cline-cli/samples/overview">
|
||||
Real-world examples of headless workflows and automation patterns.
|
||||
</Card>
|
||||
</Columns>
|
||||
@@ -1,56 +0,0 @@
|
||||
---
|
||||
title: "Samples Overview"
|
||||
description: Example implementations demonstrating Cline CLI capabilities
|
||||
---
|
||||
|
||||
This section provides sample implementations that demonstrate various Cline CLI features and capabilities. Each sample includes complete code, detailed explanations, and real-world usage examples.
|
||||
|
||||
## Available Samples
|
||||
|
||||
<CardGroup cols={1}>
|
||||
<Card
|
||||
title="Model Orchestration"
|
||||
icon="layer-group"
|
||||
href="/cline-cli/samples/model-orchestration"
|
||||
>
|
||||
Use multiple AI models strategically with --config and --thinking flags. Optimize costs by routing simple tasks to cheap models and complex reasoning to premium models. Includes patterns for CI/CD code review, task phase optimization, and multi-model consensus.
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="Worktree Workflows"
|
||||
icon="code-branch"
|
||||
href="/cline-cli/samples/worktree-workflows"
|
||||
>
|
||||
Use Git worktrees with the --cwd flag to run parallel tasks, test different approaches, and pipe context between isolated environments. Includes patterns for parallel execution, cross-worktree piping, and combining with model orchestration.
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="GitHub Root Cause Analysis"
|
||||
icon="magnifying-glass-chart"
|
||||
href="/cline-cli/samples/github-issue-rca"
|
||||
>
|
||||
A command-line script that uses Cline's autonomous AI capabilities to fetch, analyze, and identify root causes of GitHub issues. Features JSON output parsing and non-interactive execution.
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="GitHub Integration (Actions)"
|
||||
icon="github"
|
||||
href="/cline-cli/samples/github-integration"
|
||||
>
|
||||
Automatically respond to GitHub issues by mentioning @cline in comments. Uses Cline CLI in GitHub Actions to create an AI-powered issue assistant that analyzes and responds autonomously.
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="GitHub PR Review (Actions)"
|
||||
icon="code-pull-request"
|
||||
href="/cline-cli/samples/github-pr-review"
|
||||
>
|
||||
Automatically review Pull Requests with AI. Configures Cline in GitHub Actions to analyze diffs, check for security issues, and post detailed reviews with inline code suggestions.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- [CLI Installation Guide](/cline-cli/installation)
|
||||
- [CLI Reference Documentation](/cline-cli/cli-reference)
|
||||
- [Headless Mode](/cline-cli/three-core-flows)
|
||||
@@ -1,273 +0,0 @@
|
||||
---
|
||||
title: "Worktree Workflows"
|
||||
description: "Use Git worktrees with Cline CLI to run parallel tasks, test different approaches, and pipe context between isolated environments"
|
||||
---
|
||||
|
||||
Git worktrees let you have multiple branches checked out simultaneously in different folders. Combined with Cline CLI's `--cwd` flag, this enables powerful parallel development workflows and isolated experimentation.
|
||||
|
||||
<Tip>
|
||||
New to Git worktrees? See our comprehensive [Worktrees guide](/features/worktrees) for the full concept explanation, VS Code integration, and best practices.
|
||||
</Tip>
|
||||
|
||||
## Quick Worktree Setup
|
||||
|
||||
If you haven't used Git worktrees before, here's the essentials:
|
||||
|
||||
```bash
|
||||
# Create a new worktree in ~/worktree-a on branch feature-a
|
||||
git worktree add ~/worktree-a -b feature-a
|
||||
|
||||
# Create another worktree for a different feature
|
||||
git worktree add ~/worktree-b -b feature-b
|
||||
|
||||
# List all worktrees
|
||||
git worktree list
|
||||
|
||||
# Remove a worktree when done
|
||||
git worktree remove ~/worktree-a
|
||||
```
|
||||
|
||||
Each worktree is a separate folder with its own branch checked out. They all share the same Git history and `.git` directory, but have independent working directories.
|
||||
|
||||
## The `--cwd` Flag
|
||||
|
||||
The `-c, --cwd <path>` flag tells Cline to run in a specific directory without changing your current location:
|
||||
|
||||
```bash
|
||||
# Run Cline in a different directory
|
||||
cline --cwd ~/worktree-a -y "refactor the authentication code"
|
||||
|
||||
# Short form
|
||||
cline -c ~/worktree-b -y "add unit tests"
|
||||
```
|
||||
|
||||
This is the key to worktree workflows—you can run multiple Cline instances in different worktrees simultaneously from a single terminal.
|
||||
|
||||
## Pattern 1: Parallel Task Execution
|
||||
|
||||
Run different tasks in parallel across multiple worktrees. Each task works on a separate branch in complete isolation.
|
||||
|
||||
### Example: Parallel Feature Development
|
||||
|
||||
```bash
|
||||
# Terminal 1: Update docs in worktree-a
|
||||
cline --cwd ~/worktree-a -y "read the last 10 changes using git show and update our README with them" &
|
||||
|
||||
# Terminal 2: TypeScript migration in worktree-b
|
||||
cline --cwd ~/worktree-b -y "update the index.js to use typescript" &
|
||||
|
||||
# Terminal 3: Refactoring in worktree-c
|
||||
cline --cwd ~/worktree-c -y "refactor the cli/ folder to be more modular" &
|
||||
|
||||
# Wait for all to complete
|
||||
wait
|
||||
```
|
||||
|
||||
The `&` runs each command in the background, allowing all three to execute simultaneously.
|
||||
|
||||
### When to Use Parallel Execution
|
||||
|
||||
**Perfect for:**
|
||||
- Multiple independent features
|
||||
- Bulk refactoring across different modules
|
||||
- Running tests in one worktree while developing in another
|
||||
- Trying multiple approaches to the same problem
|
||||
|
||||
**Not ideal for:**
|
||||
- Tasks that modify the same files (merge conflicts likely)
|
||||
- Tasks that depend on each other's results
|
||||
- When you need to monitor progress closely
|
||||
|
||||
## Pattern 2: Cross-Worktree Context Piping
|
||||
|
||||
Pipe output from one worktree as input to another. Use when a task in one worktree needs context from attempts in another worktree.
|
||||
|
||||
### Example: Learning from Failures
|
||||
|
||||
```bash
|
||||
# Try approach A in worktree-a, capture only the failure summary
|
||||
cline --cwd ~/worktree-a -y \
|
||||
"edit the index.ts to be better and then npm run. if it fails, output ONLY the failure summary. nothing else but the failure summary" \
|
||||
| cline --cwd ~/worktree-b -y \
|
||||
"i've tried to edit the index.ts in a different worktree but it failed. use a different approach for this work tree"
|
||||
```
|
||||
|
||||
**How it works:**
|
||||
1. First Cline instance runs in `worktree-a`, attempts a change, tests it
|
||||
2. If it fails, outputs just the failure summary
|
||||
3. That summary is piped to a second Cline instance in `worktree-b`
|
||||
4. Second instance sees the failure and tries a different approach
|
||||
|
||||
### When to Use Context Piping
|
||||
|
||||
**Perfect for:**
|
||||
- A/B testing different solutions
|
||||
- Learning from failed attempts
|
||||
- Iterative refinement (try → analyze → try differently)
|
||||
- Comparing outputs across approaches
|
||||
|
||||
**Not ideal for:**
|
||||
- Simple tasks that don't need cross-context
|
||||
- When both worktrees would succeed independently
|
||||
- Real-time collaboration (use parallel execution instead)
|
||||
|
||||
## Combining with Other CLI Features
|
||||
|
||||
### Different Models Per Worktree
|
||||
|
||||
Use `--config` to run different models in different worktrees:
|
||||
|
||||
```bash
|
||||
# Cheap model for simple docs update
|
||||
cline --cwd ~/worktree-docs --config ~/.cline-haiku -y \
|
||||
"update README with latest changes"
|
||||
|
||||
# Expensive model for complex refactoring
|
||||
cline --cwd ~/worktree-refactor --config ~/.cline-opus --thinking -y \
|
||||
"refactor authentication system for better security"
|
||||
```
|
||||
|
||||
This optimizes costs while maintaining quality where it matters.
|
||||
|
||||
### Task Isolation
|
||||
|
||||
Keep long-running worktree sessions isolated by running each task against a different worktree path:
|
||||
|
||||
```bash
|
||||
# Run tasks in dedicated worktrees
|
||||
cline --cwd ~/worktree-a -y "long-running task"
|
||||
cline --cwd ~/worktree-b -y "another task"
|
||||
```
|
||||
|
||||
Each worktree has its own Git branch and working directory, so task history and changes stay separated without needing instance management.
|
||||
|
||||
### With YOLO Mode
|
||||
|
||||
The `-y` (YOLO) flag is essential for worktree workflows:
|
||||
|
||||
```bash
|
||||
# Without -y: Opens interactive chat (blocks other tasks)
|
||||
cline --cwd ~/worktree-a "refactor code"
|
||||
|
||||
# With -y: Runs autonomously (doesn't block)
|
||||
cline --cwd ~/worktree-a -y "refactor code" &
|
||||
```
|
||||
|
||||
For parallel execution, always use `-y` to avoid blocking on user approval.
|
||||
|
||||
## Real-World Workflow Example
|
||||
|
||||
Here's a complete workflow showing how these patterns work together:
|
||||
|
||||
```bash
|
||||
# Setup: Create three worktrees
|
||||
git worktree add ~/cline-worktrees/feature-auth -b feature/authentication
|
||||
git worktree add ~/cline-worktrees/feature-api -b feature/api-endpoints
|
||||
git worktree add ~/cline-worktrees/fix-tests -b fix/failing-tests
|
||||
|
||||
# Pattern 1: Run parallel independent tasks
|
||||
cline -c ~/cline-worktrees/feature-auth -y --config ~/.cline-sonnet \
|
||||
"implement JWT authentication" &
|
||||
|
||||
cline -c ~/cline-worktrees/feature-api -y --config ~/.cline-sonnet \
|
||||
"create REST API endpoints for user management" &
|
||||
|
||||
cline -c ~/cline-worktrees/fix-tests -y --config ~/.cline-haiku \
|
||||
"fix all failing unit tests" &
|
||||
|
||||
wait
|
||||
echo "All parallel tasks complete!"
|
||||
|
||||
# Pattern 2: Use piping for iterative refinement
|
||||
cline -c ~/cline-worktrees/feature-auth -y \
|
||||
"test the authentication with curl. output only errors if any" \
|
||||
| cline -c ~/cline-worktrees/feature-auth -y \
|
||||
"fix the authentication issues described in the input"
|
||||
|
||||
# Merge successful changes back
|
||||
cd ~/cline-worktrees/feature-auth
|
||||
git checkout main
|
||||
git merge feature/authentication
|
||||
|
||||
# Cleanup
|
||||
git worktree remove ~/cline-worktrees/feature-auth
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Worktree Organization">
|
||||
- **Use a dedicated folder**: Create `~/cline-worktrees/` for all worktrees
|
||||
- **Meaningful branch names**: Use `feature/`, `fix/`, `refactor/` prefixes
|
||||
- **Clean up regularly**: Remove worktrees after merging branches
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Task Isolation">
|
||||
- **Independent features only**: Don't parallelize tasks that touch the same files
|
||||
- **Test in isolation**: Each worktree should have its own test run
|
||||
- **Separate configs**: Use `.worktreeinclude` to copy `node_modules` and build artifacts
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Resource Management">
|
||||
- **Monitor disk space**: Each worktree is a full checkout
|
||||
- **Limit parallel tasks**: Running too many simultaneously can slow your system
|
||||
- **Use background jobs wisely**: Track with `jobs` command, kill with `kill %1`, etc.
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Error Handling">
|
||||
- **Check exit codes**: Use `|| echo "Task failed"` to catch errors
|
||||
- **Log outputs**: Redirect to files for debugging: `> worktree-a.log 2>&1`
|
||||
- **Graceful cleanup**: Always remove worktrees after tasks complete
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title=""Branch already checked out" error">
|
||||
Git doesn't allow the same branch in multiple worktrees. Solutions:
|
||||
- Use different branch names for each worktree
|
||||
- Remove the existing worktree first: `git worktree remove <path>`
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Tasks not running in parallel">
|
||||
Make sure you're using:
|
||||
- `&` at the end of each command to background it
|
||||
- `-y` flag so Cline doesn't wait for approval
|
||||
- Different worktrees (not the same path)
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Pipe not working as expected">
|
||||
Verify:
|
||||
- First command outputs to stdout (not stderr)
|
||||
- Second command reads from stdin (use `--` separator if needed)
|
||||
- Both commands use correct `--cwd` paths
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Changes not appearing in worktree">
|
||||
Check:
|
||||
- You're in the right worktree: `git worktree list`
|
||||
- Files aren't gitignored
|
||||
- You committed/staged changes if needed
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Related Documentation
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="Worktrees Overview" icon="code-branch" href="/features/worktrees">
|
||||
Complete guide to Git worktrees, VS Code integration, and .worktreeinclude
|
||||
</Card>
|
||||
|
||||
<Card title="Model Orchestration" icon="layer-group" href="/cline-cli/samples/model-orchestration">
|
||||
Use different models strategically with --config and --thinking flags
|
||||
</Card>
|
||||
|
||||
<Card title="CLI Reference" icon="terminal" href="/cline-cli/cli-reference">
|
||||
Complete documentation for --cwd and all other CLI flags
|
||||
</Card>
|
||||
|
||||
<Card title="Headless Mode" icon="robot" href="/cline-cli/three-core-flows">
|
||||
Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows.
|
||||
</Card>
|
||||
</Columns>
|
||||
@@ -1,244 +0,0 @@
|
||||
---
|
||||
title: "Headless Mode"
|
||||
description: "Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows"
|
||||
---
|
||||
|
||||
Headless mode runs Cline without an interactive interface — perfect for automation, scripting, and CI/CD pipelines where human interaction isn't possible or desired. Cline executes tasks, produces clean text or JSON output, and exits when complete.
|
||||
|
||||
For collaborative, conversational development, see [Interactive Mode](/cline-cli/interactive-mode) instead.
|
||||
|
||||
<Note>
|
||||
**Migrating from an older CLI version?** Instance commands (`cline instance new/list/kill`) have been removed in Cline CLI 2.0. The new architecture is simpler — just use `cline -y "task"` for headless execution.
|
||||
</Note>
|
||||
|
||||
## When Headless Mode Activates
|
||||
|
||||
Cline automatically enters headless mode when any of these conditions are met:
|
||||
|
||||
| Invocation | Reason |
|
||||
|------------|--------|
|
||||
| `cline -y "task"` | `-y`/`--yolo` flag forces headless |
|
||||
| `cline --json "task"` | `--json` flag forces headless |
|
||||
| `cat file \| cline "task"` | stdin is piped |
|
||||
| `cline "task" > output.txt` | stdout is redirected |
|
||||
|
||||
If none of these apply (e.g., running `cline` or `cline "task"` in a terminal), Cline launches in [interactive mode](/cline-cli/interactive-mode).
|
||||
|
||||
## YOLO Mode (Fully Autonomous)
|
||||
|
||||
The `-y` or `--yolo` flag enables fully autonomous operation — Cline approves all actions and runs without prompts:
|
||||
|
||||
```bash
|
||||
cline -y "Run the test suite and fix any failures"
|
||||
```
|
||||
|
||||
In YOLO mode:
|
||||
- All actions are auto-approved
|
||||
- Output is plain text (non-interactive)
|
||||
- Process exits automatically when complete
|
||||
- Perfect for CI/CD and scripts
|
||||
|
||||
<Warning>
|
||||
YOLO mode gives Cline full autonomy. Run on a clean git branch so you can easily revert changes if needed.
|
||||
</Warning>
|
||||
|
||||
### Mode Selection
|
||||
|
||||
Control whether Cline plans first or acts immediately:
|
||||
|
||||
```bash
|
||||
# Start in Plan mode (analyze before acting)
|
||||
cline -y -p "Design a REST API for user management"
|
||||
|
||||
# Start in Act mode (default)
|
||||
cline -y -a "Fix the typo in README.md"
|
||||
```
|
||||
|
||||
## Piping Context
|
||||
|
||||
Pipe file contents or command output into Cline to provide context:
|
||||
|
||||
```bash
|
||||
# Explain a file
|
||||
cat README.md | cline "Summarize this document"
|
||||
|
||||
# Review git changes
|
||||
git diff | cline "Review these changes and suggest improvements"
|
||||
|
||||
# Analyze command output
|
||||
npm test 2>&1 | cline "Analyze these test failures and fix them"
|
||||
|
||||
# Pipe a GitHub PR diff
|
||||
gh pr diff 123 | cline -y "Review this PR"
|
||||
```
|
||||
|
||||
When stdin is piped, Cline automatically enters headless mode — the piped content becomes part of the task context.
|
||||
|
||||
## Chaining Commands
|
||||
|
||||
Pipe Cline's output into another Cline instance for multi-step workflows:
|
||||
|
||||
```bash
|
||||
# Explain changes, then write a commit message
|
||||
git diff | cline -y "explain these changes" | cline -y "write a commit message for this"
|
||||
|
||||
# Generate code, then write tests
|
||||
cline -y "create a fibonacci function" | cline -y "write unit tests for this code"
|
||||
|
||||
# Fun: Generate a poem about your code
|
||||
git diff | cline -y "explain" | cline -y "write a haiku about this"
|
||||
```
|
||||
|
||||
## JSON Output
|
||||
|
||||
Use `--json` for machine-readable output that's easy to parse in scripts:
|
||||
|
||||
```bash
|
||||
cline --json "List all TODO comments in the codebase" | jq '.text'
|
||||
```
|
||||
|
||||
JSON output follows the same format as task files in `~/.cline/data/tasks/<id>/ui_messages.json`.
|
||||
|
||||
**JSON Message Schema:**
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `type` | `"ask"` or `"say"` | Message category |
|
||||
| `text` | `string` | Message content |
|
||||
| `ts` | `number` | Unix timestamp (ms) |
|
||||
| `reasoning` | `string` | (Optional) Model reasoning |
|
||||
| `partial` | `boolean` | (Optional) Streaming flag |
|
||||
|
||||
## Including Images
|
||||
|
||||
Attach images to your headless task:
|
||||
|
||||
```bash
|
||||
cline -y -i screenshot.png "Fix the layout issue shown in this screenshot"
|
||||
|
||||
# Or reference inline
|
||||
cline -y "Fix the UI shown in @./design-mockup.png"
|
||||
```
|
||||
|
||||
## Timeout Control
|
||||
|
||||
Set a maximum execution time to prevent runaway tasks:
|
||||
|
||||
```bash
|
||||
cline -y --timeout 600 "Run full test suite"
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Control Cline behavior via environment variables — useful for CI/CD where you can't use interactive configuration.
|
||||
|
||||
**CLINE_DIR** — Custom configuration directory:
|
||||
```bash
|
||||
export CLINE_DIR=/path/to/config
|
||||
cline -y "your task"
|
||||
```
|
||||
|
||||
**CLINE_COMMAND_PERMISSIONS** — Restrict allowed commands:
|
||||
```bash
|
||||
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"], "deny": ["rm -rf *"]}'
|
||||
cline -y "your task"
|
||||
```
|
||||
|
||||
See [Configuration](/cline-cli/configuration#environment-variables) for full documentation.
|
||||
|
||||
## CI/CD Integration
|
||||
|
||||
### GitHub Actions Example
|
||||
|
||||
Automate PR reviews with Cline:
|
||||
|
||||
```yaml
|
||||
name: AI Code Review
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
|
||||
jobs:
|
||||
review:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: Install Cline
|
||||
run: npm install -g cline
|
||||
|
||||
- name: Configure Cline
|
||||
run: cline auth -p anthropic -k ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
|
||||
- name: Review PR
|
||||
run: |
|
||||
git diff origin/main...HEAD | cline -y "Review this PR for:
|
||||
- Potential bugs
|
||||
- Security issues
|
||||
- Performance concerns
|
||||
- Code style violations
|
||||
|
||||
Provide a summary of findings."
|
||||
```
|
||||
|
||||
### Shell Script Example
|
||||
|
||||
Create a reusable code review script:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# review.sh - AI-powered code review
|
||||
|
||||
set -e
|
||||
|
||||
# Get the diff
|
||||
DIFF=$(git diff HEAD~1)
|
||||
|
||||
if [ -z "$DIFF" ]; then
|
||||
echo "No changes to review"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Run Cline review
|
||||
echo "$DIFF" | cline -y --json "Review this code diff for issues" | jq -r '.text'
|
||||
```
|
||||
|
||||
## Common Use Cases
|
||||
|
||||
| Use Case | Example |
|
||||
|----------|---------|
|
||||
| Code review | `git diff \| cline -y "Review these changes"` |
|
||||
| Fix test failures | `cline -y "Run tests and fix any failures"` |
|
||||
| Generate release notes | `git log --oneline v1.0..v1.1 \| cline -y "Write release notes"` |
|
||||
| Fix lint errors | `cline -y "Fix all ESLint errors in src/"` |
|
||||
| Update dependencies | `cline -y "Update dependencies with known vulnerabilities"` |
|
||||
| Migrate code patterns | `cline -y "Update all deprecated React lifecycle methods"` |
|
||||
| PR automation | `gh pr diff 123 \| cline -y "Review this PR"` |
|
||||
| Batch processing | `cline -y --json "List all TODO comments" \| jq '.text'` |
|
||||
|
||||
## Next Steps
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="Interactive Mode" icon="terminal" href="/cline-cli/interactive-mode">
|
||||
For hands-on development with keyboard shortcuts, slash commands, and file mentions.
|
||||
</Card>
|
||||
|
||||
<Card title="CLI Reference" icon="book" href="/cline-cli/cli-reference">
|
||||
Complete command documentation with all flags and options.
|
||||
</Card>
|
||||
|
||||
<Card title="Configuration" icon="gear" href="/cline-cli/configuration">
|
||||
Environment variables, rules, and advanced settings.
|
||||
</Card>
|
||||
|
||||
<Card title="CLI Samples" icon="flask" href="/cline-cli/samples/overview">
|
||||
Real-world examples of headless workflows and automation patterns.
|
||||
</Card>
|
||||
</Columns>
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
title: "Cline Overview"
|
||||
sidebarTitle: "Cline Overview"
|
||||
description: "Your AI-powered coding agent for complex work. Read files, write code, run commands, all with your approval."
|
||||
---
|
||||
|
||||
Welcome to the Cline documentation. Whether you're just getting started or looking to unlock advanced capabilities, you'll find everything you need here.
|
||||
|
||||
## What is Cline?
|
||||
|
||||
Cline is an AI coding agent that lives in your editor and your terminal. It can read and write files, run terminal commands, use a browser, and help you build features through natural conversation. Every action requires your explicit approval. You're always in control.
|
||||
### Agent Core (SDK)
|
||||
|
||||
The SDK is Cline's agent core—use it to build your own applications, automations, and integrations. See SDK section for detailed functionality and architectural design of the Cline Agent.
|
||||
|
||||
<CardGroup cols={1}>
|
||||
<Card title="SDK" icon="cube" href="https://docs.cline.bot/sdk/overview">
|
||||
Build AI agents and integrations powered by the same core engine behind the CLI, Kanban, VS Code extension, and JetBrains plugin.
|
||||
|
||||
`npm install @cline/sdk`
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
### Applications
|
||||
|
||||
These are end-user applications built on top of Cline's agent core:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="CLI" icon="terminal" href="/usage/cli-overview">
|
||||
Run Cline in your terminal with interactive chat or fully headless automation for CI/CD and scripting.
|
||||
|
||||
`npm i -g cline`
|
||||
</Card>
|
||||
<Card title="Kanban" icon="table-columns" href="https://github.com/cline/kanban">
|
||||
Run many agents in parallel from a web-based task board with per-card worktrees, auto-commit, and dependency chains.
|
||||
|
||||
`npx kanban`
|
||||
</Card>
|
||||
<Card title="VS Code Extension" icon="code" href="https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev">
|
||||
AI coding assistant in your editor. Create files, run commands, browse the web, and use tools with human-in-the-loop approval.
|
||||
</Card>
|
||||
<Card title="JetBrains Plugin" icon="brain" href="https://plugins.jetbrains.com/plugin/27189-cline">
|
||||
The same Cline experience in IntelliJ IDEA, PyCharm, WebStorm, GoLand, and the rest of the JetBrains family.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
|
||||
## Other IDE Supports
|
||||
|
||||
Cline works across all major editors: **VS Code**, **Cursor**, **Windsurf**, **JetBrains** (IntelliJ, PyCharm, WebStorm), **Antigravity**, and **Zed**, **Neovim** via ACP mode.
|
||||
|
||||
|
||||
## Enterprise Solutions
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Security & Governance" icon="shield-halved" href="/enterprise-solutions/overview">
|
||||
SSO, role-based access control, model and tool controls per team, and remote configuration.
|
||||
</Card>
|
||||
<Card title="Observability" icon="chart-line" href="/enterprise-solutions/monitoring/overview">
|
||||
OpenTelemetry, Datadog, Grafana, Splunk integrations with real-time analytics.
|
||||
</Card>
|
||||
<Card title="Team Management" icon="users-gear" href="/enterprise-solutions/team-management/managing-members">
|
||||
Manage members, roles, and permissions across your organization.
|
||||
</Card>
|
||||
<Card title="API Reference" icon="code" href="/enterprise-solutions/api-reference">
|
||||
Programmatic access to Cline's enterprise features.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -1,769 +0,0 @@
|
||||
---
|
||||
title: "Cline SDK"
|
||||
sidebarTitle: "SDK (Programmatic Use)"
|
||||
description: "Embed Cline as a programmable coding agent in your Node.js applications using an ACP-compatible TypeScript API."
|
||||
---
|
||||
|
||||
# Cline SDK
|
||||
|
||||
The Cline SDK lets you embed Cline as a programmable coding agent in your Node.js applications. It exposes the same capabilities as the Cline CLI and VS Code extension — file editing, command execution, browser use, MCP servers — through a TypeScript API that conforms to the [Agent Client Protocol (ACP)](https://agentclientprotocol.com/protocol/schema).
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install cline
|
||||
```
|
||||
|
||||
If you want direct ACP type imports as well:
|
||||
|
||||
```bash
|
||||
npm install @agentclientprotocol/sdk
|
||||
```
|
||||
|
||||
Requires Node.js 20+.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```typescript
|
||||
import { ClineAgent } from "cline";
|
||||
|
||||
const CLINE_DIR = "/Users/username/.cline";
|
||||
const agent = new ClineAgent({ clineDir: CLINE_DIR });
|
||||
|
||||
// 1. Initialize — negotiates capabilities
|
||||
const initializeResponse = await agent.initialize({
|
||||
protocolVersion: 1,
|
||||
// these are the capabilities that the client (you) supports
|
||||
// The cline agent may or may not use them, but it needs to know about them to make informed decisions about what tools to use.
|
||||
clientCapabilities: {
|
||||
fs: { readTextFile: true, writeTextFile: true },
|
||||
terminal: true,
|
||||
},
|
||||
});
|
||||
|
||||
const { agentInfo, authMethods } = initializeResponse;
|
||||
console.log("Agent info:", agentInfo); // contains things like agent name and version
|
||||
console.log("Auth methods:", authMethods); // contains a list of supported authentication methods. More auth methods coming soon
|
||||
|
||||
// 2. Authenticate if needed
|
||||
// If you skip this step, ClineAgent will look in CLINE_DIR for any existing credentials and authenticate with those
|
||||
await agent.authenticate({ methodId: "cline-oauth" });
|
||||
|
||||
// 3. Create a session.
|
||||
// A session represents a conversation or task with the agent. You can have multiple sessions for different tasks or conversations.
|
||||
const { sessionId } = await agent.newSession({
|
||||
cwd: process.cwd(),
|
||||
mcpServers: [], // mcpServers field not supported yet, but exposed here to maintain conformance with acp protocol
|
||||
});
|
||||
|
||||
// 4. Agent updates are sent via events. You can subscribe to these events to get real-time updates on the agent's progress, tool calls, and more.
|
||||
const emitter = agent.emitterForSession(sessionId);
|
||||
|
||||
emitter.on("agent_message_chunk", (payload) => {
|
||||
process.stdout.write(
|
||||
payload.content.type === "text"
|
||||
? payload.content.text
|
||||
: `[${payload.content.type}]`,
|
||||
);
|
||||
});
|
||||
emitter.on("agent_thought_chunk", (payload) => {
|
||||
process.stdout.write(
|
||||
payload.content.type === "text"
|
||||
? payload.content.text
|
||||
: `[${payload.content.type}]`,
|
||||
);
|
||||
});
|
||||
emitter.on("tool_call", (payload) => {
|
||||
console.log(`[tool] ${payload.title}`);
|
||||
});
|
||||
emitter.on("error", (err) => {
|
||||
console.error("[session error]", err);
|
||||
});
|
||||
|
||||
// 5. Send a prompt and wait for completion
|
||||
const { stopReason } = await agent.prompt({
|
||||
sessionId,
|
||||
prompt: [{ type: "text", text: "Create a hello world Express server" }],
|
||||
});
|
||||
|
||||
console.log("Done:", stopReason);
|
||||
|
||||
// 6. Clean up
|
||||
await agent.shutdown();
|
||||
|
||||
```
|
||||
|
||||
## Core Concepts
|
||||
|
||||
### Agent Lifecycle
|
||||
|
||||
The SDK follows the ACP lifecycle:
|
||||
|
||||
```
|
||||
initialize() → authenticate() → newSession() → prompt() ⇄ events → shutdown()
|
||||
```
|
||||
|
||||
| Step | Method | Purpose |
|
||||
|------|--------|---------|
|
||||
| Init | `initialize()` | Exchange protocol version and capabilities |
|
||||
| Auth | `authenticate()` | OAuth flow for Cline or OpenAI Codex accounts. Optional step if cline config directory already has credentials |
|
||||
| Session | `newSession()` | Create an isolated conversation context |
|
||||
| Prompt | `prompt()` | Send user messages; blocks until the turn ends |
|
||||
| Cancel | `cancel()` | Abort an in-progress prompt turn |
|
||||
| Mode | `setSessionMode()` | Switch between `"plan"` and `"act"` modes |
|
||||
| Model | `unstable_setSessionModel()` | Change the backing LLM (experimental) |
|
||||
| Shutdown | `shutdown()` | Abort all tasks, flush state, release resources |
|
||||
|
||||
### Sessions
|
||||
|
||||
A session is an independent conversation with its own task history and working directory. You can run multiple sessions concurrently.
|
||||
|
||||
```typescript
|
||||
const { sessionId, modes, models } = await agent.newSession({
|
||||
cwd: "/path/to/project",
|
||||
mcpServers: [], // mcpServers field not supported yet, but exposed here to maintain conformance with acp protocol
|
||||
})
|
||||
```
|
||||
|
||||
The response includes:
|
||||
- `sessionId` — use this in all subsequent calls
|
||||
- `modes` — available modes (`plan`, `act`) and the current mode
|
||||
- `models` — available models and the current model ID
|
||||
|
||||
Access session metadata via the read-only `sessions` map:
|
||||
|
||||
```typescript
|
||||
const session = agent.sessions.get(sessionId)
|
||||
// { sessionId, cwd, mode, mcpServers, createdAt, lastActivityAt, ... }
|
||||
```
|
||||
|
||||
### Prompting
|
||||
|
||||
`prompt()` sends a user message and blocks until the agent finishes its turn. While the prompt is processing, the agent streams output via session events.
|
||||
|
||||
```typescript
|
||||
const response = await agent.prompt({
|
||||
sessionId,
|
||||
prompt: [
|
||||
{ type: "text", text: "Refactor the auth module to use JWT" },
|
||||
],
|
||||
})
|
||||
```
|
||||
|
||||
The prompt array accepts multiple content blocks:
|
||||
|
||||
```typescript
|
||||
// Text + image + file context
|
||||
await agent.prompt({
|
||||
sessionId,
|
||||
prompt: [
|
||||
{ type: "text", text: "What's in this screenshot?" },
|
||||
{ type: "image", data: base64ImageData, mimeType: "image/png" },
|
||||
{
|
||||
type: "resource",
|
||||
resource: {
|
||||
uri: "file:///path/to/relevant-file.ts",
|
||||
mimeType: "text/plain",
|
||||
text: fileContents,
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
```
|
||||
|
||||
#### Content Block Types
|
||||
|
||||
| Type | Fields | Description |
|
||||
|------|--------|-------------|
|
||||
| `TextContent` | `{ type: "text", text: string }` | Plain text message |
|
||||
| `ImageContent` | `{ type: "image", mimeType: string, data: string }` | Base64-encoded image |
|
||||
| `EmbeddedResource` | `{ type: "resource", resource: { uri: string, mimeType?: string, text?: string, blob?: string } }` | File or resource context |
|
||||
|
||||
#### Stop Reasons
|
||||
|
||||
`prompt()` resolves with a `stopReason`. The ACP `StopReason` type defines the full set of possible values:
|
||||
|
||||
| Value | Meaning |
|
||||
|-------|---------|
|
||||
| `"end_turn"` | Agent finished normally (completed task or waiting for user input) |
|
||||
| `"error"` | An error occurred |
|
||||
|
||||
> **Note:** Cline currently returns `"end_turn"` or `"error"`. Other `StopReason` values like `"max_tokens"` or `"cancelled"` are part of the ACP type but may not be produced by the current implementation.
|
||||
|
||||
### Streaming Events
|
||||
|
||||
Subscribe to real-time output via `ClineSessionEmitter`. Each session has its own emitter.
|
||||
|
||||
```typescript
|
||||
const emitter = agent.emitterForSession(sessionId)
|
||||
```
|
||||
|
||||
#### Event Types
|
||||
|
||||
All events correspond to [ACP `SessionUpdate` types](https://agentclientprotocol.com/protocol/schema#SessionUpdate):
|
||||
|
||||
| Event | Payload | Description |
|
||||
|-------|---------|-------------|
|
||||
| `agent_message_chunk` | `{ content: ContentBlock }` | Streamed text from the agent |
|
||||
| `agent_thought_chunk` | `{ content: ContentBlock }` | Internal reasoning / chain-of-thought |
|
||||
| `tool_call` | `ToolCall` | New tool invocation (file edit, command, etc.) |
|
||||
| `tool_call_update` | `ToolCallUpdate` | Progress/result update for an existing tool call |
|
||||
| `plan` | `{ entries: PlanEntry[] }` | Agent's execution plan |
|
||||
| `available_commands_update` | `{ availableCommands: AvailableCommand[] }` | Slash commands the agent supports |
|
||||
| `current_mode_update` | `{ currentModeId: string }` | Mode changed (plan/act) |
|
||||
| `user_message_chunk` | `{ content: ContentBlock }` | User message chunks (for multi-turn) |
|
||||
| `config_option_update` | `{ configOptions: SessionConfigOption[] }` | Configuration changed |
|
||||
| `session_info_update` | Session metadata | Session metadata changed |
|
||||
| `error` | `Error` | Session-level error (not an ACP update) |
|
||||
|
||||
```typescript
|
||||
emitter.on("agent_message_chunk", (payload) => {
|
||||
// payload.content is a ContentBlock — usually { type: "text", text: "..." }
|
||||
process.stdout.write(payload.content.text)
|
||||
})
|
||||
|
||||
emitter.on("agent_thought_chunk", (payload) => {
|
||||
console.log("[thinking]", payload.content.text)
|
||||
})
|
||||
|
||||
emitter.on("tool_call", (payload) => {
|
||||
console.log(`[${payload.kind}] ${payload.title} (${payload.status})`)
|
||||
})
|
||||
|
||||
emitter.on("tool_call_update", (payload) => {
|
||||
console.log(` → ${payload.toolCallId}: ${payload.status}`)
|
||||
})
|
||||
|
||||
emitter.on("error", (err) => {
|
||||
console.error("Session error:", err)
|
||||
})
|
||||
```
|
||||
|
||||
The emitter supports `on`, `once`, `off`, and `removeAllListeners`.
|
||||
|
||||
### Permission Handling
|
||||
|
||||
When the agent wants to execute a tool (edit a file, run a command, etc.), it requests permission. You **must** set a permission handler or all tool calls will be auto-rejected.
|
||||
|
||||
```typescript
|
||||
agent.setPermissionHandler(async (request) => {
|
||||
// request.toolCall — details about what the agent wants to do
|
||||
// request.options — available choices (allow_once, reject_once, etc.)
|
||||
|
||||
console.log(`Permission requested: ${request.toolCall.title}`)
|
||||
console.log("Options:", request.options.map(o => `${o.optionId} (${o.kind})`))
|
||||
|
||||
// Auto-approve everything:
|
||||
const allowOption = request.options.find(o => o.kind.includes("allow"))
|
||||
if (allowOption) {
|
||||
return { outcome: { outcome: "selected", optionId: allowOption.optionId } }
|
||||
} else {
|
||||
return { outcome: { outcome: "rejected" } }
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
#### Permission Options
|
||||
|
||||
Each permission request includes an array of `PermissionOption` objects:
|
||||
|
||||
| `kind` | Meaning |
|
||||
|--------|---------|
|
||||
| `allow_once` | Approve this single operation |
|
||||
| `allow_always` | Approve and remember for future operations (sent for commands, tools, MCP servers) |
|
||||
| `reject_once` | Deny this single operation |
|
||||
|
||||
**Important:** If no permission handler is set, all tool calls are rejected for safety.
|
||||
|
||||
### Modes
|
||||
|
||||
Cline supports two modes:
|
||||
|
||||
- **`plan`** — The agent gathers information and creates a plan without executing actions
|
||||
- **`act`** — The agent executes actions (file edits, commands, etc.)
|
||||
|
||||
```typescript
|
||||
// Switch to plan mode
|
||||
await agent.setSessionMode({ sessionId, modeId: "plan" })
|
||||
|
||||
// Switch back to act mode
|
||||
await agent.setSessionMode({ sessionId, modeId: "act" })
|
||||
```
|
||||
|
||||
The current mode is returned in `newSession()`
|
||||
|
||||
### Model Selection
|
||||
|
||||
Change the backing model with `unstable_setSessionModel()`. The model ID format is `"provider/modelId"`.
|
||||
|
||||
```typescript
|
||||
await agent.unstable_setSessionModel({
|
||||
sessionId,
|
||||
modelId: "anthropic/claude-sonnet-4-20250514",
|
||||
})
|
||||
```
|
||||
|
||||
This sets the model for both plan and act modes. Available providers include `anthropic`, `openai-native`, `gemini`, `bedrock`, `deepseek`, `mistral`, `groq`, `xai`, and others. Model Ids can be found in the NewSessionResponse object after calling `agent.newSession(..)`
|
||||
|
||||
> **Note:** This API is experimental and may change.
|
||||
|
||||
### Authentication
|
||||
|
||||
The SDK supports two OAuth flows:
|
||||
|
||||
```typescript
|
||||
// Cline account (uses browser OAuth)
|
||||
await agent.authenticate({ methodId: "cline-oauth" })
|
||||
|
||||
// OpenAI Codex / ChatGPT subscription
|
||||
await agent.authenticate({ methodId: "openai-codex-oauth" })
|
||||
```
|
||||
|
||||
Both methods open a browser window for the OAuth flow and block until authentication completes (5-minute timeout for Cline OAuth).
|
||||
|
||||
For BYO (bring-your-own) API key providers, you can pre-configure credentials using the Cline CLI before using the SDK:
|
||||
|
||||
```bash
|
||||
# Configure an Anthropic API key (default directory: ~/.cline/data/)
|
||||
cline auth -p anthropic -k "sk-ant-..." -m anthropic/claude-sonnet-4-20250514
|
||||
|
||||
# Configure an OpenRouter API key
|
||||
cline auth -p openrouter -k "sk-or-..." -m openrouter/anthropic/claude-sonnet-4
|
||||
```
|
||||
|
||||
This writes credentials to `~/.cline/data/`. Once configured, the SDK will use these credentials automatically — no `authenticate()` call needed.
|
||||
|
||||
**Using a custom directory:** If you specify a custom `clineDir` when creating `ClineAgent`, you must use the same path with `--config` when running `cline auth`:
|
||||
|
||||
```typescript
|
||||
// SDK code using custom directory
|
||||
const agent = new ClineAgent({ clineDir: "/custom/path" })
|
||||
```
|
||||
|
||||
```bash
|
||||
# CLI auth command must use the same path
|
||||
cline auth -p anthropic -k "sk-ant-..." -m anthropic/claude-sonnet-4-20250514 --config /custom/path
|
||||
```
|
||||
|
||||
### Cancellation
|
||||
|
||||
Cancel an in-progress prompt turn:
|
||||
|
||||
```typescript
|
||||
await agent.cancel({ sessionId })
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
### Constructor
|
||||
|
||||
```typescript
|
||||
new ClineAgent(options: ClineAgentOptions)
|
||||
```
|
||||
|
||||
```typescript
|
||||
interface ClineAgentOptions {
|
||||
/** Enable debug logging (default: false) */
|
||||
debug?: boolean
|
||||
/** Custom Cline config directory (default: ~/.cline) */
|
||||
clineDir?: string
|
||||
/** Additional runtime hooks directory */
|
||||
hooksDir?: string
|
||||
}
|
||||
```
|
||||
|
||||
The `clineDir` option lets you isolate configuration and task history per-application:
|
||||
|
||||
```typescript
|
||||
const agent = new ClineAgent({
|
||||
clineDir: "/tmp/my-app-cline",
|
||||
})
|
||||
```
|
||||
|
||||
### Methods
|
||||
|
||||
#### `initialize(params): Promise<InitializeResponse>`
|
||||
|
||||
Initialize the agent and negotiate protocol capabilities.
|
||||
|
||||
```typescript
|
||||
const response = await agent.initialize({
|
||||
clientCapabilities: {},
|
||||
protocolVersion: 1,
|
||||
})
|
||||
|
||||
// Response includes:
|
||||
{
|
||||
protocolVersion: 1,
|
||||
agentCapabilities: {
|
||||
loadSession: true,
|
||||
promptCapabilities: { image: true, audio: false, embeddedContext: true },
|
||||
mcpCapabilities: { http: true, sse: false }
|
||||
},
|
||||
agentInfo: { name: "cline", version: "<installed_version>" },
|
||||
authMethods: [
|
||||
{ id: "cline-oauth", name: "Sign in with Cline", description: "..." },
|
||||
{ id: "openai-codex-oauth", name: "Sign in with ChatGPT", description: "..." }
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
#### Client Capabilities
|
||||
|
||||
The `clientCapabilities` object in `initialize()` declares what your environment supports. It is part of the ACP protocol handshake.
|
||||
|
||||
| Capability | Type | Description |
|
||||
|------------|------|-------------|
|
||||
| `fs.readTextFile` | `boolean` | Client supports file read requests |
|
||||
| `fs.writeTextFile` | `boolean` | Client supports file write requests |
|
||||
| `terminal` | `boolean` | Client supports terminal command execution |
|
||||
|
||||
**When using `ClineAgent` directly (SDK use)**, the agent always uses standalone providers for file operations and terminal commands — it reads/writes files and runs shell commands on the local machine regardless of what you pass here. Simply pass `{}`:
|
||||
|
||||
```typescript
|
||||
await agent.initialize({ protocolVersion: 1, clientCapabilities: {} })
|
||||
```
|
||||
|
||||
These capabilities only affect behavior when `ClineAgent` is used through the `AcpAgent` stdio wrapper (e.g., IDE integrations), where an ACP connection delegates operations back to the client.
|
||||
|
||||
#### `newSession(params): Promise<NewSessionResponse>`
|
||||
|
||||
Create a new conversation session.
|
||||
|
||||
```typescript
|
||||
const session = await agent.newSession({
|
||||
cwd: "/path/to/project",
|
||||
mcpServers: [
|
||||
{
|
||||
type: "stdio",
|
||||
name: "filesystem",
|
||||
command: "npx",
|
||||
args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"],
|
||||
env: {},
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
// Response includes:
|
||||
{
|
||||
sessionId: "uuid-string",
|
||||
modes: {
|
||||
availableModes: [
|
||||
{ id: "plan", name: "Plan", description: "Gather information and create a detailed plan" },
|
||||
{ id: "act", name: "Act", description: "Execute actions to accomplish the task" }
|
||||
],
|
||||
currentModeId: "act"
|
||||
},
|
||||
models: {
|
||||
currentModelId: "anthropic/claude-sonnet-4-20250514",
|
||||
availableModels: [{ modelId: "anthropic/claude-sonnet-4-20250514", name: "claude-sonnet-4-20250514" } /* ... */]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
> **Note:** `newSession()` may throw an auth-required error if credentials are not configured yet.
|
||||
|
||||
#### `prompt(params): Promise<PromptResponse>`
|
||||
|
||||
Send a user prompt to the agent. This is the main method for interacting with Cline. Blocks until the agent finishes its turn.
|
||||
|
||||
```typescript
|
||||
const response = await agent.prompt({
|
||||
sessionId: session.sessionId,
|
||||
prompt: [
|
||||
{ type: "text", text: "Create a function that adds two numbers" },
|
||||
],
|
||||
})
|
||||
|
||||
// Response: { stopReason: "end_turn" | "max_tokens" | "cancelled" | "error" }
|
||||
```
|
||||
|
||||
#### `cancel(params): Promise<void>`
|
||||
|
||||
Cancel an ongoing prompt operation.
|
||||
|
||||
```typescript
|
||||
await agent.cancel({ sessionId: session.sessionId })
|
||||
```
|
||||
|
||||
#### `setSessionMode(params): Promise<SetSessionModeResponse>`
|
||||
|
||||
Switch between plan and act modes.
|
||||
|
||||
```typescript
|
||||
await agent.setSessionMode({ sessionId, modeId: "plan" })
|
||||
```
|
||||
|
||||
#### `unstable_setSessionModel(params): Promise<SetSessionModelResponse>`
|
||||
|
||||
Change the model for the session. Model ID format depends on the inference provider. See NewSessionResponse object to get modelIds.
|
||||
|
||||
```typescript
|
||||
await agent.unstable_setSessionModel({
|
||||
sessionId,
|
||||
modelId: "anthropic/claude-sonnet-4-20250514",
|
||||
})
|
||||
```
|
||||
|
||||
#### `authenticate(params): Promise<AuthenticateResponse>`
|
||||
|
||||
Authenticate with a provider. Opens a browser window for OAuth flow.
|
||||
|
||||
```typescript
|
||||
await agent.authenticate({ methodId: "cline-oauth" })
|
||||
```
|
||||
|
||||
Current methodIds we support:
|
||||
|
||||
| methodId | Description |
|
||||
| -------------------- | ----------------------------- |
|
||||
| `cline-oauth` | use cline inference provider |
|
||||
| `openai-codex-oauth` | use your chatgpt subscription |
|
||||
| more coming soon!... | |
|
||||
|
||||
#### `shutdown(): Promise<void>`
|
||||
|
||||
Clean up all resources. Call this when done.
|
||||
|
||||
```typescript
|
||||
await agent.shutdown()
|
||||
```
|
||||
|
||||
#### `setPermissionHandler(handler)`
|
||||
|
||||
Set a callback to handle tool permission requests. The handler receives a `RequestPermissionRequest` and must return a `Promise<RequestPermissionResponse>`.
|
||||
|
||||
```typescript
|
||||
agent.setPermissionHandler(async (request) => {
|
||||
// request.toolCall — details about what the agent wants to do
|
||||
// request.options — available choices (allow_once, reject_once, etc.)
|
||||
const allow = request.options.find(o => o.kind === "allow_once")
|
||||
return {
|
||||
outcome: allow
|
||||
? { outcome: "selected", optionId: allow.optionId }
|
||||
: { outcome: "cancelled" }
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
#### `emitterForSession(sessionId): ClineSessionEmitter`
|
||||
|
||||
Get the typed event emitter for a session.
|
||||
|
||||
```typescript
|
||||
const emitter = agent.emitterForSession(session.sessionId)
|
||||
```
|
||||
|
||||
#### `sessions` (read-only Map)
|
||||
|
||||
Access active sessions:
|
||||
|
||||
```typescript
|
||||
for (const [sessionId, session] of agent.sessions) {
|
||||
console.log(sessionId, session.cwd, session.mode)
|
||||
}
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
SDK methods throw standard JavaScript errors. Key error scenarios:
|
||||
|
||||
| Method | Error | Cause |
|
||||
|--------|-------|-------|
|
||||
| `newSession()` | `RequestError` (auth required) | No credentials configured — call `authenticate()` or pre-configure via CLI |
|
||||
| `prompt()` | `Error("Session not found")` | Invalid `sessionId` |
|
||||
| `prompt()` | `Error("already processing")` | Called `prompt()` while a previous prompt is still running on the same session |
|
||||
| `unstable_setSessionModel()` | `Error("Invalid modelId format")` | Model ID must be `"provider/modelId"` format (e.g., `"anthropic/claude-sonnet-4-20250514"`) |
|
||||
| `authenticate()` | `Error("Unknown authentication method")` | Invalid `methodId` — use `"cline-oauth"` or `"openai-codex-oauth"` |
|
||||
| `authenticate()` | `Error("Authentication timed out")` | OAuth flow not completed within 5 minutes |
|
||||
|
||||
```typescript
|
||||
try {
|
||||
const { sessionId } = await agent.newSession({ cwd: process.cwd(), mcpServers: [] })
|
||||
} catch (error) {
|
||||
if (error.message?.includes("auth")) {
|
||||
// Need to authenticate first
|
||||
await agent.authenticate({ methodId: "cline-oauth" })
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Session-level errors during `prompt()` execution are emitted on the session emitter rather than thrown:
|
||||
|
||||
```typescript
|
||||
emitter.on("error", (err) => {
|
||||
console.error("Session error:", err.message)
|
||||
})
|
||||
```
|
||||
|
||||
## Full Example: Auto-Approve Agent
|
||||
|
||||
```typescript
|
||||
import { ClineAgent } from "cline";
|
||||
|
||||
async function runTask(taskPrompt: string, cwd: string) {
|
||||
const agent = new ClineAgent({ clineDir: "/path/to/.cline" });
|
||||
|
||||
await agent.initialize({
|
||||
protocolVersion: 1,
|
||||
clientCapabilities: {},
|
||||
});
|
||||
|
||||
const { sessionId } = await agent.newSession({ cwd, mcpServers: [] });
|
||||
|
||||
// Auto-approve all tool calls
|
||||
agent.setPermissionHandler(async (request) => {
|
||||
const allow = request.options.find((o) => o.kind === "allow_once");
|
||||
return {
|
||||
outcome: allow
|
||||
? { outcome: "selected", optionId: allow.optionId }
|
||||
: { outcome: "cancelled" },
|
||||
};
|
||||
});
|
||||
|
||||
// Collect output
|
||||
const output: string[] = [];
|
||||
const emitter = agent.emitterForSession(sessionId);
|
||||
|
||||
emitter.on("agent_message_chunk", (p) => {
|
||||
if (p.content.type === "text") output.push(p.content.text);
|
||||
});
|
||||
|
||||
emitter.on("tool_call", (p) => {
|
||||
console.log(`[tool] ${p.title}`);
|
||||
});
|
||||
|
||||
const { stopReason } = await agent.prompt({
|
||||
sessionId,
|
||||
prompt: [{ type: "text", text: taskPrompt }],
|
||||
});
|
||||
|
||||
console.log("\n--- Agent Output ---");
|
||||
console.log(output.join(""));
|
||||
console.log(`\nStop reason: ${stopReason}`);
|
||||
|
||||
await agent.shutdown();
|
||||
}
|
||||
|
||||
runTask("Create a README.md for this project", process.cwd());
|
||||
```
|
||||
|
||||
## Full Example: Interactive Permission Flow
|
||||
|
||||
```typescript
|
||||
import { ClineAgent, type PermissionHandler } from "cline";
|
||||
import * as readline from "readline";
|
||||
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
const ask = (q: string) => new Promise<string>((res) => rl.question(q, res));
|
||||
|
||||
const interactivePermissions: PermissionHandler = async (request) => {
|
||||
console.log(`\n⚠️ Permission: ${request.toolCall.title}`);
|
||||
|
||||
for (const [i, opt] of request.options.entries()) {
|
||||
console.log(` ${i + 1}. [${opt.kind}] ${opt.name}`);
|
||||
}
|
||||
|
||||
const choice = await ask("Choose (number): ");
|
||||
const idx = parseInt(choice, 10) - 1;
|
||||
const selected = request.options[idx];
|
||||
|
||||
if (selected) {
|
||||
return {
|
||||
outcome: { outcome: "selected", optionId: selected.optionId },
|
||||
};
|
||||
} else {
|
||||
return { outcome: { outcome: "cancelled" } };
|
||||
}
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const agent = new ClineAgent({});
|
||||
await agent.initialize({ protocolVersion: 1, clientCapabilities: {} });
|
||||
|
||||
const { sessionId } = await agent.newSession({
|
||||
cwd: process.cwd(),
|
||||
mcpServers: [],
|
||||
});
|
||||
|
||||
agent.setPermissionHandler(interactivePermissions);
|
||||
|
||||
const emitter = agent.emitterForSession(sessionId);
|
||||
emitter.on("agent_message_chunk", (p) => {
|
||||
if (p.content.type === "text") process.stdout.write(p.content.text);
|
||||
});
|
||||
|
||||
// Multi-turn conversation
|
||||
while (true) {
|
||||
const userInput = await ask("\n> ");
|
||||
if (userInput === "exit") break;
|
||||
|
||||
const { stopReason } = await agent.prompt({
|
||||
sessionId,
|
||||
prompt: [{ type: "text", text: userInput }],
|
||||
});
|
||||
|
||||
console.log(`\n[${stopReason}]`);
|
||||
}
|
||||
|
||||
await agent.shutdown();
|
||||
rl.close();
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
```
|
||||
|
||||
## Exported Types
|
||||
|
||||
All types are re-exported from the `cline` package. Key types:
|
||||
|
||||
| Type | Description |
|
||||
|------|-------------|
|
||||
| `ClineAgent` | Main agent class |
|
||||
| `ClineSessionEmitter` | Typed event emitter for session events |
|
||||
| `ClineAgentOptions` | Constructor options (`debug`, `clineDir`, `hooksDir`) |
|
||||
| `ClineAcpSession` | Session metadata (read-only) |
|
||||
| `ClineSessionEvents` | Event name → handler signature map |
|
||||
| `AcpSessionStatus` | Session lifecycle enum: `Idle`, `Processing`, `Cancelled` |
|
||||
| `AcpSessionState` | Session state tracking (status, pending tool calls) |
|
||||
| `PermissionHandler` | `(request: RequestPermissionRequest) => Promise<RequestPermissionResponse>` |
|
||||
| `RequestPermissionRequest` | Permission request details (sessionId, toolCall, options) |
|
||||
| `RequestPermissionResponse` | Permission response with outcome |
|
||||
| `PermissionOption` | Permission choice (`kind`, `optionId`, `name`) |
|
||||
| `SessionUpdate` | Union of all session update types |
|
||||
| `SessionUpdateType` | Discriminator values (`"agent_message_chunk"`, `"tool_call"`, etc.) |
|
||||
| `SessionUpdatePayload` | Typed payload for a given `SessionUpdateType` |
|
||||
| `SessionModelState` | Current model and available models |
|
||||
| `ToolCall` | Tool call details (id, title, kind, status, content) |
|
||||
| `ToolCallUpdate` | Partial update to an existing tool call |
|
||||
| `ToolCallStatus` | `"pending" \| "in_progress" \| "completed" \| "failed"` |
|
||||
| `ToolKind` | `"read" \| "edit" \| "delete" \| "execute" \| "search" \| ...` |
|
||||
| `StopReason` | `"end_turn" \| "cancelled" \| "error" \| "max_tokens" \| ...` |
|
||||
| `ContentBlock` | `TextContent \| ImageContent \| AudioContent \| ...` |
|
||||
| `TextContent` / `ImageContent` / `AudioContent` | Individual content block types |
|
||||
| `McpServer` | MCP server configuration (stdio, http) |
|
||||
| `ModelInfo` | Model metadata (`modelId`, `name`) |
|
||||
| `PromptRequest` / `PromptResponse` | Prompt call types |
|
||||
| `NewSessionRequest` / `NewSessionResponse` | Session creation types |
|
||||
| `InitializeRequest` / `InitializeResponse` | Initialization types |
|
||||
| `SetSessionModeRequest` / `SetSessionModeResponse` | Mode switching types |
|
||||
| `SetSessionModelRequest` / `SetSessionModelResponse` | Model switching types |
|
||||
| `TranslatedMessage` | Result of translating a Cline message to ACP updates |
|
||||
|
||||
See the [ACP Schema](https://agentclientprotocol.com/protocol/schema) for the full type definitions.
|
||||
|
||||
## Relationship to ACP
|
||||
|
||||
The Cline SDK implements the [Agent Client Protocol](https://agentclientprotocol.com) `Agent` interface. The key difference from a standard ACP stdio agent is that the SDK uses an **event emitter pattern** instead of a transport connection:
|
||||
|
||||
| ACP Stdio (via `AcpAgent`) | SDK (via `ClineAgent`) |
|
||||
|-----------------------------|------------------------|
|
||||
| Session updates sent over JSON-RPC stdio | Session updates emitted via `ClineSessionEmitter` |
|
||||
| Permissions requested via `connection.requestPermission()` | Permissions requested via `setPermissionHandler()` callback |
|
||||
| Single process, single connection | Embeddable, multiple concurrent sessions |
|
||||
|
||||
If you need stdio-based ACP communication (e.g., for IDE integration), use the `cline` CLI binary directly. The SDK is for embedding Cline in your own Node.js processes.
|
||||
@@ -1,316 +0,0 @@
|
||||
---
|
||||
title: "Documentation Templates"
|
||||
sidebarTitle: "Templates"
|
||||
description: "Templates for different types of Cline documentation"
|
||||
---
|
||||
|
||||
Use these templates as starting points for new documentation. Each template is designed for a specific purpose. Choose the one that best fits what you're documenting.
|
||||
|
||||
## Choosing a Template
|
||||
|
||||
| If you're documenting... | Use this template |
|
||||
|--------------------------|-------------------|
|
||||
| What a feature does and how to use it | Feature Doc |
|
||||
| How to accomplish a specific task | How-To Guide |
|
||||
| Technical specifications or API details | Reference Doc |
|
||||
| A complete project walkthrough | Tutorial |
|
||||
|
||||
## Feature Doc
|
||||
|
||||
Use this template when explaining a Cline feature. Focus on what it does, how to use it, and real examples.
|
||||
|
||||
````text
|
||||
---
|
||||
title: "Feature Name"
|
||||
sidebarTitle: "Feature Name"
|
||||
---
|
||||
|
||||
[One sentence explaining what this feature does.]
|
||||
|
||||
<Frame>
|
||||
<img src="..." alt="Feature in action" />
|
||||
</Frame>
|
||||
|
||||
[1-2 paragraphs explaining the feature in plain terms. What problem does it
|
||||
solve? Why would someone use it?]
|
||||
|
||||
## How It Works
|
||||
|
||||
[Explain the mechanics without jargon. What happens when you use this feature?]
|
||||
|
||||
## Using [Feature Name]
|
||||
|
||||
[Show how to access and use it. Include the exact UI path.]
|
||||
|
||||
### [Option or Variation 1]
|
||||
|
||||
[Details with examples]
|
||||
|
||||
### [Option or Variation 2]
|
||||
|
||||
[Details with examples]
|
||||
|
||||
## Inspiration
|
||||
|
||||
[Share how you personally use this feature. Use "I" voice. Give 2-3 real
|
||||
examples that spark imagination about what's possible.]
|
||||
|
||||
<Note>
|
||||
[Important caveat, limitation, or requirement]
|
||||
</Note>
|
||||
````
|
||||
|
||||
### Example: Checkpoints Feature
|
||||
|
||||
Here's how the [Checkpoints](/core-workflows/checkpoints) doc follows this pattern:
|
||||
|
||||
- Opens with one clear sentence about what checkpoints do
|
||||
- Shows a screenshot of the feature in action
|
||||
- Explains how checkpoints work under the hood
|
||||
- Shows exact steps to create and restore checkpoints
|
||||
- Includes real examples of when checkpoints save the day
|
||||
|
||||
## How-To Guide
|
||||
|
||||
Use this template when showing how to accomplish a specific task. Focus on clear steps and troubleshooting.
|
||||
|
||||
````text
|
||||
---
|
||||
title: "How to [Accomplish Task]"
|
||||
sidebarTitle: "[Short Title]"
|
||||
description: "[One sentence describing what the reader will learn]"
|
||||
---
|
||||
|
||||
[Brief intro explaining what problem this guide solves and what you'll end up
|
||||
with after following it.]
|
||||
|
||||
## Prerequisites
|
||||
|
||||
[What the reader needs before starting. Keep it short. Link to other docs
|
||||
rather than explaining setup here.]
|
||||
|
||||
- Cline installed and configured
|
||||
- [Other requirement]
|
||||
|
||||
## Steps
|
||||
|
||||
<Steps>
|
||||
<Step title="[First Action]">
|
||||
[Clear instructions. Show exactly what to click or type.]
|
||||
|
||||
```bash
|
||||
example command if needed
|
||||
```
|
||||
</Step>
|
||||
<Step title="[Second Action]">
|
||||
[Next step. Include screenshots for complex UI interactions.]
|
||||
|
||||
<Frame>
|
||||
<img src="..." alt="What you should see" />
|
||||
</Frame>
|
||||
</Step>
|
||||
<Step title="[Final Action]">
|
||||
[Complete the task. Show the expected result.]
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
Common issues and how to fix them:
|
||||
|
||||
- **Problem description**: Solution in one or two sentences.
|
||||
- **Another problem**: Another solution.
|
||||
|
||||
## Next Steps
|
||||
|
||||
<Card title="Related Feature" icon="arrow-right" href="/path/to/related">
|
||||
Continue learning with this related guide.
|
||||
</Card>
|
||||
````
|
||||
|
||||
### Example: Your First Project
|
||||
|
||||
The [Your First Project](/getting-started/your-first-project) guide follows this pattern:
|
||||
|
||||
- Clear goal stated upfront
|
||||
- Prerequisites listed briefly
|
||||
- Step-by-step instructions with the Steps component
|
||||
- Troubleshooting section for common issues
|
||||
|
||||
## Reference Doc
|
||||
|
||||
Use this template for technical specifications, API documentation, or detailed configuration options.
|
||||
|
||||
````text
|
||||
---
|
||||
title: "[Component/API] Reference"
|
||||
sidebarTitle: "[Short Title]"
|
||||
description: "[What this reference covers]"
|
||||
---
|
||||
|
||||
[Brief description of what this reference documents and when you'd need it.]
|
||||
|
||||
## Overview
|
||||
|
||||
[High-level explanation. What is this component? What role does it play?]
|
||||
|
||||
## [Category 1]
|
||||
|
||||
### [Item Name]
|
||||
|
||||
[What it does in one sentence.]
|
||||
|
||||
| Property | Type | Default | Description |
|
||||
|----------|------|---------|-------------|
|
||||
| `propertyName` | `string` | `"default"` | What this property controls |
|
||||
| `anotherProp` | `boolean` | `false` | What this does |
|
||||
|
||||
**Example:**
|
||||
|
||||
```typescript
|
||||
// Show practical usage
|
||||
const example = {
|
||||
propertyName: "custom value",
|
||||
anotherProp: true
|
||||
}
|
||||
```
|
||||
|
||||
### [Another Item]
|
||||
|
||||
[Continue for each item in this category.]
|
||||
|
||||
## [Category 2]
|
||||
|
||||
[Continue with other categories as needed.]
|
||||
|
||||
## Examples
|
||||
|
||||
[Show 2-3 complete, practical examples that combine multiple concepts.]
|
||||
|
||||
### [Example 1 Title]
|
||||
|
||||
```typescript
|
||||
// Complete working example
|
||||
```
|
||||
|
||||
### [Example 2 Title]
|
||||
|
||||
```typescript
|
||||
// Another complete example
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [Related Doc 1](/path/to/doc) - Brief description
|
||||
- [Related Doc 2](/path/to/doc) - Brief description
|
||||
````
|
||||
|
||||
### Example: Cline Tools Guide
|
||||
|
||||
The [Cline Tools Guide](/tools-reference/all-cline-tools) follows this pattern:
|
||||
|
||||
- Overview of the tool system
|
||||
- Each tool documented with parameters and examples
|
||||
- Practical examples showing tools in context
|
||||
|
||||
## Tutorial
|
||||
|
||||
Use this template for comprehensive project walkthroughs where users build something from start to finish.
|
||||
|
||||
````text
|
||||
---
|
||||
title: "[Build/Create X] Tutorial"
|
||||
sidebarTitle: "[Short Title]"
|
||||
description: "[What the reader will build]"
|
||||
---
|
||||
|
||||
In this tutorial, you'll build [specific outcome]. By the end, you'll have
|
||||
[tangible result you can see/use].
|
||||
|
||||
<Frame>
|
||||
<img src="..." alt="Preview of what you'll build" />
|
||||
</Frame>
|
||||
|
||||
## What You'll Learn
|
||||
|
||||
- [Skill or concept 1]
|
||||
- [Skill or concept 2]
|
||||
- [Skill or concept 3]
|
||||
|
||||
## Prerequisites
|
||||
|
||||
[Required setup. Link to installation guides rather than repeating them.]
|
||||
|
||||
- [Prerequisite 1]
|
||||
- [Prerequisite 2]
|
||||
|
||||
## Part 1: [First Major Section]
|
||||
|
||||
[Introduction to this section. What are we doing and why?]
|
||||
|
||||
### [Subsection]
|
||||
|
||||
[Detailed walkthrough with code blocks and explanations.]
|
||||
|
||||
```typescript
|
||||
// Code that the reader should write or understand
|
||||
```
|
||||
|
||||
[Explain what the code does and why.]
|
||||
|
||||
## Part 2: [Second Major Section]
|
||||
|
||||
[Continue building on Part 1.]
|
||||
|
||||
### [Subsection]
|
||||
|
||||
[More detailed walkthrough.]
|
||||
|
||||
## Part 3: [Final Section]
|
||||
|
||||
[Complete the project.]
|
||||
|
||||
## Summary
|
||||
|
||||
You built [what they built]. Along the way, you learned:
|
||||
|
||||
- [Key takeaway 1]
|
||||
- [Key takeaway 2]
|
||||
- [Key takeaway 3]
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Go Deeper" icon="book" href="/path/to/advanced">
|
||||
Learn more advanced techniques.
|
||||
</Card>
|
||||
<Card title="Related Tutorial" icon="code" href="/path/to/related">
|
||||
Build something else with similar concepts.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
````
|
||||
|
||||
### Example Structure
|
||||
|
||||
A good tutorial:
|
||||
- Shows the end result upfront so readers know what they're building
|
||||
- Breaks the work into logical parts
|
||||
- Explains the "why" alongside the "how"
|
||||
- Ends with clear next steps
|
||||
|
||||
## Quick Tips
|
||||
|
||||
When using these templates:
|
||||
|
||||
1. **Delete sections you don't need.** Templates are starting points, not rigid structures.
|
||||
|
||||
2. **Add sections that make sense.** If your doc needs something not in the template, add it.
|
||||
|
||||
3. **Keep the reader moving forward.** Every section should lead naturally to the next.
|
||||
|
||||
4. **Test your own instructions.** Follow your guide from scratch to catch missing steps.
|
||||
|
||||
<Tip>
|
||||
Use the `/write-docs` workflow to generate documentation from these templates automatically.
|
||||
Cline helps you fill in each section based on your project.
|
||||
</Tip>
|
||||
@@ -1,200 +0,0 @@
|
||||
---
|
||||
title: "Documentation Guide"
|
||||
sidebarTitle: "Documentation Guide"
|
||||
description: "How to write and contribute to Cline documentation"
|
||||
---
|
||||
|
||||
Cline's documentation lives in the `docs/` directory and uses [Mintlify](https://mintlify.com) for rendering. This guide covers how to write docs that match Cline's established style.
|
||||
|
||||
## Using the Documentation Workflow
|
||||
|
||||
The fastest way to create documentation is using the `/write-docs` workflow. Type `/write-docs` in Cline and describe what you want to document. Cline guides you through a 4-step process:
|
||||
|
||||
1. **Research**: Examine existing docs structure and patterns
|
||||
2. **Scope**: Clarify audience, doc type, and key use cases
|
||||
3. **Outline**: Select a template and create structure
|
||||
4. **Write**: Generate documentation following style guidelines
|
||||
|
||||
The workflow file lives at `.clinerules/workflows/write-docs.md` and contains templates, style rules, and examples.
|
||||
|
||||
## Documentation Principles
|
||||
|
||||
### Write for Developers
|
||||
|
||||
Your audience is developers who value their time. Get to the point. Every sentence should either help them understand something or help them do something.
|
||||
|
||||
```markdown
|
||||
# Good
|
||||
Switch to bash in Cline Settings → Terminal → Default Terminal Profile.
|
||||
|
||||
# Bad
|
||||
Users who are experiencing issues may find it helpful to navigate to the
|
||||
Cline settings menu where they can locate the terminal configuration
|
||||
options and subsequently modify the default terminal profile setting.
|
||||
```
|
||||
|
||||
### Show Real Examples
|
||||
|
||||
Abstract descriptions don't help anyone. Show actual code, real file paths, and concrete implementations.
|
||||
|
||||
```markdown
|
||||
# Good
|
||||
I use `/deep-planning` whenever I'm building features that touch multiple
|
||||
parts of the codebase. For example, when adding authentication, Cline
|
||||
mapped every endpoint and created a migration plan that avoided breaking changes.
|
||||
|
||||
# Bad
|
||||
The deep planning feature can be utilized for various complex tasks
|
||||
that may require careful consideration and planning.
|
||||
```
|
||||
|
||||
### Use Active Voice
|
||||
|
||||
Cline does things. Files don't get created by Cline, Cline creates files.
|
||||
|
||||
```markdown
|
||||
# Good
|
||||
Cline reads your project files and builds context automatically.
|
||||
|
||||
# Bad
|
||||
Project files are read and context is built automatically.
|
||||
```
|
||||
|
||||
### Use Neutral Pronouns for Cline
|
||||
|
||||
Refer to Cline as "it" not "he". Cline is software, not a person.
|
||||
|
||||
```markdown
|
||||
# Good
|
||||
When Cline encounters an error, it suggests fixes.
|
||||
|
||||
# Bad
|
||||
When Cline encounters an error, he suggests fixes.
|
||||
```
|
||||
|
||||
## File Format
|
||||
|
||||
All documentation uses MDX format with YAML frontmatter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "Full Page Title"
|
||||
sidebarTitle: "Shorter Nav Title" # optional
|
||||
description: "One sentence for SEO" # optional but recommended
|
||||
---
|
||||
```
|
||||
|
||||
### Adding New Pages
|
||||
|
||||
After creating a new `.mdx` file, add it to `docs/docs.json` in the appropriate navigation group:
|
||||
|
||||
```json
|
||||
{
|
||||
"group": "Features",
|
||||
"pages": [
|
||||
"features/existing-page",
|
||||
"features/your-new-page"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Mintlify Components
|
||||
|
||||
Use these components appropriately throughout your docs.
|
||||
|
||||
### Frame
|
||||
|
||||
Wrap all images and videos:
|
||||
|
||||
```jsx
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/filename.png"
|
||||
alt="Descriptive alt text"
|
||||
/>
|
||||
</Frame>
|
||||
```
|
||||
|
||||
### Callouts
|
||||
|
||||
Use sparingly and purposefully:
|
||||
|
||||
```jsx
|
||||
<Tip>Helpful suggestions that improve the experience.</Tip>
|
||||
<Note>Important information the reader needs to know.</Note>
|
||||
<Warning>Something that could cause problems if ignored.</Warning>
|
||||
```
|
||||
|
||||
### Steps
|
||||
|
||||
For sequential procedures:
|
||||
|
||||
```jsx
|
||||
<Steps>
|
||||
<Step title="Install the Extension">
|
||||
Search for "Cline" in the VS Code marketplace.
|
||||
</Step>
|
||||
<Step title="Configure Your Model">
|
||||
Open settings and add your API key.
|
||||
</Step>
|
||||
</Steps>
|
||||
```
|
||||
|
||||
### Cards
|
||||
|
||||
For navigation and feature overviews:
|
||||
|
||||
```jsx
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Getting Started" icon="rocket" href="/getting-started/installing-cline">
|
||||
Install Cline and set up your first project.
|
||||
</Card>
|
||||
<Card title="Features" icon="wand-magic-sparkles" href="/core-workflows/plan-and-act">
|
||||
Explore what Cline can do.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
```
|
||||
|
||||
## Style Rules
|
||||
|
||||
Quick reference for consistent documentation:
|
||||
|
||||
| Do | Don't |
|
||||
|---|---|
|
||||
| Use "use" | Use "utilize" |
|
||||
| Keep sentences under 25 words | Write run-on sentences |
|
||||
| Use bullet points for lists | Write walls of text |
|
||||
| Show where things are in the UI | Assume users can find features |
|
||||
| Cross-link related docs | Leave readers stranded |
|
||||
| Use code blocks with language tags | Use inline code for long snippets |
|
||||
|
||||
### Avoid These Patterns
|
||||
|
||||
- Em dashes and emojis
|
||||
- Starting with "This document explains..."
|
||||
- The **Bold Text**: description pattern
|
||||
- Explaining obvious things
|
||||
- Passive voice
|
||||
|
||||
## Previewing Changes
|
||||
|
||||
Run the docs locally to preview your changes:
|
||||
|
||||
```bash
|
||||
cd docs
|
||||
npm install # first time only
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Open `http://localhost:3000` to see your changes in real time.
|
||||
|
||||
## Related Resources
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Documentation Templates" icon="file-lines" href="/contributing/doc-templates">
|
||||
Templates for different documentation types.
|
||||
</Card>
|
||||
<Card title="Workflows" icon="diagram-project" href="/customization/workflows">
|
||||
Learn about Cline's workflow system.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -1,220 +0,0 @@
|
||||
---
|
||||
title: "Model Selection Guide"
|
||||
description: "Choose the right AI model for your workflow based on reliability, speed, cost, and context window size."
|
||||
---
|
||||
|
||||
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.
|
||||
|
||||
<Callout type="tip">
|
||||
**New to model selection?** Start with [Module 2 of Cline's Learning Path](https://cline.bot/learn) for a comprehensive guide to choosing and configuring models.
|
||||
</Callout>
|
||||
|
||||
## What is an AI Model?
|
||||
|
||||
Think of an AI model as the "brain" that powers Cline. When you ask Cline to write code, fix bugs, or refactor your project, it's the model that actually understands your request and generates the response.
|
||||
|
||||
**Key points:**
|
||||
- **Models are trained AI systems** that understand natural language and code
|
||||
- **Different models have different strengths** some excel at complex reasoning, others prioritize speed or cost
|
||||
- **You choose which model Cline uses** like picking between different experts for different tasks
|
||||
- **Models are accessed via API providers** - companies like Anthropic, OpenAI, and OpenRouter host these models
|
||||
|
||||
**Why it matters:** The model you choose directly impacts Cline's capabilities, response quality, speed, and cost. A premium model might handle complex refactoring beautifully but cost more, while a budget model works great for routine tasks at a fraction of the price.
|
||||
|
||||
## How to Select a Model in Cline
|
||||
|
||||
Follow these 5 simple steps to get Cline up and running with your preferred AI model:
|
||||
|
||||
### Step 1: Open Cline Settings
|
||||
|
||||
First, you need to access Cline's configuration panel.
|
||||
|
||||
**Two ways to open settings:**
|
||||
- **Quick method**: Click the **gear icon (⚙️)** in the top-right corner of Cline's chat interface
|
||||
- **Command palette**: Press **Cmd/Ctrl + Shift + P** → type "Cline: Open Settings"
|
||||
|
||||
<Frame>
|
||||
<img src="https://storage.googleapis.com/cline_public_images/step1-config.png" alt="Cline Settings Panel" />
|
||||
</Frame>
|
||||
|
||||
The settings panel will open, showing configuration options with "API Provider" at the top.
|
||||
|
||||
<Note>
|
||||
The settings panel remembers your last configuration, so you'll only need to set this up once.
|
||||
</Note>
|
||||
|
||||
### Step 2: Select an API Provider
|
||||
|
||||
Choose your preferred AI provider from the dropdown menu.
|
||||
|
||||
|
||||
<Frame>
|
||||
<img src="https://storage.googleapis.com/cline_public_images/step2-provider.png" alt="Cline Settings Panel" />
|
||||
</Frame>
|
||||
|
||||
**Popular providers at a glance:**
|
||||
|
||||
| Provider | Best For | Notes |
|
||||
|----------|----------|-------|
|
||||
| **Cline** | Easiest setup | No API keys needed, access to multiple models including stealth models |
|
||||
| **OpenRouter** | Value seekers | Multiple models, competitive pricing |
|
||||
| **Anthropic** | Reliability | Claude models, most dependable tool usage |
|
||||
| **OpenAI** | Latest tech | GPT-5, o3, o4-mini models |
|
||||
| **OpenAI Codex** | ChatGPT subscribers | Use your ChatGPT subscription — no API key needed |
|
||||
| **Google Gemini** | Large context | Gemini 3/2.5 with up to 2M context |
|
||||
| **DeepSeek** | Budget reasoning | V3.2, R1 models at low cost |
|
||||
| **Alibaba Qwen** | Open source coding | Qwen3 Coder with 1M context |
|
||||
| **Moonshot** | Agentic coding | Kimi K2.5 with 262K context |
|
||||
| **Cerebras** | Speed | Up to 2,600 tokens/sec |
|
||||
| **AWS Bedrock** | Enterprise | Advanced features |
|
||||
| **Ollama** | Privacy | Run models locally |
|
||||
|
||||
See the [full provider list](/getting-started/authorizing-with-cline) for all 30+ supported providers including xAI Grok, Mistral, Groq, Fireworks, Together, Baseten, SambaNova, Nebius, Hugging Face, and more.
|
||||
|
||||
<Info>
|
||||
**Recommended for beginners:** Start with **Cline** as your provider - no API key management needed, instant access to multiple models, and occasional free inferencing through partner providers.
|
||||
</Info>
|
||||
|
||||
### Step 3: Add Your API Key (or Sign In)
|
||||
|
||||
The next step depends on which provider you selected.
|
||||
|
||||
#### If you selected **Cline** as your provider:
|
||||
|
||||
- **No API key needed!** Simply sign in with your Cline account
|
||||
- Click the **Sign In** button when prompted
|
||||
- You'll be redirected to [app.cline.bot](https://app.cline.bot) to authenticate
|
||||
- After signing in, return to your IDE
|
||||
|
||||
<Note>
|
||||
For detailed information about the Cline authentication flow, OAuth tokens, and troubleshooting, see [Authorizing with Cline](/getting-started/authorizing-with-cline).
|
||||
</Note>
|
||||
|
||||
#### If you selected **OpenAI Codex** as your provider:
|
||||
|
||||
- **No API key needed!** If you have a ChatGPT subscription (Plus, Pro, or Team), you can use it directly in Cline
|
||||
- Click **"Sign in with OpenAI"** to authenticate via your browser
|
||||
- Once authorized, all models available on your OpenAI plan will appear automatically
|
||||
- Usage is governed by your ChatGPT subscription — no separate API billing
|
||||
|
||||
See the full [OpenAI Codex setup guide](/provider-config/openai-codex) for details.
|
||||
|
||||
#### If you selected any other provider:
|
||||
|
||||
You'll need to get an API key from your chosen provider:
|
||||
|
||||
1. **Visit your provider's website to get an API key:**
|
||||
- **Anthropic**: [console.anthropic.com](https://console.anthropic.com/)
|
||||
- **OpenRouter**: [openrouter.ai/keys](https://openrouter.ai/keys)
|
||||
- **OpenAI**: [platform.openai.com/api-keys](https://platform.openai.com/api-keys)
|
||||
- **Google**: [aistudio.google.com/apikey](https://aistudio.google.com/apikey)
|
||||
- **Others**: See [Provider Setup Guide](/getting-started/authorizing-with-cline)
|
||||
|
||||
2. **Generate a new API key** on the provider's website
|
||||
|
||||
3. **Copy the API key** to your clipboard
|
||||
|
||||
4. **Paste your key** in the **"API Key"** field in Cline settings
|
||||
|
||||
5. **Save automatically** - Your key is stored securely in your editor's secrets storage
|
||||
|
||||
<Frame>
|
||||
<img src="https://storage.googleapis.com/cline_public_images/step3-API.png" alt="Cline API Selection" />
|
||||
</Frame>
|
||||
|
||||
<Warning>
|
||||
**Payment required for most providers**: Most providers need payment information before generating keys. You only pay for what you use (typically $0.01-$0.10 per coding task).
|
||||
</Warning>
|
||||
|
||||
### Step 4: Choose Your Model
|
||||
|
||||
Once your API key is added (or you've signed in), the **"Model"** dropdown becomes available.
|
||||
|
||||
<Frame>
|
||||
<img src="https://storage.googleapis.com/cline_public_images/step4-model.png" alt="Cline Model Selection" />
|
||||
</Frame>
|
||||
|
||||
**Quick model selection guide:**
|
||||
|
||||
| Your Priority | Choose This Model | Why |
|
||||
|---------------|-------------------|-----|
|
||||
| **Maximum reliability** | Claude Sonnet 4.5 | Most reliable tool usage, excellent at complex tasks |
|
||||
| **Best value** | DeepSeek V3 or Qwen3 Coder | Great performance at budget prices |
|
||||
| **Fastest speed** | Qwen3 Coder on Cerebras | Lightning-fast responses |
|
||||
| **Run locally** | Any Ollama model | Complete privacy, no internet needed |
|
||||
| **Latest features** | GPT-5 | OpenAI's newest capabilities |
|
||||
|
||||
Not sure which to pick? Start with **Claude Sonnet 4.5** for reliability or **DeepSeek V3** for value.
|
||||
|
||||
<Tip>
|
||||
You can switch models at any time without losing your conversation. Try different models to find what works best for your specific tasks.
|
||||
</Tip>
|
||||
|
||||
See the [model comparison tables](#current-top-models) below for detailed specifications and pricing.
|
||||
|
||||
### Step 5: Start Using Cline
|
||||
|
||||
**Congratulations! You're all set up.** Here's how to start coding with Cline:
|
||||
|
||||
1. **Type your request** in the Cline chat box
|
||||
- Example: "Create a React component for a login form"
|
||||
- Example: "Debug this TypeScript error"
|
||||
- Example: "Refactor this function to be more efficient"
|
||||
|
||||
2. **Press Enter** or click the send icon to submit
|
||||
|
||||
## Choosing the Right Model
|
||||
|
||||
Selecting the right model involves balancing several factors. Use this framework to find your ideal match:
|
||||
|
||||
<Note>
|
||||
**Pro tips**: Configure separate models for Plan Mode and Act Mode. Make the most out the each model's strengths. For example, use a budget model for planning discussions and a premium model for implementation.
|
||||
</Note>
|
||||
|
||||
### Key Selection Factors
|
||||
|
||||
| Factor | What to Consider | Recommendation |
|
||||
|--------|------------------|----------------|
|
||||
| **Task Complexity** | Simple fixes vs complex refactoring | Budget models for routine tasks; Premium models for complex work |
|
||||
| **Budget** | Monthly spending capacity | \$10-\$30: Budget, \$30-\$100: Mid-tier, \$100+: Premium |
|
||||
| **Context Window** | Project size and file count | Small: 32K-128K, Medium: 128K-200K, Large: 400K+ |
|
||||
| **Speed** | Response time requirements | Interactive: Fast models, Background: Reasoning models OK |
|
||||
| **Tool Reliability** | Complex operations | Claude excels at tool usage; Test others with your workflow |
|
||||
| **Provider** | Access and pricing needs | OpenRouter: Many options, Direct: Faster/reliable, Local: Privacy |
|
||||
|
||||
|
||||
|
||||
## Model Comparison Resources
|
||||
|
||||
For detailed model comparisons and performance metrics, see:
|
||||
- [**Context Window Guide**](/model-config/context-windows) - Understanding and optimizing context usage
|
||||
|
||||
## Open Source vs Closed Source
|
||||
|
||||
### Open Source Advantages
|
||||
- **Multiple providers** compete to host them
|
||||
- **Cheaper pricing** due to competition
|
||||
- **Provider choice** - switch if one goes down
|
||||
- **Faster innovation** cycles
|
||||
|
||||
### Open Source Models Available
|
||||
- **Qwen3 Coder** (Apache 2.0)
|
||||
- **Z AI GLM 4.5** (MIT)
|
||||
- **Kimi K2** (Open source)
|
||||
- **DeepSeek series** (Various licenses)
|
||||
|
||||
## Quick Decision Matrix
|
||||
|
||||
| If you want... | Use this |
|
||||
|----------------|----------|
|
||||
| Something that just works | Claude Sonnet 4.5 |
|
||||
| To save money | DeepSeek V3 or Qwen3 variants |
|
||||
| Huge context windows | Gemini 2.5 Pro or Claude Sonnet 4.5 |
|
||||
| Open source | Qwen3 Coder, Z AI GLM 4.5, or Kimi K2 |
|
||||
| Latest tech | GPT-5 |
|
||||
| To use your ChatGPT subscription | [OpenAI Codex](/provider-config/openai-codex) — sign in with your OpenAI account, no API key needed |
|
||||
| Speed | Qwen3 Coder on Cerebras (fastest available) |
|
||||
|
||||
## What Others Are Using
|
||||
|
||||
Check [Vercel's leaderboard](https://vercel.com/ai-gateway/leaderboards) to see real usage patterns from the community.
|
||||
@@ -89,7 +89,7 @@ For complex tasks that need thorough analysis, use the `/deep-planning` slash co
|
||||
3. Creates a detailed implementation plan
|
||||
4. Asks clarifying questions before proceeding
|
||||
|
||||
The deep planning prompt is optimized for each model family, so it adapts to the strengths of whatever model you're using. See the [Deep Planning docs](/features/deep-planning) for more details.
|
||||
The deep planning prompt is optimized for each model family, so it adapts to the strengths of whatever model you're using. See [/deep-planning](/core-workflows/using-commands#deep-planning) for more details.
|
||||
|
||||
## Choosing the Right Approach by Task Size
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "Using Commands"
|
||||
sidebarTitle: "Using Commands"
|
||||
description: "Built-in slash commands to manage context, plan implementations, and create reusable workflows."
|
||||
description: "Built-in slash commands to manage context, plan implementations, and trigger reusable skills."
|
||||
---
|
||||
|
||||
Cline provides slash commands in chat that help you manage your conversation and plan complex implementations.
|
||||
@@ -37,7 +37,7 @@ Use `/smol` when you're deep into a debugging session or brainstorming and need
|
||||
|
||||
### /newrule
|
||||
|
||||
`/newrule` creates a rule file that teaches Cline your preferences. Cline will guide you through setting up guidelines for communication style, coding standards, project context, and workflows. The rule is saved to your `.clinerules` directory and automatically loaded for future conversations.
|
||||
`/newrule` creates a rule file that teaches Cline your preferences. Cline will guide you through setting up guidelines for communication style, coding standards, project context, and reusable practices. The rule is saved to your `.clinerules` directory and automatically loaded for future conversations.
|
||||
|
||||
Use `/newrule` when you find yourself repeating the same instructions across tasks. For more about rules, see [Cline Rules](/customization/cline-rules).
|
||||
|
||||
@@ -50,7 +50,7 @@ Transform Cline into a meticulous architect who investigates your codebase, asks
|
||||
3. **Plan Creation** - Generates `implementation_plan.md` with detailed specifications
|
||||
4. **Task Creation** - Creates a new task with trackable implementation steps
|
||||
|
||||
Use `/deep-planning` for features touching multiple parts of your codebase, architectural changes, or complex integrations. For detailed documentation, see [Deep Planning](/features/deep-planning).
|
||||
Use `/deep-planning` for features touching multiple parts of your codebase, architectural changes, or complex integrations.
|
||||
|
||||
### /explain-changes
|
||||
|
||||
@@ -68,8 +68,14 @@ Use `/explain-changes` when reviewing code, onboarding to a new codebase, or und
|
||||
|
||||
Use `/reportbug` when you encounter unexpected behavior, crashes, or bugs you want to report.
|
||||
|
||||
## Custom Workflows
|
||||
## Skills via Slash Commands
|
||||
|
||||
Beyond the built-in slash commands, you can create your own workflow files that work the same way. Store Markdown files in `.clinerules/workflows/` and invoke them with `/your-workflow.md`.
|
||||
In addition to built-in commands, you can trigger enabled skills directly from chat using slash commands.
|
||||
|
||||
For a complete guide on creating and managing custom workflows, see [Workflows](/customization/workflows).
|
||||
- Type `/` to open command suggestions.
|
||||
- Select a skill command (for example, `/aws-deploy`).
|
||||
- Cline loads that skill and applies its `SKILL.md` instructions for the task.
|
||||
|
||||
Any enabled skill can be triggered this way, which gives you a fast path to skill-specific guidance without rewriting the same instructions each time.
|
||||
|
||||
For setup and management details, see [Skills](/customization/skills#triggering-skills-with-slash-commands).
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
---
|
||||
title: "Adding Context"
|
||||
sidebarTitle: "Adding Context"
|
||||
description: "Use @ mentions and drag & drop to bring files, terminal output, errors, git changes, and web content into your conversations."
|
||||
description: "Use @ mentions and drag & drop to bring files into your conversations."
|
||||
---
|
||||
|
||||
Cline works best when it has the right context, not just more context. @ mentions let you pull in exactly the files, errors, terminal output, or documentation that matter for your task. No copying, no pasting, no context switching.
|
||||
Cline works best when it has the right context, not just more context. `@` mentions let you pull in the files and folders that matter for your task — no copying, no pasting, no context switching.
|
||||
|
||||
You can add context two ways:
|
||||
- Type `@` in the chat input and select what you want
|
||||
- Click the **+** button in the bottom left to browse files, images, or mentions
|
||||
|
||||
<Tip>
|
||||
**Want to learn more about managing context?** Watch [Adding Context with @ Mentions](https://youtu.be/7j6R75Dvj1Y) to see it in action.
|
||||
</Tip>
|
||||
- Type `@` in the chat input and select a file or folder
|
||||
- Click the **+** button in the bottom left to browse files or images
|
||||
|
||||
## Quick Reference
|
||||
|
||||
@@ -20,11 +16,8 @@ You can add context two ways:
|
||||
|---------------|--------|---------|
|
||||
| File content | `@/path/to/file` | `@/src/index.ts` |
|
||||
| Folder contents | `@/path/to/folder/` | `@/src/components/` |
|
||||
| Workspace errors | `@problems` | `@problems` |
|
||||
| Terminal output | `@terminal` | `@terminal` |
|
||||
| Uncommitted changes | `@git-changes` | `@git-changes` |
|
||||
| Specific commit | `@<commit-hash>` | `@a1b2c3d` |
|
||||
| Web page | `@<url>` | `@https://react.dev/learn` |
|
||||
|
||||
For other context — git history, web pages, terminal errors — just describe it. Cline will run `git log`, fetch the URL, or read the output itself.
|
||||
|
||||
## File Mentions
|
||||
|
||||
@@ -46,59 +39,6 @@ Explain how the components in @/src/components/auth/ work together.
|
||||
In multi-root workspaces, prefix paths with the workspace name: `@workspace-name:/path/to/file`
|
||||
</Note>
|
||||
|
||||
## Problem Mentions
|
||||
|
||||
Use `@problems` to share all errors and warnings from your workspace's Problems panel.
|
||||
|
||||
```text
|
||||
@problems Can you fix these TypeScript errors?
|
||||
```
|
||||
|
||||
## Terminal Mentions
|
||||
|
||||
Use `@terminal` to share recent terminal output. Perfect for debugging build errors or test failures.
|
||||
|
||||
```text
|
||||
@terminal The build is failing. What's wrong?
|
||||
```
|
||||
|
||||
## Git Mentions
|
||||
|
||||
Reference uncommitted changes with `@git-changes`:
|
||||
|
||||
```text
|
||||
@git-changes Review my changes before I commit.
|
||||
```
|
||||
|
||||
Reference specific commits with `@<commit-hash>` (7-40 character hex):
|
||||
|
||||
```text
|
||||
What did @a1b2c3d change?
|
||||
```
|
||||
|
||||
## URL Mentions
|
||||
|
||||
Reference web content with `@https://example.com`. Cline fetches the page content.
|
||||
|
||||
```text
|
||||
Implement the pattern described in @https://react.dev/learn/scaling-up-with-reducer-and-context
|
||||
```
|
||||
|
||||
## Combining Mentions
|
||||
|
||||
Combine multiple @ mentions for comprehensive context:
|
||||
|
||||
```text
|
||||
I'm getting these errors: @problems
|
||||
|
||||
Here's my component: @/src/components/Form.jsx
|
||||
And the API endpoint: @/src/api/users.js
|
||||
|
||||
The error happens when I submit: @terminal
|
||||
|
||||
I think this commit might have caused it: @a1b2c3d
|
||||
```
|
||||
|
||||
## Drag & Drop
|
||||
|
||||
Drag files directly into the chat input to add them to your conversation.
|
||||
|
||||
@@ -51,7 +51,7 @@ your-project/
|
||||
|
||||
Cline processes all `.md` and `.txt` files inside `.clinerules/`, combining them into a unified set of rules. Numeric prefixes (like `01-coding.md`) help organize files but are optional.
|
||||
|
||||
When both workspace and global rules exist, Cline combines them. Workspace rules take precedence when they conflict with global rules. See [Storage Locations](/customization/overview#storage-locations) for more guidance.
|
||||
When both workspace and global rules exist, Cline combines them. Workspace rules take precedence when they conflict with global rules. See [Storage Locations](/getting-started/config#storage-locations) for more guidance.
|
||||
|
||||
### Global Rules Directory
|
||||
|
||||
|
||||
@@ -107,4 +107,3 @@ You can still reference ignored files explicitly using [@ mentions](/core-workfl
|
||||
- [Cline Rules](/customization/cline-rules) - Define persistent instructions for Cline
|
||||
- [Task Management](/core-workflows/task-management#context-window) - Understand how context windows work
|
||||
- [Auto-Compact](/features/auto-compact) - Automatic context compression during long tasks
|
||||
- [Memory Bank](/features/memory-bank) - Structured documentation for cross-session context
|
||||
|
||||
@@ -1,519 +1,7 @@
|
||||
---
|
||||
title: "Hooks"
|
||||
sidebarTitle: "Hooks"
|
||||
description: "Inject custom logic into Cline's workflow to validate operations and shape Cline's decisions."
|
||||
description: "See details under SDK Hooks page."
|
||||
---
|
||||
|
||||
Hooks are scripts that run at key moments in Cline's workflow. Because they execute at known points with consistent inputs and outputs, hooks bring determinism to the non-deterministic nature of AI models by enforcing guardrails, validations, and context injection. You can validate operations before they execute, monitor tool usage, and shape how Cline makes decisions.
|
||||
|
||||
## What You Can Build
|
||||
|
||||
- Stop operations before they cause problems (like creating `.js` files in a TypeScript project)
|
||||
- Run linters or custom validators before files get saved
|
||||
- Prevent operations that violate security policies
|
||||
- Track everything for analytics or compliance
|
||||
- Trigger external tools or services at the right moments
|
||||
- Add context to the conversation based on what Cline is doing
|
||||
|
||||
## Hook Types
|
||||
|
||||
Cline supports 8 hook types that run at different points in the task lifecycle:
|
||||
|
||||
| Hook Type | When It Runs |
|
||||
|-----------|--------------|
|
||||
| TaskStart | When you start a new task |
|
||||
| TaskResume | When you resume an interrupted task |
|
||||
| TaskCancel | When you cancel a running task |
|
||||
| TaskComplete | When a task finishes successfully |
|
||||
| PreToolUse | Before Cline executes a tool (read_file, write_to_file, etc.) |
|
||||
| PostToolUse | After a tool execution completes |
|
||||
| UserPromptSubmit | When you submit a message to Cline |
|
||||
| PreCompact | Before Cline truncates conversation history to free up context |
|
||||
|
||||
## Hook Lifecycle
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
%% Styling
|
||||
classDef hook fill:#FFB74D,stroke:#E65100,stroke-width:2px,color:black,rx:5,ry:5;
|
||||
classDef state fill:#E1F5FE,stroke:#0277BD,stroke-width:2px,color:black;
|
||||
classDef action fill:#FFFFFF,stroke:#333,stroke-width:1px,color:black,stroke-dasharray: 5 5;
|
||||
|
||||
%% Entry Points
|
||||
Start((Start)) --> CheckType{New or<br/>Resume?}
|
||||
|
||||
%% Initialization Hooks
|
||||
CheckType -- New Task --> H_Start[TaskStart]:::hook
|
||||
CheckType -- Resume --> H_Resume[TaskResume]:::hook
|
||||
|
||||
%% Main Loop
|
||||
H_Start --> Loop(Task Active Loop):::state
|
||||
H_Resume --> Loop
|
||||
|
||||
subgraph Conversation Cycle
|
||||
direction TB
|
||||
Loop -- User sends message --> H_Submit[UserPromptSubmit]:::hook
|
||||
H_Submit --> Thinking[Cline Processes Context]:::state
|
||||
|
||||
%% Context Compaction Path
|
||||
Thinking -. Context Limit Reached .-> H_Compact[PreCompact]:::hook
|
||||
H_Compact -.-> Thinking
|
||||
|
||||
%% Tool Execution Path
|
||||
Thinking -- Decides to use tool --> H_PreTool[PreToolUse]:::hook
|
||||
H_PreTool -- Allowed --> ToolExec[Tool Executes]:::action
|
||||
H_PreTool -- Cancelled --> Thinking
|
||||
ToolExec --> H_PostTool[PostToolUse]:::hook
|
||||
H_PostTool --> Thinking
|
||||
end
|
||||
|
||||
%% Termination Paths
|
||||
Thinking -- Task Successfully Finished --> H_Complete[TaskComplete]:::hook
|
||||
Loop -- User Cancels Task --> H_Cancel[TaskCancel]:::hook
|
||||
|
||||
%% End
|
||||
H_Complete --> End((End))
|
||||
H_Cancel --> End
|
||||
```
|
||||
|
||||
The diagram shows the complete hook lifecycle:
|
||||
|
||||
1. **Entry**: When you start a task, either **TaskStart** (new task) or **TaskResume** (interrupted task) runs first
|
||||
2. **Conversation Cycle**: Each time you send a message, **UserPromptSubmit** runs, then Cline processes your request
|
||||
3. **Tool Execution**: When Cline decides to use a tool, **PreToolUse** runs first-if allowed, the tool executes, then **PostToolUse** runs
|
||||
4. **Context Management**: If the conversation approaches context limits, **PreCompact** runs before truncation
|
||||
5. **Exit**: The task ends with either **TaskComplete** (success) or **TaskCancel** (user cancellation)
|
||||
|
||||
Orange nodes represent hooks where you can inject custom logic. The cycle repeats as you continue the conversation.
|
||||
|
||||
## Hook Locations
|
||||
|
||||
Hooks can be stored globally or in a project workspace. See [Storage Locations](/customization/overview#storage-locations) for guidance on when to use each.
|
||||
|
||||
- **Global hooks**: `~/Documents/Cline/Hooks/`
|
||||
- **Project hooks**: `.clinerules/hooks/` in your repo (can be committed to version control)
|
||||
|
||||
When both global and workspace hooks exist for the same hook type, both run. Global hooks execute first, then workspace hooks. If either returns `cancel: true`, the operation stops.
|
||||
|
||||
## Creating a Hook
|
||||
|
||||
<Steps>
|
||||
<Step title="Open the Hooks tab">
|
||||
Click the scale icon at the bottom of the Cline panel, to the left of the model selector. Switch to the Hooks tab.
|
||||
</Step>
|
||||
<Step title="Create a new hook">
|
||||
Click **"New hook..."** dropdown and select a hook type (e.g., PreToolUse, TaskStart).
|
||||
</Step>
|
||||
<Step title="Review the hook's code">
|
||||
Click the pencil icon to open and edit the hook script. Cline generates a template with examples.
|
||||
</Step>
|
||||
<Step title="Enable the hook">
|
||||
Toggle the switch to activate the hook once you understand what it does.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Warning>
|
||||
Always review a hook's code before enabling it. Hooks execute automatically during your workflow and can block operations or run shell commands.
|
||||
</Warning>
|
||||
|
||||
## Quick Start: Your First Hook
|
||||
|
||||
Let's create a simple hook that logs every file Cline reads or writes. You'll see results in seconds.
|
||||
|
||||
### The Hook
|
||||
|
||||
Create a file called `file-logger` in your hooks directory with this content:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# Logs all file operations to ~/cline-activity.log
|
||||
|
||||
INPUT=$(cat)
|
||||
TOOL=$(echo "$INPUT" | jq -r '.preToolUse.toolName')
|
||||
FILE_PATH=$(echo "$INPUT" | jq -r '.preToolUse.parameters.path // "N/A"')
|
||||
|
||||
# Log to file
|
||||
echo "$(date '+%H:%M:%S') - $TOOL: $FILE_PATH" >> ~/cline-activity.log
|
||||
|
||||
# Always allow the operation
|
||||
echo '{"cancel":false}'
|
||||
```
|
||||
|
||||
### Setup
|
||||
|
||||
<Steps>
|
||||
<Step title="Create the hook file">
|
||||
Save the script above as `~/Documents/Cline/Hooks/file-logger` or create it through the Hooks UI.
|
||||
</Step>
|
||||
<Step title="Make it executable">
|
||||
On macOS/Linux, run `chmod +x ~/Documents/Cline/Hooks/file-logger`.
|
||||
</Step>
|
||||
<Step title="Enable it (macOS/Linux only)">
|
||||
In Cline's Hooks tab, find "file-logger" under PreToolUse hooks and toggle it on.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Note>
|
||||
On Windows, hooks are executed with PowerShell and run whenever the hook file exists. In this
|
||||
foundation PR, hook enable/disable toggling is not yet supported on Windows.
|
||||
</Note>
|
||||
|
||||
<Note>
|
||||
Coming next: JSON-backed hook enabled/disabled state across platforms, so toggle behavior is
|
||||
consistent on Windows, macOS, and Linux.
|
||||
</Note>
|
||||
|
||||
<Note>
|
||||
Hook filenames are platform-specific:
|
||||
|
||||
- **Windows**: only `HookName.ps1` is supported (PowerShell script files)
|
||||
- **macOS/Linux**: only extensionless `HookName` is supported (executable files like bash scripts or binaries)
|
||||
|
||||
Wrong-platform naming is ignored by hook discovery.
|
||||
</Note>
|
||||
|
||||
### Test It
|
||||
|
||||
Ask Cline to read any file in your project: "What's in package.json?"
|
||||
|
||||
Then check the log:
|
||||
|
||||
```bash
|
||||
cat ~/cline-activity.log
|
||||
```
|
||||
|
||||
You'll see entries like:
|
||||
```text
|
||||
14:23:45 - read_file: /path/to/package.json
|
||||
14:23:47 - search_files: /path/to/src
|
||||
```
|
||||
|
||||
### Customize It
|
||||
|
||||
Try modifying the hook to:
|
||||
- Filter specific file types (only log `.ts` files)
|
||||
- Add the task ID to each log entry
|
||||
- Send notifications for write operations
|
||||
- Block operations on certain paths
|
||||
|
||||
The sections below explain how hooks receive input and return output, plus more examples.
|
||||
|
||||
## How Hooks Work
|
||||
|
||||
Hooks are executable scripts that receive JSON input via stdin and return JSON output via stdout.
|
||||
|
||||
### Input Structure
|
||||
|
||||
Every hook receives a JSON object with common fields plus hook-specific data:
|
||||
|
||||
```json
|
||||
{
|
||||
"taskId": "abc123",
|
||||
"hookName": "PreToolUse",
|
||||
"clineVersion": "3.17.0",
|
||||
"timestamp": "1736654400000",
|
||||
"workspaceRoots": ["/path/to/project"],
|
||||
"userId": "user_123",
|
||||
"model": {
|
||||
"provider": "openrouter",
|
||||
"slug": "anthropic/claude-sonnet-4.5"
|
||||
},
|
||||
|
||||
// Hook-specific field (name matches hook type in camelCase)
|
||||
"taskStart": {
|
||||
"taskMetadata": {
|
||||
"taskId": "abc123",
|
||||
"ulid": "01J...",
|
||||
"initialTask": "Add authentication to the API"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`model.provider` and `model.slug` are machine-stable identifiers for the active provider/model at hook execution time. If unavailable, Cline sends deterministic fallback values: `"unknown"`.
|
||||
|
||||
<Note>
|
||||
Migration note for existing hook scripts:
|
||||
|
||||
- `timestamp` is a string (milliseconds since epoch), not a number
|
||||
- `workspaceRoots` is an array of workspace root paths and replaces the old singular `workspacePath`
|
||||
|
||||
If your scripts previously read `.workspacePath`, switch to `.workspaceRoots[0]` (or iterate all roots).
|
||||
</Note>
|
||||
|
||||
The hook-specific field name matches the hook type:
|
||||
- `taskStart`, `taskResume`, `taskCancel`, `taskComplete` contain `{ taskMetadata: { taskId, ulid, ... } }`
|
||||
- `preToolUse` contains `{ toolName: string, parameters: object }`
|
||||
- `postToolUse` contains `{ toolName: string, parameters: object, result: string, success: boolean, executionTimeMs: number }`
|
||||
- `userPromptSubmit` contains `{ prompt: string, attachments: string[] }`
|
||||
- `preCompact` contains `{ taskId, ulid, contextSize, compactionStrategy, tokensIn, tokensOut, ... }`
|
||||
|
||||
### Output Structure
|
||||
|
||||
Hooks return a JSON object to stdout:
|
||||
|
||||
```json
|
||||
{
|
||||
"cancel": false,
|
||||
"contextModification": "Optional text to add to the conversation",
|
||||
"errorMessage": ""
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `cancel` | boolean | If `true`, stops the operation (blocks the tool, cancels the task start, etc.) |
|
||||
| `contextModification` | string | Optional text that gets injected into the conversation as context for Cline |
|
||||
| `errorMessage` | string | Shown to the user if `cancel` is `true` |
|
||||
|
||||
### Context Modification
|
||||
|
||||
The `contextModification` field lets hooks inject information into the conversation. This is useful for:
|
||||
|
||||
- Adding project-specific context when a task starts
|
||||
- Providing validation results that Cline should consider
|
||||
- Injecting environment information before tool execution
|
||||
|
||||
For example, a PreToolUse hook could add: `"Note: This file is auto-generated. Edits may be overwritten."`
|
||||
|
||||
## Hook Reference
|
||||
|
||||
### Task Lifecycle Hooks
|
||||
|
||||
#### TaskStart
|
||||
|
||||
Runs when you start a new task. Use it to:
|
||||
- Log task start time for analytics
|
||||
- Add project context to the conversation
|
||||
- Check prerequisites before work begins
|
||||
- Notify external systems (Slack, issue trackers)
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
INPUT=$(cat)
|
||||
TASK=$(echo "$INPUT" | jq -r '.taskStart.taskMetadata.initialTask')
|
||||
echo "[TaskStart] Starting: $TASK" >&2
|
||||
echo '{"cancel":false,"contextModification":"","errorMessage":""}'
|
||||
```
|
||||
|
||||
#### TaskResume
|
||||
|
||||
Runs when you resume an interrupted task (instead of TaskStart). Use it to:
|
||||
- Check for changes since the task was paused
|
||||
- Refresh context with latest project state
|
||||
- Notify that work is resuming
|
||||
|
||||
#### TaskCancel
|
||||
|
||||
Runs when you cancel a running task. Use it to:
|
||||
- Clean up temporary files or resources
|
||||
- Notify external systems about cancellation
|
||||
- Log cancellation for analytics
|
||||
|
||||
#### TaskComplete
|
||||
|
||||
Runs when a task completes successfully. Use it to:
|
||||
- Run tests or validation after changes
|
||||
- Generate reports or summaries
|
||||
- Notify stakeholders
|
||||
- Trigger CI/CD pipelines
|
||||
|
||||
### Tool Hooks
|
||||
|
||||
#### PreToolUse
|
||||
|
||||
Runs before any tool executes. This is the most powerful hook for validation and safety. Use it to:
|
||||
- Block dangerous operations
|
||||
- Validate parameters before execution
|
||||
- Add context about the file or resource being accessed
|
||||
- Log tool usage
|
||||
|
||||
The input includes the tool name and its parameters:
|
||||
|
||||
```json
|
||||
{
|
||||
"preToolUse": {
|
||||
"toolName": "write_to_file",
|
||||
"parameters": {
|
||||
"path": "src/config.ts",
|
||||
"content": "..."
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Example that blocks `.js` files in a TypeScript project:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
INPUT=$(cat)
|
||||
TOOL=$(echo "$INPUT" | jq -r '.preToolUse.toolName')
|
||||
FILE_PATH=$(echo "$INPUT" | jq -r '.preToolUse.parameters.path // empty')
|
||||
|
||||
if [[ "$TOOL" == "write_to_file" && "$FILE_PATH" == *.js ]]; then
|
||||
echo '{"cancel":true,"errorMessage":"Use .ts files instead of .js in this TypeScript project"}'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo '{"cancel":false}'
|
||||
```
|
||||
|
||||
#### PostToolUse
|
||||
|
||||
Runs after a tool completes (success or failure). Use it to:
|
||||
- Audit tool usage
|
||||
- Validate results
|
||||
- Trigger follow-up actions
|
||||
- Monitor performance
|
||||
|
||||
The input includes execution results:
|
||||
|
||||
```json
|
||||
{
|
||||
"postToolUse": {
|
||||
"toolName": "execute_command",
|
||||
"parameters": { "command": "npm test" },
|
||||
"result": "All tests passed",
|
||||
"success": true,
|
||||
"executionTimeMs": 3450
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<Note>
|
||||
PostToolUse hooks can return `cancel: true` to stop the task, but they cannot undo the tool execution that already happened.
|
||||
</Note>
|
||||
|
||||
### Other Hooks
|
||||
|
||||
#### UserPromptSubmit
|
||||
|
||||
Runs when you send a message to Cline. Use it to:
|
||||
- Log prompts for analytics
|
||||
- Add context based on prompt content
|
||||
- Validate or sanitize prompts
|
||||
|
||||
#### PreCompact
|
||||
|
||||
Runs before Cline truncates conversation history to stay within context limits. Use it to:
|
||||
- Archive important conversation parts before they're removed
|
||||
- Log compaction events
|
||||
- Add a summary of what's being removed
|
||||
|
||||
The input includes context metrics:
|
||||
|
||||
```json
|
||||
{
|
||||
"preCompact": {
|
||||
"taskId": "abc123",
|
||||
"ulid": "01J...",
|
||||
"contextSize": 45,
|
||||
"compactionStrategy": "auto-condense",
|
||||
"tokensIn": 125000,
|
||||
"tokensOut": 8500,
|
||||
"tokensInCache": 0,
|
||||
"tokensOutCache": 0
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
### TypeScript Enforcement
|
||||
|
||||
Block creation of `.js` files in a TypeScript project:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# PreToolUse hook
|
||||
|
||||
INPUT=$(cat)
|
||||
TOOL=$(echo "$INPUT" | jq -r '.preToolUse.toolName')
|
||||
FILE_PATH=$(echo "$INPUT" | jq -r '.preToolUse.parameters.path // empty')
|
||||
|
||||
if [[ "$TOOL" == "write_to_file" && "$FILE_PATH" == *.js ]]; then
|
||||
echo '{"cancel":true,"errorMessage":"Use .ts files instead of .js in this TypeScript project"}'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo '{"cancel":false}'
|
||||
```
|
||||
|
||||
### Tool Usage Logging
|
||||
|
||||
Log all tool executions to a file:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# PostToolUse hook
|
||||
|
||||
INPUT=$(cat)
|
||||
TOOL=$(echo "$INPUT" | jq -r '.postToolUse.toolName')
|
||||
SUCCESS=$(echo "$INPUT" | jq -r '.postToolUse.success')
|
||||
DURATION=$(echo "$INPUT" | jq -r '.postToolUse.executionTimeMs')
|
||||
|
||||
echo "$(date -Iseconds) | $TOOL | success=$SUCCESS | ${DURATION}ms" >> ~/.cline-tool-log.txt
|
||||
|
||||
echo '{"cancel":false}'
|
||||
```
|
||||
|
||||
### Add Project Context on Task Start
|
||||
|
||||
Inject project-specific information when a task begins:
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# TaskStart hook
|
||||
|
||||
INPUT=$(cat)
|
||||
WORKSPACE=$(echo "$INPUT" | jq -r '.workspaceRoots[0] // empty')
|
||||
|
||||
# Read project info if available
|
||||
if [[ -f "$WORKSPACE/.project-context" ]]; then
|
||||
CONTEXT=$(cat "$WORKSPACE/.project-context")
|
||||
echo "{\"cancel\":false,\"contextModification\":\"Project context: $CONTEXT\"}"
|
||||
else
|
||||
echo '{"cancel":false}'
|
||||
fi
|
||||
```
|
||||
|
||||
## CLI Support
|
||||
|
||||
Hooks are available in the [Cline CLI](/cline-cli/getting-started):
|
||||
|
||||
```bash
|
||||
# Enable hooks for a task
|
||||
cline "What does this repo do?" -s hooks_enabled=true
|
||||
|
||||
# Configure hooks globally
|
||||
cline config set hooks-enabled=true
|
||||
```
|
||||
|
||||
<Note>
|
||||
Windows hooks require PowerShell (`powershell.exe`) available on your PATH.
|
||||
</Note>
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Hook not running?**
|
||||
- On macOS/Linux, check that the file is executable (`chmod +x hookname`)
|
||||
- On Windows, ensure PowerShell is available (`powershell -NoProfile -Command "$PSVersionTable.PSVersion"`)
|
||||
- On Windows, ensure the hook file is named `<HookName>.ps1` (for example `PreToolUse.ps1`)
|
||||
- On macOS/Linux, ensure the hook file uses extensionless `<HookName>` naming (for example `PreToolUse`)
|
||||
- On macOS/Linux, verify the hook is enabled (toggle is on in the Hooks tab)
|
||||
- Check that Hooks are enabled globally in Settings
|
||||
|
||||
**Hook output not parsed?**
|
||||
- Ensure output is valid JSON on a single line to stdout
|
||||
- Use stderr (`>&2`) for debug logging, not stdout
|
||||
- Check for trailing characters or newlines before the JSON
|
||||
|
||||
**Hook blocking unexpectedly?**
|
||||
- Review the hook's logic and test with sample input
|
||||
- Check both global and workspace hooks (both run if they exist)
|
||||
|
||||
## Related Features
|
||||
|
||||
- [Rules](/customization/cline-rules) define high-level guidance that hooks can enforce programmatically
|
||||
- [Checkpoints](/core-workflows/checkpoints) let you roll back if a hook didn't catch an issue
|
||||
- [Auto-Approve](/features/auto-approve) works well with hooks as safety nets
|
||||
See details under [SDK Plugins](/sdk/plugins).
|
||||
@@ -1,86 +0,0 @@
|
||||
---
|
||||
title: "Overview"
|
||||
sidebarTitle: "Overview"
|
||||
description: "Understand how Rules, Skills, Workflows, Hooks, and .clineignore work together to customize Cline."
|
||||
---
|
||||
|
||||
Out of the box, Cline is a general-purpose AI assistant. Customizations transform it into an expert on your codebase, your team's conventions, and your workflows. Instead of repeating the same instructions every task, you define them once and Cline follows them automatically.
|
||||
|
||||
Cline offers five systems for this: Rules, Skills, Workflows, Hooks, and .clineignore. Each serves a different purpose and activates at different times.
|
||||
|
||||
## Quick Comparison
|
||||
|
||||
| Feature | Purpose | When Active | Best For |
|
||||
|---------|---------|-------------|----------|
|
||||
| **[Rules](/customization/cline-rules)** | Define how Cline behaves | Always (or contextually) | Coding standards, project constraints, team conventions |
|
||||
| **[Skills](/customization/skills)** | Domain expertise loaded on-demand | Triggered by matching requests | Specialized knowledge, complex procedures, institutional expertise |
|
||||
| **[Workflows](/customization/workflows)** | Step-by-step task automation | Invoked with `/workflow.md` | Repetitive processes, release procedures, setup scripts |
|
||||
| **[Hooks](/customization/hooks)** | Inject custom logic at key moments | Automatically on specific events | Validation, enforcement, monitoring, automation triggers |
|
||||
| **[.clineignore](/customization/clineignore)** | Control file access | Always | Excluding dependencies, build artifacts, large data files |
|
||||
|
||||
## Understanding Each Tool
|
||||
|
||||
**[Rules](/customization/cline-rules)** are always-on guidance. Use them when you want Cline to consistently follow certain patterns: coding standards, naming conventions, architectural constraints, or project-specific context. Rules shape *how* Cline works across all tasks. For example, a rule might say "always use TypeScript" or "follow the repository pattern for data access."
|
||||
|
||||
**[Skills](/customization/skills)** are domain expertise that loads only when relevant. Use them when you have extensive knowledge that would waste context if always active. Cline sees skill descriptions at startup and activates the full instructions only when your request matches. A data analysis skill might include pandas patterns, visualization preferences, and output formats that Cline only loads when you're working with data files.
|
||||
|
||||
**[Workflows](/customization/workflows)** are explicit task scripts you invoke on demand. Use them when you have a repeatable multi-step process that should run the same way every time. Type `/release.md` and Cline executes your release sequence: bump version, run tests, update changelog, commit, tag, push. Workflows define *what* to do, step by step.
|
||||
|
||||
**[Hooks](/customization/hooks)** are programmatic guardrails that run automatically at key moments. Use them when you need to validate, enforce, or extend Cline's behavior with custom code. A hook might block `.js` file creation in a TypeScript project, run linters before saves, or notify external services after deployments.
|
||||
|
||||
**[.clineignore](/customization/clineignore)** controls which files and directories Cline can access. Use it to exclude dependencies, build artifacts, generated files, and large data files from Cline's context. This reduces token usage, lowers costs, and keeps Cline focused on the code that matters. It works like `.gitignore`: add patterns to a `.clineignore` file in your project root and matching files are automatically excluded.
|
||||
|
||||
### Example: A Release Process
|
||||
|
||||
Consider how all five work together for releasing a new version:
|
||||
|
||||
1. **Rules** ensure Cline follows your team's commit message format and versioning policy
|
||||
2. **Skills** offer deep knowledge about your CI/CD system that Cline loads when deployment questions arise
|
||||
3. **Workflows** provide the explicit `/release.md` sequence: bump version, update changelog, tag, push
|
||||
4. **Hooks** validate that tests pass before allowing any commit or that the changelog was actually updated
|
||||
5. **.clineignore** keeps build artifacts, `node_modules/`, and generated files out of Cline's context so it stays focused
|
||||
|
||||
## Storage Locations
|
||||
|
||||
All five systems support both global and project-specific configurations:
|
||||
|
||||
| System | Global Location | Project Location |
|
||||
|--------|-----------------|------------------|
|
||||
| Rules | `~/Documents/Cline/Rules/` | `.clinerules/` |
|
||||
| Skills | `~/.cline/skills/` | `.cline/skills/` |
|
||||
| Workflows | `~/Documents/Cline/Workflows/` | `.clinerules/workflows/` |
|
||||
| Hooks | `~/Documents/Cline/Hooks/` | `.clinerules/hooks/` |
|
||||
| .clineignore | N/A | `.clineignore` |
|
||||
|
||||
### When to Use Each
|
||||
|
||||
**Start with project storage.** Most customizations belong in your project's directory because they're tied to that specific codebase. Team coding standards, deployment workflows, and architectural constraints all live with the code they describe. This also means your customizations travel with the repository, so collaborators get them automatically and changes can be reviewed in pull requests.
|
||||
|
||||
**Use global storage for personal preferences.** If you find yourself adding the same customization to every project, move it to global storage. Your preferred communication style, personal productivity workflows, and tools you use everywhere belong here. Global customizations apply to all projects but stay out of version control, so they won't affect your teammates.
|
||||
|
||||
When names conflict, project-specific configurations take precedence (except for Skills, where global takes precedence). This lets you override global defaults for specific projects when needed.
|
||||
|
||||
## Security Considerations
|
||||
|
||||
<Warning>
|
||||
Always review customizations before adding them to your projects. Only use customizations from sources you trust.
|
||||
</Warning>
|
||||
|
||||
Customizations are powerful. They shape how Cline writes code, execute commands automatically, and influence every interaction. Treat customization files with the same scrutiny you'd give any code running in your environment.
|
||||
|
||||
### Best Practices
|
||||
|
||||
Review any customization file before adding it to your project or global configuration. Understand what it does and why.
|
||||
|
||||
When downloading customizations from GitHub repositories, community shares, or other external sources, verify the source:
|
||||
- Is the author reputable?
|
||||
- Has the community reviewed it?
|
||||
- Does the code do what it claims?
|
||||
|
||||
Look for dangerous commands:
|
||||
- Shell commands that delete files (`rm`, `del`)
|
||||
- Commands that transmit data (`curl`, `wget` with POST)
|
||||
- File operations outside your project directory
|
||||
- Commands that modify system configuration
|
||||
|
||||
Keep your customizations in version control so you can track changes, review diffs, and roll back if something goes wrong. When creating hooks, use the most restrictive event triggers necessary. Don't run hooks on every file save if you only need them before commits.
|
||||
@@ -0,0 +1,138 @@
|
||||
---
|
||||
title: "Plugins"
|
||||
sidebarTitle: "Plugins"
|
||||
description: "Install and manage plugins that extend Cline with custom tools, hooks, and capabilities."
|
||||
---
|
||||
<Warning>
|
||||
This feature currently only applies to Cline SDK, CLI, and Kanban. This feature is not applicable on VSCode and JetBrains Extension for now.
|
||||
</Warning>
|
||||
|
||||
Plugins extend Cline with custom tools, lifecycle hooks, slash commands, and more. They can be installed globally (available in all sessions) or per-project.
|
||||
|
||||
## Installing Plugins via CLI
|
||||
|
||||
The `cline plugin install` command installs plugins from three source types:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Git Repository">
|
||||
```bash
|
||||
cline plugin install https://github.com/owner/repo.git
|
||||
cline plugin install git@github.com:owner/repo.git
|
||||
```
|
||||
|
||||
The installer clones the repository, installs production dependencies, and registers the plugin entry files.
|
||||
|
||||
To install a specific branch or tag, append `@ref`:
|
||||
|
||||
```bash
|
||||
cline plugin install https://github.com/owner/repo.git@v1.2.0
|
||||
cline plugin install https://github.com/owner/repo.git@main
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="npm Package">
|
||||
```bash
|
||||
cline plugin install npm:@scope/my-plugin
|
||||
cline plugin install --npm my-plugin
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="Local Path">
|
||||
```bash
|
||||
cline plugin install ./my-plugin
|
||||
cline plugin install ~/plugins/my-tool
|
||||
cline plugin install /absolute/path/to/plugin.ts
|
||||
```
|
||||
|
||||
Local installs copy the file or directory into the plugin store. Both single `.ts`/`.js` files and directories with a `package.json` are supported.
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
Additional flags:
|
||||
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `--force` | Replace an existing install for the same source |
|
||||
| `--json` | Output the result as JSON (useful for scripting) |
|
||||
| `--cwd <path>` | Install to `<path>/.cline/plugins` instead of the global directory |
|
||||
|
||||
After installation, confirm the plugin is loaded by running `cline config` and checking the plugin tab.
|
||||
|
||||
### Example: TypeScript Navigation Plugin
|
||||
|
||||
The [typescript-lsp-plugin](https://github.com/cline/typescript-lsp-plugin) is a good reference for how plugins work. It adds a `goto_definition` tool that uses the TypeScript Language Service API to resolve symbol definitions through imports, re-exports, and type aliases.
|
||||
|
||||
Install it with:
|
||||
|
||||
```bash
|
||||
cline plugin install https://github.com/cline/typescript-lsp-plugin.git
|
||||
```
|
||||
|
||||
Once installed, Cline can call `goto_definition` with a file path and line number to find where symbols are defined, which is much more precise than text search.
|
||||
|
||||
## Plugin Manifest Format
|
||||
|
||||
For a repository or npm package to be installable as a Cline plugin, its `package.json` should include a `cline` field that declares plugin entry points:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "my-cline-plugin",
|
||||
"version": "1.0.0",
|
||||
"cline": {
|
||||
"plugins": [
|
||||
{
|
||||
"paths": ["./index.ts"],
|
||||
"capabilities": ["tools", "hooks"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The `cline.plugins` array accepts:
|
||||
|
||||
| Format | Example |
|
||||
|--------|---------|
|
||||
| Object with `paths` array | `{ "paths": ["./src/plugin.ts"], "capabilities": ["tools"] }` |
|
||||
| Plain string | `"./index.ts"` |
|
||||
|
||||
Each path should point to a `.ts` or `.js` file that exports an `AgentExtension` (either as the default export or a named export).
|
||||
|
||||
If no `cline.plugins` field is present, the installer falls back to auto-discovery: it looks for standard entry points, then recursively scans for `.ts` and `.js` files (skipping `node_modules` and `.git`).
|
||||
|
||||
### Host-Provided Dependencies
|
||||
|
||||
Dependencies under the `@cline/` scope (like `@cline/core`, `@cline/shared`) are provided by the host runtime. The installer automatically strips these from the plugin's dependency list before running `npm install`, so you should declare them as `peerDependencies`:
|
||||
|
||||
```json
|
||||
{
|
||||
"peerDependencies": {
|
||||
"@cline/core": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@cline/core": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Plugin Directory Structure
|
||||
|
||||
Plugins are stored in the `plugins` directory at two levels:
|
||||
|
||||
```
|
||||
~/.cline/
|
||||
plugins/ # Global plugins
|
||||
_installed/ # Managed by `cline plugin install`
|
||||
npm/ # npm-sourced plugins
|
||||
git/ # git-sourced plugins
|
||||
local/ # local-sourced plugins
|
||||
|
||||
.cline/ # Project root
|
||||
plugins/ # Project-scoped plugins
|
||||
```
|
||||
|
||||
Global plugins (`~/.cline/plugins/`) are available across all sessions. Project plugins (`.cline/plugins/` in your repo) are available only when working in that project.
|
||||
|
||||
## Writing Plugins
|
||||
|
||||
For a guide on building plugins with the SDK, see [Writing Plugins](/sdk/guides/writing-plugins). For the plugin API reference, see [SDK Plugins](/sdk/plugins).
|
||||
@@ -4,7 +4,7 @@ sidebarTitle: "Skills"
|
||||
description: "Modular instruction sets that extend Cline's capabilities for specific tasks."
|
||||
---
|
||||
|
||||
Skills are modular instruction sets that extend Cline's capabilities for specific tasks. Each skill packages detailed guidance, workflows, and optional resources that Cline loads only when relevant to your request.
|
||||
Skills are modular instruction sets that extend Cline's capabilities for specific tasks. Each skill packages detailed guidance, processes, and optional resources that Cline loads only when relevant to your request.
|
||||
|
||||
Install multiple skills and Cline only loads what it needs. A deployment skill stays dormant until you ask about deploying. Unlike [rules](/customization/cline-rules) (which are always active), skills load on-demand so they don't consume context when you're working on something unrelated.
|
||||
|
||||
@@ -24,6 +24,16 @@ Skills use progressive loading to maximize efficiency:
|
||||
|
||||
When you send a message, Cline sees a list of available skills with their descriptions. If your request matches a skill's description, Cline activates it using the `use_skill` tool, which loads the full instructions from SKILL.md.
|
||||
|
||||
## Triggering Skills with Slash Commands
|
||||
|
||||
You can also invoke enabled skills explicitly from the chat input using slash commands.
|
||||
|
||||
1. Type `/` in chat to open command suggestions.
|
||||
2. Select the skill command you want to run (for example, `/aws-deploy`).
|
||||
3. Cline triggers that skill and loads its `SKILL.md` instructions.
|
||||
|
||||
This is useful when you want to force a specific skill immediately instead of waiting for auto-matching based on description.
|
||||
|
||||
## Skill Structure
|
||||
|
||||
Every skill is a directory containing a `SKILL.md` file with YAML frontmatter.
|
||||
@@ -138,7 +148,7 @@ Include real examples. Show what commands to run, what output to expect, and wha
|
||||
|
||||
## Where Skills Live
|
||||
|
||||
Skills can be stored globally or in a project workspace. See [Storage Locations](/customization/overview#storage-locations) for guidance on when to use each.
|
||||
Skills can be stored globally or in a project workspace. See [Storage Locations](/getting-started/config#storage-locations) for guidance on when to use each.
|
||||
|
||||
Project skills:
|
||||
- `.cline/skills/` (recommended)
|
||||
@@ -215,7 +225,7 @@ Cline reads documentation files using `read_file` when the instructions referenc
|
||||
| Use Scripts For | Use Instructions For |
|
||||
|-----------------|---------------------|
|
||||
| Deterministic operations (validation, formatting) | Flexible guidance that adapts to context |
|
||||
| Complex computations | Decision-making workflows |
|
||||
| Complex computations | Decision-making processes |
|
||||
| Operations that need reliability | Steps that might vary by situation |
|
||||
| Anything you'd rather not consume tokens explaining | Best practices and patterns |
|
||||
|
||||
@@ -231,7 +241,7 @@ description: Analyze data files and generate insights. Use when working with CSV
|
||||
|
||||
# Data Analysis
|
||||
|
||||
When analyzing data files, follow this workflow:
|
||||
When analyzing data files, follow this process:
|
||||
|
||||
## 1. Understand the Data
|
||||
- Read a sample of the file to understand its structure
|
||||
|
||||
@@ -1,221 +0,0 @@
|
||||
---
|
||||
title: "Workflows"
|
||||
sidebarTitle: "Workflows"
|
||||
description: "Automate repetitive tasks with Markdown-based workflow files."
|
||||
---
|
||||
|
||||
Workflows are Markdown files that define a series of steps to guide Cline through repetitive or complex tasks. Type `/` followed by the workflow's filename to invoke it (e.g., `/deploy.md`).
|
||||
|
||||
Deploying, setting up a new project, running through a release checklist: these tasks often require remembering a dozen steps, running commands in the right order, and updating files manually. Mess up one step and you're debugging for an hour. Workflows turn those multi-step processes into one command. Type `/release.md` and Cline handles the version bump, runs tests, updates the changelog, commits, tags, and pushes. You just review and approve.
|
||||
|
||||
## Workflow Structure
|
||||
|
||||
A workflow is a markdown file with a title and steps. The filename becomes the command: `demo-workflow.md` is invoked with `/demo-workflow.md`.
|
||||
|
||||
````markdown title="demo-workflow.md"
|
||||
# Demo Workflow
|
||||
|
||||
Brief description of what this workflow accomplishes.
|
||||
|
||||
## Step 1: Check prerequisites
|
||||
Verify the environment is ready. Look for required tools and dependencies.
|
||||
|
||||
## Step 2: Run the build
|
||||
Execute the build command:
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
## Step 3: Verify results
|
||||
Check that the build completed successfully and report any issues.
|
||||
````
|
||||
|
||||
Steps can be written at different levels of detail:
|
||||
|
||||
- **High-level**: "Run the test suite and fix any failures" lets Cline decide how to accomplish the goal
|
||||
- **Specific**: Use XML tool syntax or exact commands when you need precise control
|
||||
|
||||
## Creating Workflows
|
||||
|
||||
<Steps>
|
||||
<Step title="Open the Workflows menu">
|
||||
Click the scale icon at the bottom of the Cline panel, to the left of the model selector. Switch to the Workflows tab.
|
||||
</Step>
|
||||
<Step title="Create a new workflow file">
|
||||
Click "New workflow file..." and enter a filename (e.g., `deploy`). The file will be created with a `.md` extension.
|
||||
</Step>
|
||||
<Step title="Write your workflow">
|
||||
Add a title and numbered steps in markdown format. Describe what each step should accomplish.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Tip>
|
||||
**Create workflows from completed tasks.** After finishing something you'll need to repeat, tell Cline: "Create a workflow for the process I just completed." Cline analyzes the conversation, identifies the steps, and generates the workflow file. Your accumulated context becomes reusable automation.
|
||||
</Tip>
|
||||
|
||||
### Invoking Workflows
|
||||
|
||||
Type `/` in the chat input to see available workflows. Cline shows autocomplete suggestions as you type, so `/rel` would match `release-prep.md`. Select a workflow and press Enter to start it.
|
||||
|
||||
Cline executes each step in sequence, pausing for your approval when needed. You can stop a workflow at any point by rejecting a step.
|
||||
|
||||
### Toggling Workflows
|
||||
|
||||
Every workflow has a toggle to enable or disable it. This lets you control which workflows appear in the `/` menu without deleting the file.
|
||||
|
||||
## Where Workflows Live
|
||||
|
||||
Workflows can be stored in two locations: your project workspace or globally on your system.
|
||||
|
||||
**Workspace workflows** go in `.clinerules/workflows/` at your project root. Use these for project-specific automation like deployment scripts, release processes, or setup procedures that your team shares.
|
||||
|
||||
**Global workflows** go in your system's Cline Workflows directory. Use these for personal productivity workflows you use across all projects.
|
||||
|
||||
### Global Workflows Directory
|
||||
|
||||
| Operating System | Default Location |
|
||||
|------------------|------------------|
|
||||
| Windows | `Documents\Cline\Workflows` |
|
||||
| macOS | `~/Documents/Cline/Workflows` |
|
||||
| Linux/WSL | `~/Documents/Cline/Workflows` |
|
||||
|
||||
Workspace workflows take precedence when names match global workflows. See [Storage Locations](/customization/overview#storage-locations) for more guidance.
|
||||
|
||||
## What Workflows Can Use
|
||||
|
||||
Workflows can combine natural language instructions with specific tool calls. This flexibility lets you write workflows that are as simple or as precise as your task requires.
|
||||
|
||||
### Natural Language
|
||||
|
||||
Write steps as plain instructions. Cline interprets them and figures out which tools to use:
|
||||
|
||||
```markdown
|
||||
## Step 1: Check for uncommitted changes
|
||||
Look at the git status. If there are uncommitted changes, ask whether to continue or abort.
|
||||
|
||||
## Step 2: Run the test suite
|
||||
Execute all tests. If any fail, show the failures and stop.
|
||||
```
|
||||
|
||||
This approach works well when you want Cline to adapt to the situation rather than follow rigid steps.
|
||||
|
||||
### Cline Tools
|
||||
|
||||
For precise control, use Cline's built-in tools with XML syntax. This guarantees specific actions:
|
||||
|
||||
```xml
|
||||
<execute_command>
|
||||
<command>npm run test</command>
|
||||
<requires_approval>false</requires_approval>
|
||||
</execute_command>
|
||||
```
|
||||
|
||||
```xml
|
||||
<read_file>
|
||||
<path>src/config.json</path>
|
||||
</read_file>
|
||||
```
|
||||
|
||||
```xml
|
||||
<ask_followup_question>
|
||||
<question>Deploy to production or staging?</question>
|
||||
<options>["Production", "Staging", "Cancel"]</options>
|
||||
</ask_followup_question>
|
||||
```
|
||||
|
||||
See the full list in the [Cline Tools Reference](/tools-reference/all-cline-tools).
|
||||
|
||||
### CLI Tools
|
||||
|
||||
Reference any command-line tool installed on your machine. Git, npm, docker, gh, make, curl: whatever you have available.
|
||||
|
||||
```bash
|
||||
git log --author="$(git config user.name)" --since="yesterday" --oneline
|
||||
```
|
||||
|
||||
### MCP Tools
|
||||
|
||||
If you have [MCP servers](/mcp/mcp-overview) connected, use them in your workflows with the `use_mcp_tool` syntax. This lets you integrate with external services like GitHub, Slack, databases, or custom internal tools.
|
||||
|
||||
```xml
|
||||
<use_mcp_tool>
|
||||
<server_name>github-server</server_name>
|
||||
<tool_name>create_release</tool_name>
|
||||
<arguments>{"tag": "v1.2.0", "name": "Release v1.2.0", "body": "Changelog content here"}</arguments>
|
||||
</use_mcp_tool>
|
||||
```
|
||||
|
||||
Or describe the intent in natural language and let Cline figure out the tool call:
|
||||
|
||||
```markdown
|
||||
## Step 3: Create GitHub release
|
||||
Use the GitHub MCP server to create a release tagged with the version from package.json.
|
||||
Include the changelog as the release body.
|
||||
```
|
||||
|
||||
## Writing Effective Workflows
|
||||
|
||||
**Start simple.** Write natural language steps first. Only add XML tool calls when you need guaranteed behavior.
|
||||
|
||||
**Be specific about decisions.** If a step requires user input, make that explicit: "Ask whether to deploy to production or staging."
|
||||
|
||||
**Include failure handling.** Tell Cline what to do when something goes wrong: "If tests fail, show the failures and stop the workflow."
|
||||
|
||||
**Keep workflows focused.** A `deploy.md` should deploy. A `setup-db.md` should set up the database. Split complex processes into multiple workflows that can be run independently.
|
||||
|
||||
**Version control your workflows.** Store workflows in `.clinerules/workflows/` and commit them. Your team can share, review, and improve them together.
|
||||
|
||||
<Warning>
|
||||
Workflows execute with your permissions. Review workflows before running them, especially those from external sources.
|
||||
</Warning>
|
||||
|
||||
## Example: Release Preparation
|
||||
|
||||
This workflow automates the tedious pre-release checklist. It verifies your working directory is clean, runs tests and builds, prompts you for the version bump, and generates a changelog from recent commits.
|
||||
|
||||
The workflow demonstrates both approaches: XML tool syntax (`<execute_command>`, `<ask_followup_question>`) for steps that need precise control, and natural language for steps where Cline should adapt to the situation.
|
||||
|
||||
````markdown title="release-prep.md"
|
||||
# Release Preparation
|
||||
|
||||
Prepare a new release by running tests, building, and updating version info.
|
||||
|
||||
## Step 1: Check for clean working directory
|
||||
<execute_command>
|
||||
<command>git status --porcelain</command>
|
||||
</execute_command>
|
||||
|
||||
If there are uncommitted changes, ask whether to continue or stash them first.
|
||||
|
||||
## Step 2: Run the test suite
|
||||
<execute_command>
|
||||
<command>npm run test</command>
|
||||
</execute_command>
|
||||
|
||||
If any tests fail, stop the workflow and report the failures.
|
||||
|
||||
## Step 3: Build the project
|
||||
<execute_command>
|
||||
<command>npm run build</command>
|
||||
</execute_command>
|
||||
|
||||
Verify the build completes without errors.
|
||||
|
||||
## Step 4: Ask for new version
|
||||
<ask_followup_question>
|
||||
<question>What should the new version be?</question>
|
||||
<options>["Patch (x.x.X)", "Minor (x.X.0)", "Major (X.0.0)", "Custom"]</options>
|
||||
</ask_followup_question>
|
||||
|
||||
## Step 5: Update version
|
||||
Update the version in `package.json` to the new version specified by the user.
|
||||
|
||||
## Step 6: Generate changelog entry
|
||||
<execute_command>
|
||||
<command>git log --oneline $(git describe --tags --abbrev=0)..HEAD</command>
|
||||
</execute_command>
|
||||
|
||||
Use these commits to write a changelog entry for the new version.
|
||||
````
|
||||
|
||||
Invoke it with `/release-prep.md` and Cline walks through each step.
|
||||
+469
-207
@@ -56,192 +56,183 @@
|
||||
"navigation": {
|
||||
"tabs": [
|
||||
{
|
||||
"tab": "Docs",
|
||||
"icon": "square-terminal",
|
||||
"tab": "Cline",
|
||||
"icon": "robot",
|
||||
"groups": [
|
||||
{
|
||||
"group": "Home",
|
||||
"pages": [
|
||||
"home",
|
||||
"getting-started/quick-start"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Getting Started",
|
||||
"pages": [
|
||||
"getting-started/what-is-cline",
|
||||
"cline-overview",
|
||||
"getting-started/installing-cline",
|
||||
"getting-started/authorizing-with-cline",
|
||||
"getting-started/your-first-project"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Core Workflows",
|
||||
"pages": [
|
||||
"core-workflows/task-management",
|
||||
"core-workflows/plan-and-act",
|
||||
"core-workflows/working-with-files",
|
||||
"core-workflows/using-commands",
|
||||
"core-workflows/checkpoints"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Customization",
|
||||
"pages": [
|
||||
"customization/overview",
|
||||
"customization/cline-rules",
|
||||
"customization/skills",
|
||||
"customization/workflows",
|
||||
"customization/hooks",
|
||||
"customization/clineignore"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Cline CLI",
|
||||
"pages": [
|
||||
"cline-cli/overview",
|
||||
"cline-cli/installation",
|
||||
"cline-sdk/overview",
|
||||
"cline-cli/interactive-mode",
|
||||
{
|
||||
"group": "Headless Mode",
|
||||
"pages": [
|
||||
"cline-cli/three-core-flows",
|
||||
"cline-cli/samples/overview",
|
||||
"cline-cli/samples/github-issue-rca",
|
||||
"cline-cli/samples/github-integration",
|
||||
"cline-cli/samples/github-pr-review",
|
||||
"cline-cli/samples/model-orchestration",
|
||||
"cline-cli/samples/worktree-workflows"
|
||||
]
|
||||
},
|
||||
"cline-cli/configuration",
|
||||
"cline-cli/acp-editor-integrations",
|
||||
"cline-cli/cli-reference"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Features",
|
||||
"pages": [
|
||||
"features/memory-bank",
|
||||
"features/focus-chain",
|
||||
"features/auto-approve",
|
||||
"features/auto-compact",
|
||||
"features/multiroot-workspace",
|
||||
"features/subagents",
|
||||
"features/background-edit",
|
||||
"features/jupyter-notebooks",
|
||||
"features/deep-planning",
|
||||
"features/web-tools",
|
||||
"features/worktrees"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Models & Providers",
|
||||
"pages": [
|
||||
{
|
||||
"group": "Choosing & Configuring Models",
|
||||
"pages": [
|
||||
"core-features/model-selection-guide",
|
||||
"model-config/context-windows"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Running Models Locally",
|
||||
"group": "Models & Providers",
|
||||
"pages": [
|
||||
"getting-started/authorizing-with-cline",
|
||||
"getting-started/cline-provider",
|
||||
"running-models-locally/overview",
|
||||
"running-models-locally/ollama",
|
||||
"running-models-locally/lm-studio"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Cloud Providers",
|
||||
"pages": [
|
||||
"provider-config/qwen",
|
||||
"provider-config/anthropic",
|
||||
"provider-config/asksage",
|
||||
"provider-config/baseten",
|
||||
"provider-config/cerebras",
|
||||
"provider-config/claude-code",
|
||||
"provider-config/deepseek",
|
||||
"provider-config/doubao",
|
||||
"provider-config/fireworks",
|
||||
"provider-config/gcp-vertex-ai",
|
||||
"provider-config/google-gemini",
|
||||
"provider-config/groq",
|
||||
"provider-config/huawei-cloud-maas",
|
||||
"provider-config/huggingface",
|
||||
"provider-config/minimax",
|
||||
"provider-config/mistral-ai",
|
||||
"provider-config/moonshot",
|
||||
"provider-config/nebius",
|
||||
"provider-config/nousresearch",
|
||||
"provider-config/openai",
|
||||
"provider-config/openai-codex",
|
||||
"provider-config/openrouter",
|
||||
"provider-config/oracle-code-assist",
|
||||
"provider-config/qwen-code",
|
||||
"provider-config/sambanova",
|
||||
"provider-config/together",
|
||||
"provider-config/xai-grok",
|
||||
"provider-config/zai",
|
||||
{
|
||||
"group": "AWS Bedrock",
|
||||
"group": "Cloud Providers",
|
||||
"pages": [
|
||||
"provider-config/aws-bedrock/api-key",
|
||||
"provider-config/aws-bedrock/iam-credentials",
|
||||
"provider-config/aws-bedrock/cli-profile"
|
||||
"provider-config/qwen",
|
||||
"provider-config/anthropic",
|
||||
{
|
||||
"group": "AWS Bedrock",
|
||||
"pages": [
|
||||
"provider-config/aws-bedrock/api-key",
|
||||
"provider-config/aws-bedrock/iam-credentials",
|
||||
"provider-config/aws-bedrock/cli-profile"
|
||||
]
|
||||
},
|
||||
"provider-config/deepseek",
|
||||
"provider-config/google-gemini",
|
||||
"provider-config/minimax",
|
||||
"provider-config/openai",
|
||||
"provider-config/openai-compatible",
|
||||
"provider-config/openrouter",
|
||||
"provider-config/zai",
|
||||
"provider-config/other-30-plus-providers"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"getting-started/config"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Usage",
|
||||
"pages": [
|
||||
"usage/ide",
|
||||
"usage/tui",
|
||||
{
|
||||
"group": "Advanced Configuration",
|
||||
"group": "CLI",
|
||||
"pages": [
|
||||
"provider-config/aihubmix",
|
||||
"provider-config/dify",
|
||||
"provider-config/hicap",
|
||||
"provider-config/litellm-and-cline-using-codestral",
|
||||
"provider-config/openai-compatible",
|
||||
"provider-config/requesty",
|
||||
"provider-config/sap-aicore",
|
||||
"provider-config/vercel-ai-gateway",
|
||||
"provider-config/vscode-language-model-api"
|
||||
"usage/cli-overview",
|
||||
"cli/cli-reference",
|
||||
{
|
||||
"group": "Examples",
|
||||
"pages": [
|
||||
"cli/samples/github-issue-rca",
|
||||
"cli/samples/github-integration",
|
||||
"cli/samples/github-pr-review",
|
||||
"cli/samples/model-orchestration"
|
||||
]
|
||||
},
|
||||
"cli/acp-editor-integrations"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Kanban",
|
||||
"pages": [
|
||||
"usage/kanban",
|
||||
"kanban/core-workflow",
|
||||
"kanban/remote-access"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "MCP (Extending Cline)",
|
||||
"group": "Configurations",
|
||||
"pages": [
|
||||
"tools-reference/all-cline-tools",
|
||||
"customization/cline-rules",
|
||||
"customization/skills",
|
||||
"customization/plugins",
|
||||
"mcp/mcp-overview",
|
||||
"mcp/mcp-marketplace",
|
||||
"mcp/adding-and-configuring-servers",
|
||||
"mcp/mcp-server-development-protocol",
|
||||
"mcp/connecting-to-a-remote-server",
|
||||
"mcp/mcp-transport-mechanisms"
|
||||
"customization/hooks",
|
||||
"cli/scheduling",
|
||||
"cli/connectors",
|
||||
"customization/clineignore"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Tools Reference",
|
||||
"group": "Features",
|
||||
"pages": [
|
||||
"tools-reference/all-cline-tools",
|
||||
"tools-reference/browser-automation"
|
||||
"core-workflows/plan-and-act",
|
||||
"core-workflows/working-with-files",
|
||||
"core-workflows/using-commands",
|
||||
"core-workflows/checkpoints",
|
||||
"cli/agent-teams",
|
||||
"features/subagents"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "IDE Specific Features",
|
||||
"pages": [
|
||||
"features/auto-approve",
|
||||
"features/jupyter-notebooks",
|
||||
"features/multiroot-workspace"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Troubleshooting",
|
||||
"pages": [
|
||||
"troubleshooting/terminal-quick-fixes",
|
||||
"troubleshooting/networking-and-proxies",
|
||||
"troubleshooting/task-history-recovery"
|
||||
"troubleshooting/networking-and-proxies"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tab": "SDK",
|
||||
"icon": "cube",
|
||||
"groups": [
|
||||
{
|
||||
"group": "Start",
|
||||
"pages": [
|
||||
"sdk/overview",
|
||||
"sdk/quickstart"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Contributing",
|
||||
"group": "Concepts",
|
||||
"pages": [
|
||||
"contributing/documentation-guide",
|
||||
"contributing/doc-templates"
|
||||
"sdk/runtime",
|
||||
"sdk/model-providers",
|
||||
{
|
||||
"group": "Tools",
|
||||
"pages": [
|
||||
"sdk/tools",
|
||||
"sdk/guides/creating-custom-tools"
|
||||
]
|
||||
},
|
||||
"sdk/events",
|
||||
{
|
||||
"group": "Plugins",
|
||||
"pages": [
|
||||
"sdk/plugins",
|
||||
"sdk/plugin-install",
|
||||
"sdk/guides/writing-plugins",
|
||||
"sdk/plugin-examples"
|
||||
]
|
||||
},
|
||||
"sdk/guides/scheduled-agents",
|
||||
"sdk/guides/connectors"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Architecture",
|
||||
"pages": [
|
||||
"sdk/architecture/overview",
|
||||
"sdk/architecture/hub-spoke"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "Guides",
|
||||
"pages": [
|
||||
"sdk/guides/building-an-agent",
|
||||
"sdk/guides/permission-handling",
|
||||
"sdk/guides/multi-agent-teams",
|
||||
"sdk/guides/going-to-production"
|
||||
]
|
||||
},
|
||||
{
|
||||
"group": "API Reference",
|
||||
"pages": [
|
||||
"sdk/reference/cline-core",
|
||||
"sdk/reference/agent",
|
||||
"sdk/reference/gateway",
|
||||
"sdk/reference/tools-api",
|
||||
"sdk/reference/events",
|
||||
"sdk/reference/types"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -348,27 +339,6 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tab": "Kanban",
|
||||
"icon": "table-columns",
|
||||
"groups": [
|
||||
{
|
||||
"group": "Cline Kanban",
|
||||
"pages": [
|
||||
"kanban/overview",
|
||||
"kanban/getting-started",
|
||||
"kanban/core-workflow",
|
||||
"kanban/features",
|
||||
"kanban/remote-access"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"tab": "Learn",
|
||||
"icon": "graduation-cap",
|
||||
"href": "https://cline.bot/learn"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -383,53 +353,77 @@
|
||||
{
|
||||
"name": "Overview",
|
||||
"icon": "house",
|
||||
"url": "getting-started/what-is-cline"
|
||||
"url": "cline-overview"
|
||||
}
|
||||
],
|
||||
"redirects": [
|
||||
{
|
||||
"source": "/usage/cli",
|
||||
"destination": "/usage/cli-overview"
|
||||
},
|
||||
{
|
||||
"source": "/getting-started/installing-cline-jetbrains",
|
||||
"destination": "/getting-started/installing-cline"
|
||||
},
|
||||
{
|
||||
"source": "/getting-started/overview",
|
||||
"destination": "/getting-started/what-is-cline"
|
||||
"destination": "/cline-overview"
|
||||
},
|
||||
{
|
||||
"source": "/getting-started/your-first-project",
|
||||
"destination": "/usage/ide"
|
||||
},
|
||||
{
|
||||
"source": "/introduction",
|
||||
"destination": "/getting-started/what-is-cline"
|
||||
"destination": "/cline-overview"
|
||||
},
|
||||
{
|
||||
"source": "/introduction/welcome",
|
||||
"destination": "/getting-started/what-is-cline"
|
||||
"destination": "/cline-overview"
|
||||
},
|
||||
{
|
||||
"source": "/introduction/overview",
|
||||
"destination": "/getting-started/what-is-cline"
|
||||
"destination": "/cline-overview"
|
||||
},
|
||||
{
|
||||
"source": "/getting-started/model-selection-guide",
|
||||
"destination": "/core-features/model-selection-guide"
|
||||
"destination": "/getting-started/cline-provider"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/ollama",
|
||||
"destination": "/running-models-locally/ollama"
|
||||
"destination": "/running-models-locally/overview#runtime-options"
|
||||
},
|
||||
{
|
||||
"source": "/running-models-locally/read-me-first",
|
||||
"destination": "/running-models-locally/overview"
|
||||
},
|
||||
{
|
||||
"source": "/running-models-locally/ollama",
|
||||
"destination": "/running-models-locally/overview#runtime-options"
|
||||
},
|
||||
{
|
||||
"source": "/running-models-locally/lm-studio",
|
||||
"destination": "/running-models-locally/overview#runtime-options"
|
||||
},
|
||||
{
|
||||
"source": "/getting-started/understanding-context-management",
|
||||
"destination": "/model-config/context-windows"
|
||||
"destination": "/getting-started/cline-provider"
|
||||
},
|
||||
{
|
||||
"source": "/best-practices/understanding-context-management",
|
||||
"destination": "/model-config/context-windows"
|
||||
"destination": "/getting-started/cline-provider"
|
||||
},
|
||||
{
|
||||
"source": "/prompting/understanding-context-management",
|
||||
"destination": "/model-config/context-windows"
|
||||
"destination": "/getting-started/cline-provider"
|
||||
},
|
||||
{
|
||||
"source": "/model-config/context-windows",
|
||||
"destination": "/getting-started/cline-provider"
|
||||
},
|
||||
{
|
||||
"source": "/core-features/model-selection-guide",
|
||||
"destination": "/getting-started/cline-provider"
|
||||
},
|
||||
{
|
||||
"source": "/prompting/prompt-engineering-guide",
|
||||
@@ -437,15 +431,23 @@
|
||||
},
|
||||
{
|
||||
"source": "/prompting/cline-memory-bank",
|
||||
"destination": "/features/memory-bank"
|
||||
"destination": "/core-workflows/task-management"
|
||||
},
|
||||
{
|
||||
"source": "/customization/memory-bank",
|
||||
"destination": "/features/memory-bank"
|
||||
"destination": "/core-workflows/task-management"
|
||||
},
|
||||
{
|
||||
"source": "/customization/overview",
|
||||
"destination": "/getting-started/config"
|
||||
},
|
||||
{
|
||||
"source": "/customization/focus-chain",
|
||||
"destination": "/features/focus-chain"
|
||||
"destination": "/core-workflows/using-commands#deep-planning"
|
||||
},
|
||||
{
|
||||
"source": "/features/deep-planning",
|
||||
"destination": "/core-workflows/using-commands#deep-planning"
|
||||
},
|
||||
{
|
||||
"source": "/customization/auto-approve",
|
||||
@@ -459,14 +461,6 @@
|
||||
"source": "/getting-started/your-first-task",
|
||||
"destination": "/getting-started/your-first-project"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/samples",
|
||||
"destination": "/cline-cli/samples/overview"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/overview",
|
||||
"destination": "/cline-cli/getting-started"
|
||||
},
|
||||
{
|
||||
"source": "/features/hooks/real-world-examples",
|
||||
"destination": "/customization/hooks"
|
||||
@@ -571,18 +565,6 @@
|
||||
"source": "/features/slash-commands/new-task",
|
||||
"destination": "/core-workflows/using-commands"
|
||||
},
|
||||
{
|
||||
"source": "/features/slash-commands/workflows/index",
|
||||
"destination": "/customization/workflows"
|
||||
},
|
||||
{
|
||||
"source": "/features/slash-commands/workflows/quickstart",
|
||||
"destination": "/customization/workflows"
|
||||
},
|
||||
{
|
||||
"source": "/features/slash-commands/workflows/best-practices",
|
||||
"destination": "/customization/workflows"
|
||||
},
|
||||
{
|
||||
"source": "/exploring-clines-tools/cline-tools-guide",
|
||||
"destination": "/tools-reference/all-cline-tools"
|
||||
@@ -593,15 +575,15 @@
|
||||
},
|
||||
{
|
||||
"source": "/exploring-clines-tools/remote-browser-support",
|
||||
"destination": "/tools-reference/browser-automation"
|
||||
"destination": "/tools-reference/all-cline-tools"
|
||||
},
|
||||
{
|
||||
"source": "/mcp/adding-mcp-servers-from-github",
|
||||
"destination": "/mcp/adding-and-configuring-servers"
|
||||
"destination": "/mcp/mcp-overview"
|
||||
},
|
||||
{
|
||||
"source": "/mcp/configuring-mcp-servers",
|
||||
"destination": "/mcp/adding-and-configuring-servers"
|
||||
"destination": "/mcp/mcp-overview"
|
||||
},
|
||||
{
|
||||
"source": "/more-info/telemetry",
|
||||
@@ -667,6 +649,14 @@
|
||||
"source": "/features/slash-commands/new-rule",
|
||||
"destination": "/core-workflows/using-commands#newrule"
|
||||
},
|
||||
{
|
||||
"source": "/features/memory-bank",
|
||||
"destination": "/core-workflows/task-management"
|
||||
},
|
||||
{
|
||||
"source": "/features/focus-chain",
|
||||
"destination": "/features/deep-planning"
|
||||
},
|
||||
{
|
||||
"source": "/features/skills",
|
||||
"destination": "/customization/skills"
|
||||
@@ -674,6 +664,278 @@
|
||||
{
|
||||
"source": "/api/reference",
|
||||
"destination": "/api/overview"
|
||||
},
|
||||
{
|
||||
"source": "/cli/overview",
|
||||
"destination": "/usage/cli-overview"
|
||||
},
|
||||
{
|
||||
"source": "/kanban/overview",
|
||||
"destination": "/usage/kanban"
|
||||
},
|
||||
{
|
||||
"source": "/kanban/getting-started",
|
||||
"destination": "/usage/kanban"
|
||||
},
|
||||
{
|
||||
"source": "/kanban/features",
|
||||
"destination": "/usage/kanban"
|
||||
},
|
||||
{
|
||||
"source": "/features/background-edit",
|
||||
"destination": "/features/auto-approve"
|
||||
},
|
||||
{
|
||||
"source": "/features/worktrees",
|
||||
"destination": "/usage/ide"
|
||||
},
|
||||
{
|
||||
"source": "/cli/getting-started",
|
||||
"destination": "/usage/cli-overview"
|
||||
},
|
||||
{
|
||||
"source": "/cli/installation",
|
||||
"destination": "/getting-started/installing-cline"
|
||||
},
|
||||
{
|
||||
"source": "/cli/three-core-flows",
|
||||
"destination": "/usage/cli-overview#headless-mode"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/getting-started",
|
||||
"destination": "/usage/cli-overview"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/installation",
|
||||
"destination": "/getting-started/installing-cline"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/three-core-flows",
|
||||
"destination": "/usage/cli-overview#headless-mode"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/connectors",
|
||||
"destination": "/cli/connectors"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/scheduling",
|
||||
"destination": "/cli/scheduling"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/mcp-servers",
|
||||
"destination": "/mcp/mcp-overview"
|
||||
},
|
||||
{
|
||||
"source": "/cli/mcp-servers",
|
||||
"destination": "/mcp/mcp-overview"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/agent-teams",
|
||||
"destination": "/cli/agent-teams"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/cli-reference",
|
||||
"destination": "/cli/cli-reference"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/configuration",
|
||||
"destination": "/getting-started/config"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/claude-code",
|
||||
"destination": "/provider-config/anthropic"
|
||||
},
|
||||
{
|
||||
"source": "/provider-config/openai-codex",
|
||||
"destination": "/provider-config/openai"
|
||||
},
|
||||
{
|
||||
"source": "/cli/configuration",
|
||||
"destination": "/getting-started/config"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/acp-editor-integrations",
|
||||
"destination": "/cli/acp-editor-integrations"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/samples/github-issue-rca",
|
||||
"destination": "/cli/samples/github-issue-rca"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/samples/github-integration",
|
||||
"destination": "/cli/samples/github-integration"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/samples/github-pr-review",
|
||||
"destination": "/cli/samples/github-pr-review"
|
||||
},
|
||||
{
|
||||
"source": "/cline-cli/samples/model-orchestration",
|
||||
"destination": "/cli/samples/model-orchestration"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/overview",
|
||||
"destination": "/sdk/overview"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/quickstart",
|
||||
"destination": "/sdk/quickstart"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/examples",
|
||||
"destination": "/sdk/guides/building-an-agent"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/agents",
|
||||
"destination": "/sdk/runtime"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/sessions",
|
||||
"destination": "/sdk/runtime"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/tools",
|
||||
"destination": "/sdk/tools"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/streaming-and-events",
|
||||
"destination": "/sdk/events"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/plugins",
|
||||
"destination": "/sdk/plugins"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/hooks",
|
||||
"destination": "/sdk/plugins"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/model-providers",
|
||||
"destination": "/sdk/model-providers"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/guides/building-an-agent",
|
||||
"destination": "/sdk/guides/building-an-agent"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/guides/creating-custom-tools",
|
||||
"destination": "/sdk/guides/creating-custom-tools"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/guides/writing-plugins",
|
||||
"destination": "/sdk/guides/writing-plugins"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/guides/permission-handling",
|
||||
"destination": "/sdk/guides/permission-handling"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/guides/scheduled-agents",
|
||||
"destination": "/sdk/guides/scheduled-agents"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/guides/multi-agent-teams",
|
||||
"destination": "/sdk/guides/multi-agent-teams"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/guides/connectors",
|
||||
"destination": "/sdk/guides/connectors"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/guides/going-to-production",
|
||||
"destination": "/sdk/guides/going-to-production"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/architecture/overview",
|
||||
"destination": "/sdk/architecture/overview"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/architecture/hub-spoke",
|
||||
"destination": "/sdk/architecture/hub-spoke"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/architecture/packages",
|
||||
"destination": "/sdk/architecture/overview"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/reference/cline-core",
|
||||
"destination": "/sdk/reference/cline-core"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/reference/agent",
|
||||
"destination": "/sdk/reference/agent"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/reference/gateway",
|
||||
"destination": "/sdk/reference/gateway"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/reference/tools-api",
|
||||
"destination": "/sdk/reference/tools-api"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/reference/events",
|
||||
"destination": "/sdk/reference/events"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/reference/types",
|
||||
"destination": "/sdk/reference/types"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/extensions",
|
||||
"destination": "/sdk/plugins"
|
||||
},
|
||||
{
|
||||
"source": "/sdk/guides/writing-extensions",
|
||||
"destination": "/sdk/guides/writing-plugins"
|
||||
},
|
||||
{
|
||||
"source": "/cline-sdk/guides/writing-extensions",
|
||||
"destination": "/sdk/guides/writing-plugins"
|
||||
},
|
||||
{
|
||||
"source": "/mcp/mcp-marketplace",
|
||||
"destination": "/mcp/mcp-overview"
|
||||
},
|
||||
{
|
||||
"source": "/mcp/adding-and-configuring-servers",
|
||||
"destination": "/mcp/mcp-overview"
|
||||
},
|
||||
{
|
||||
"source": "/mcp/mcp-server-development-protocol",
|
||||
"destination": "/mcp/mcp-overview"
|
||||
},
|
||||
{
|
||||
"source": "/mcp/connecting-to-a-remote-server",
|
||||
"destination": "/mcp/mcp-overview"
|
||||
},
|
||||
{
|
||||
"source": "/mcp/mcp-transport-mechanisms",
|
||||
"destination": "/mcp/mcp-overview"
|
||||
},
|
||||
{
|
||||
"source": "/sdk/agents",
|
||||
"destination": "/sdk/runtime"
|
||||
},
|
||||
{
|
||||
"source": "/sdk/sessions",
|
||||
"destination": "/sdk/runtime"
|
||||
},
|
||||
{
|
||||
"source": "/sdk/streaming-and-events",
|
||||
"destination": "/sdk/events"
|
||||
},
|
||||
{
|
||||
"source": "/sdk/hooks",
|
||||
"destination": "/sdk/plugins"
|
||||
},
|
||||
{
|
||||
"source": "/sdk/extensions",
|
||||
"destination": "/sdk/plugins"
|
||||
},
|
||||
{
|
||||
"source": "/sdk/examples",
|
||||
"destination": "/sdk/guides/building-an-agent"
|
||||
}
|
||||
],
|
||||
"search": {
|
||||
|
||||
@@ -4,7 +4,7 @@ sidebarTitle: "API Reference"
|
||||
description: "REST API endpoints for managing users, organizations, billing, plans, and API keys."
|
||||
---
|
||||
|
||||
The Enterprise API provides REST endpoints for account management, organization administration, billing, and API key management. These are separate from the [Chat Completions API](/api/reference), which handles model inference.
|
||||
The Enterprise API provides REST endpoints for account management, organization administration, billing, and API key management. These are separate from the [Chat Completions API](/api/overview), which handles model inference.
|
||||
|
||||
## Base URL
|
||||
|
||||
@@ -20,7 +20,7 @@ All endpoints require a Bearer token in the `Authorization` header:
|
||||
Authorization: Bearer YOUR_AUTH_TOKEN
|
||||
```
|
||||
|
||||
Use the same API key or account auth token described in the [public API reference](/api/reference#authentication).
|
||||
Use the same API key or account auth token described in the [public API reference](/api/overview#authentication).
|
||||
|
||||
## Quick Example
|
||||
|
||||
@@ -180,7 +180,7 @@ Track token consumption and costs across your organization.
|
||||
|
||||
## API Keys
|
||||
|
||||
Create and manage API keys for programmatic access. Keys created here work with both the [Chat Completions API](/api/reference) and the endpoints on this page.
|
||||
Create and manage API keys for programmatic access. Keys created here work with both the [Chat Completions API](/api/overview) and the endpoints on this page.
|
||||
|
||||
| Method | Endpoint | Description |
|
||||
|--------|----------|-------------|
|
||||
@@ -193,7 +193,7 @@ Create and manage API keys for programmatic access. Keys created here work with
|
||||
## Related
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Chat Completions API" icon="code" href="/api/reference">
|
||||
<Card title="Chat Completions API" icon="code" href="/api/overview">
|
||||
The public inference API for sending prompts and receiving completions.
|
||||
</Card>
|
||||
<Card title="SSO Setup" icon="key" href="/enterprise-solutions/sso-setup">
|
||||
|
||||
@@ -107,6 +107,8 @@ Select your provider below to begin the configuration process:
|
||||
</Card>
|
||||
|
||||
<Card title="Anthropic" icon="robot" href="/enterprise-solutions/configuration/remote-configuration/anthropic/admin-configuration">
|
||||
Direct Anthropic API access with optional custom base URL configuration.
|
||||
</Card>
|
||||
|
||||
<Card title="LiteLLM" icon="layer-group" href="/enterprise-solutions/configuration/remote-configuration/litellm/admin-configuration">
|
||||
Unified proxy for accessing 100+ AI models through a single interface.
|
||||
|
||||
@@ -150,7 +150,7 @@ Core events tracking task lifecycle, conversation turns, tool usage, and executi
|
||||
| `task.checkpoint_used` | Checkpoint action used | action (create/restore/compare), task_id |
|
||||
| `task.option_selected` | User selected one of AI-provided options | option_index, total_options |
|
||||
| `task.options_ignored` | User ignored AI options and entered custom input | options_count |
|
||||
| `task.slash_command_used` | Slash command/workflow/MCP prompt command used | command_name, is_workflow |
|
||||
| `task.slash_command_used` | Slash command or MCP prompt command used | command_name |
|
||||
| `task.mention_used` | Mention resolution succeeded | mention_type (file/url/folder/terminal/problems/git) |
|
||||
| `task.mention_failed` | Mention resolution failed | mention_type, error_reason |
|
||||
| `task.mention_search_results` | Mention search query result telemetry | query, results_count |
|
||||
@@ -232,7 +232,7 @@ Events tracking user interface interactions.
|
||||
| `ui.model_selected` | Model selected in UI | model, provider, previous_model |
|
||||
| `ui.model_favorite_toggled` | Model favorite toggled | model_id, is_favorited |
|
||||
| `ui.button_clicked` | UI button click event | button_id, context |
|
||||
| `ui.rules_menu_opened` | Rules/workflows menu/modal opened | menu_type |
|
||||
| `ui.rules_menu_opened` | Rules/skills menu/modal opened | menu_type |
|
||||
|
||||
### Example: ui.model_selected
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ Cline includes telemetry to help understand usage patterns and improve the produ
|
||||
|
||||
Telemetry captures anonymous usage events such as:
|
||||
|
||||
- Features used (which tools, commands, workflows)
|
||||
- Features used (which tools and commands)
|
||||
- Task completion rates
|
||||
- Error occurrences
|
||||
- Performance metrics
|
||||
@@ -39,7 +39,7 @@ When telemetry is enabled, Cline captures:
|
||||
<Accordion title="Feature Usage" icon="cursor-click">
|
||||
- Tools executed (e.g., read_file, execute_command)
|
||||
- Slash commands used
|
||||
- Workflows triggered
|
||||
- Skills triggered
|
||||
- Settings changed
|
||||
</Accordion>
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ Now with summarization:
|
||||
- You can work on much larger projects without interruption
|
||||
|
||||
<Tip>
|
||||
Auto Compact works beautifully with [Focus Chain](/features/focus-chain). When Focus Chain is enabled, todo lists persist across summarizations. Cline can work on long-horizon tasks spanning multiple context windows while staying on track.
|
||||
Auto Compact works especially well for long-running tasks. Structured task lists can help maintain progress across summarizations so Cline can stay on track across multiple context windows.
|
||||
</Tip>
|
||||
|
||||
## Cost Considerations
|
||||
@@ -44,15 +44,6 @@ Summarization leverages your existing prompt cache from the conversation, so it
|
||||
|
||||
Since most input tokens are already cached, you're primarily paying for summary generation (output tokens), making it cost-effective.
|
||||
|
||||
## Supported Models
|
||||
|
||||
Auto Compact uses advanced LLM-based summarization for these models:
|
||||
|
||||
- Claude 4 series
|
||||
- Gemini 2.5 series
|
||||
- GPT-5
|
||||
- Grok 4
|
||||
|
||||
<Note>
|
||||
With other models, Cline falls back to standard rule-based context truncation, even if Auto Compact is enabled.
|
||||
</Note>
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
---
|
||||
title: "Background Edit"
|
||||
sidebarTitle: "Background Edit"
|
||||
---
|
||||
|
||||
Background Edit lets Cline make file changes without opening the diff editor, so you can keep writing code while Cline works on other files in the background.
|
||||
|
||||
<Note>
|
||||
This feature is marked as experimental.
|
||||
</Note>
|
||||
|
||||
## How It Works
|
||||
|
||||
By default, Cline opens a side-by-side diff editor tab for each file it modifies. With Background Edit enabled:
|
||||
|
||||
- Edits write directly to your files without opening new tabs
|
||||
- Changes appear as collapsible diff blocks in the chat panel
|
||||
- Your editor focus stays on whatever file you had open
|
||||
|
||||
## Enabling Background Edit
|
||||
|
||||
1. Click the settings icon (gear) in the top-right corner of the Cline panel
|
||||
2. Go to "**Feature Settings**"
|
||||
3. Toggle "**Enable Background Edit**" on
|
||||
|
||||
## Viewing Changes
|
||||
|
||||
File changes display directly in the chat panel with:
|
||||
|
||||
- **File action icons** showing whether the file was added, updated, or deleted
|
||||
- **Stats** showing additions (+) and deletions (-) at a glance
|
||||
- **Collapsible diffs** you can expand or collapse by clicking the file header
|
||||
- **Real-time streaming** as changes appear line-by-line
|
||||
|
||||
Green highlights additions, red highlights deletions.
|
||||
|
||||
## When to Use It
|
||||
|
||||
This feature works well when you:
|
||||
|
||||
- Use [auto-approve mode](/features/auto-approve) and prefer reviewing changes after the fact
|
||||
- Work on tasks with many small file changes
|
||||
- Want to stay focused on your current file
|
||||
|
||||
Stick with the default diff editor if you prefer reviewing each change before it saves, or need to make inline edits to Cline's proposed changes.
|
||||
|
||||
## Relationship with Other Features
|
||||
|
||||
- **Checkpoints**: Still created after each file operation
|
||||
- **Auto-approve**: Pairs well for uninterrupted workflows
|
||||
- **Message editing**: Restoring from a previous message works as expected
|
||||
@@ -1,129 +0,0 @@
|
||||
---
|
||||
title: "Deep Planning"
|
||||
sidebarTitle: "Deep Planning"
|
||||
description: "Transform Cline into a meticulous architect who investigates your codebase and creates comprehensive implementation plans."
|
||||
---
|
||||
|
||||
Deep Planning (`/deep-planning`) turns Cline into an architect before it becomes a builder. Instead of jumping straight into code, Cline systematically explores your codebase, asks targeted questions, and produces a detailed implementation plan — all before writing a single line.
|
||||
|
||||
<Tip>
|
||||
**When should you use this?** Use `/deep-planning` for features that touch multiple files, architectural changes, complex integrations, or any task where "just start coding" would lead to rework.
|
||||
</Tip>
|
||||
|
||||
## How It Works
|
||||
|
||||
Deep Planning follows a four-step process:
|
||||
|
||||
<Steps>
|
||||
<Step title="Silent Investigation">
|
||||
Cline explores your codebase without asking you anything. It reads relevant files, traces dependencies, examines patterns, and builds a mental model of how your project is structured. You'll see Cline reading files and running searches during this phase.
|
||||
|
||||
This step is intentionally silent — Cline gathers context first so it can ask better questions next.
|
||||
</Step>
|
||||
|
||||
<Step title="Discussion">
|
||||
Based on what it learned, Cline asks you targeted, specific questions about your requirements and preferences. These aren't generic questions — they're informed by what Cline found in your code.
|
||||
|
||||
For example, instead of asking "how should authentication work?", Cline might ask "I see you're using JWT tokens in `auth/middleware.ts` with refresh token rotation. Should the new endpoint follow the same pattern, or do you want session-based auth for this feature?"
|
||||
|
||||
Answer these questions to shape the plan. The more specific you are, the better the implementation plan will be.
|
||||
</Step>
|
||||
|
||||
<Step title="Plan Creation">
|
||||
Cline generates a comprehensive `implementation_plan.md` file in your project. This plan typically includes:
|
||||
|
||||
- **Overview** of the feature and its scope
|
||||
- **File-by-file changes** with specific descriptions of what to add, modify, or remove
|
||||
- **Dependencies** between changes (what needs to happen first)
|
||||
- **Edge cases** and error handling considerations
|
||||
- **Testing strategy** for the implementation
|
||||
|
||||
The plan is saved as a markdown file you can review, edit, and share with your team before any code is written.
|
||||
</Step>
|
||||
|
||||
<Step title="Task Creation">
|
||||
After you approve the plan, Cline creates a new task with the implementation steps loaded as trackable items. This gives you a clean context window focused entirely on execution, with the plan serving as the roadmap.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Using Deep Planning
|
||||
|
||||
### Invoking It
|
||||
|
||||
Type `/deep-planning` in the Cline chat input, followed by a description of what you want to build:
|
||||
|
||||
```
|
||||
/deep-planning Add a notification system that sends email and in-app
|
||||
notifications when users receive comments on their posts
|
||||
```
|
||||
|
||||
The more context you provide upfront, the more focused the investigation phase will be. Include:
|
||||
|
||||
- What you want to build
|
||||
- Any constraints or preferences
|
||||
- Which parts of the codebase are relevant (if you know)
|
||||
|
||||
### Reviewing the Plan
|
||||
|
||||
Once Cline generates `implementation_plan.md`, review it carefully:
|
||||
|
||||
1. **Check the scope** — Does it cover everything you need? Is anything missing?
|
||||
2. **Verify the approach** — Does the technical approach match your preferences?
|
||||
3. **Review the order** — Are dependencies handled correctly?
|
||||
4. **Edit if needed** — It's a markdown file. Change anything that doesn't look right.
|
||||
|
||||
Tell Cline about any adjustments before proceeding to implementation.
|
||||
|
||||
## Model-Specific Optimization
|
||||
|
||||
The deep planning prompt is optimized for each model family. Cline adapts its investigation and planning approach based on the strengths of whatever model you're using — whether that's Claude, GPT, Gemini, DeepSeek, or others.
|
||||
|
||||
This means you get effective deep planning regardless of your model choice, though stronger reasoning models will generally produce more thorough plans.
|
||||
|
||||
<Tip>
|
||||
Consider using a stronger reasoning model for the planning phase and a faster model for implementation. You can configure separate models for Plan and Act modes in Cline Settings. See [Plan & Act Mode](/core-workflows/plan-and-act#using-different-models-for-each-mode) for details.
|
||||
</Tip>
|
||||
|
||||
## Pairing with Other Features
|
||||
|
||||
Deep Planning works well with several other Cline features:
|
||||
|
||||
| Feature | How It Helps |
|
||||
|---------|-------------|
|
||||
| [Focus Chain](/features/focus-chain) | Tracks implementation progress against the plan with a visible todo list |
|
||||
| [Memory Bank](/features/memory-bank) | Preserves project context across sessions so deep planning has richer input |
|
||||
| [Plan & Act Mode](/core-workflows/plan-and-act) | Use Plan mode for quick exploration, deep planning for thorough architecture |
|
||||
| [Checkpoints](/core-workflows/checkpoints) | Roll back implementation steps if something goes wrong during execution |
|
||||
|
||||
<Tip>
|
||||
A powerful workflow: run `/deep-planning` to create the plan, enable [Focus Chain](/features/focus-chain) to track progress, then let Cline implement step by step. You get architecture-level thinking with granular progress visibility.
|
||||
</Tip>
|
||||
|
||||
## Deep Planning vs Plan Mode
|
||||
|
||||
Both involve thinking before doing, but they serve different purposes:
|
||||
|
||||
| | Plan Mode | Deep Planning |
|
||||
|---|-----------|---------------|
|
||||
| **Scope** | Quick exploration and discussion | Thorough codebase investigation |
|
||||
| **Output** | Conversation context | `implementation_plan.md` file |
|
||||
| **Best for** | Medium tasks, understanding code | Large tasks, multi-file features |
|
||||
| **Duration** | Minutes | Longer — depends on codebase size |
|
||||
| **Persistence** | Lives in conversation history | Saved as a file you can reference later |
|
||||
|
||||
For most development work, starting in Plan mode is sufficient. Reserve `/deep-planning` for tasks where you'd normally spend significant time planning on a whiteboard before coding.
|
||||
|
||||
## Tips
|
||||
|
||||
- **Be specific in your initial prompt.** "Add authentication" gives a vague plan. "Add OAuth2 authentication with Google and GitHub providers, using our existing user model in `models/user.ts`" gives a focused one.
|
||||
- **Point Cline at relevant files.** Use `@` mentions to highlight key files in your prompt so the investigation phase starts in the right place.
|
||||
- **Edit the plan before implementing.** The generated plan is a starting point. Adjust priorities, remove unnecessary steps, or add details before Cline starts coding.
|
||||
- **Save plans for reference.** The `implementation_plan.md` file is useful documentation even after the feature is built. Consider committing it or moving it to a docs folder.
|
||||
- **Use for onboarding.** Run `/deep-planning` on a feature you're unfamiliar with to get Cline to map out the codebase and explain how things connect.
|
||||
|
||||
## Related
|
||||
|
||||
- [Plan & Act Mode](/core-workflows/plan-and-act) — Cline's dual-mode system for structured development
|
||||
- [Focus Chain](/features/focus-chain) — Automatic todo list tracking for long-running tasks
|
||||
- [Memory Bank](/features/memory-bank) — Structured documentation for cross-session context
|
||||
- [Using Commands](/core-workflows/using-commands) — All available slash commands
|
||||
@@ -1,65 +0,0 @@
|
||||
---
|
||||
title: "Focus Chain"
|
||||
sidebarTitle: "Focus Chain"
|
||||
description: "Automatic todo list management with real-time progress tracking for long-running tasks."
|
||||
---
|
||||
|
||||
Focus Chain is automatic todo list management with real-time progress tracking. It helps Cline work on longer tasks by maintaining a visible checklist that persists across context window resets.
|
||||
|
||||
<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>
|
||||
|
||||
## When to Use It
|
||||
|
||||
Focus Chain works best for:
|
||||
- Multi-step implementations (building a feature end-to-end)
|
||||
- Tasks that might span multiple context windows
|
||||
- Work where you want visibility into Cline's plan
|
||||
|
||||
For quick, single-step requests, Focus Chain adds overhead without much benefit.
|
||||
|
||||
<Tip>
|
||||
Focus Chain pairs well with [Deep Planning](/features/deep-planning). Use `/deep-planning` to create a detailed implementation plan, then let Focus Chain track progress as you execute it.
|
||||
</Tip>
|
||||
|
||||
## Enabling Focus Chain
|
||||
|
||||
1. Click the gear icon in the Cline sidebar
|
||||
2. Navigate to "Features"
|
||||
3. Check "Enable Focus Chain"
|
||||
4. Optionally adjust "Remind Cline Interval" (default: 6 messages)
|
||||
|
||||
| Setting | Default | Description |
|
||||
|---------|---------|-------------|
|
||||
| Enable Focus Chain | Disabled | Enables enhanced task progress tracking |
|
||||
| Remind Cline Interval | 6 | How often Cline updates the todo list (1-100 messages) |
|
||||
|
||||
## How It Works
|
||||
|
||||
When you start a task with Focus Chain enabled, Cline:
|
||||
|
||||
1. Analyzes your request and creates a comprehensive todo list
|
||||
2. Stores it as an editable markdown file
|
||||
3. Updates progress in real-time as work progresses
|
||||
4. Shows a progress indicator in the task header (e.g., "3/8")
|
||||
|
||||
The todo list uses standard markdown checklist syntax:
|
||||
|
||||
```markdown
|
||||
- [x] Set up project structure
|
||||
- [x] Install authentication dependencies
|
||||
- [ ] Create user registration component
|
||||
- [ ] Implement login functionality ← Currently working
|
||||
- [ ] Add password validation
|
||||
- [ ] Write authentication tests
|
||||
```
|
||||
|
||||
## Editing Todo Lists
|
||||
|
||||
Need to adjust the plan? Click the edit button in the expanded todo view. A markdown file opens in your editor where you can add, remove, or reorder items. Save the file and Cline automatically detects your updates.
|
||||
|
||||
For complex projects, start with [Plan Mode](/core-workflows/plan-and-act) to discuss the approach before committing to a todo list.
|
||||
@@ -112,4 +112,4 @@ You can bind any of these commands to keyboard shortcuts for faster access:
|
||||
## Related
|
||||
|
||||
- [All Cline Tools](/tools-reference/all-cline-tools) - Overview of all Cline tools
|
||||
- [Model Selection Guide](/core-features/model-selection-guide) - Choosing the right model for your workflow
|
||||
- [Cline provider](/getting-started/cline-provider) - Fastest way to get started with built-in provider setup
|
||||
|
||||
@@ -1,222 +0,0 @@
|
||||
---
|
||||
title: "Memory Bank"
|
||||
sidebarTitle: "Memory Bank"
|
||||
description: "A structured documentation system that helps Cline maintain context across sessions."
|
||||
---
|
||||
|
||||
Memory Bank is a documentation methodology that transforms Cline from a stateless assistant into a persistent development partner. Through structured markdown files, Cline can "remember" your project details across sessions.
|
||||
|
||||
## Quick Setup
|
||||
|
||||
1. Copy the [custom instructions below](#memory-bank-custom-instructions)
|
||||
2. Add to custom instructions or a [`.clinerules` file](/customization/cline-rules)
|
||||
3. Ask Cline to "initialize memory bank"
|
||||
|
||||
## How It Works
|
||||
|
||||
Memory Bank files are regular markdown files in your project that both you and Cline can access. They're organized hierarchically to build a complete picture of your project:
|
||||
|
||||
```text
|
||||
memory-bank/
|
||||
├── projectbrief.md # Foundation document
|
||||
├── productContext.md # Why this project exists
|
||||
├── activeContext.md # Current work focus
|
||||
├── systemPatterns.md # Architecture & patterns
|
||||
├── techContext.md # Tech stack & setup
|
||||
└── progress.md # Status & milestones
|
||||
```
|
||||
|
||||
<Frame>
|
||||
<img src="https://storage.googleapis.com/cline_public_images/docs/assets/image%20(16).png" alt="Memory Bank file hierarchy showing projectbrief.md at the top flowing into productContext, systemPatterns, and techContext, which feed into activeContext and progress" />
|
||||
</Frame>
|
||||
|
||||
## Core Files
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `projectbrief.md` | Foundation document with core requirements and goals |
|
||||
| `productContext.md` | Why the project exists, problems it solves, UX goals |
|
||||
| `activeContext.md` | Current focus, recent changes, next steps (updates most frequently) |
|
||||
| `systemPatterns.md` | Architecture, design patterns, component relationships |
|
||||
| `techContext.md` | Tech stack, setup, constraints, dependencies |
|
||||
| `progress.md` | What works, what's left, known issues |
|
||||
|
||||
## Key Commands
|
||||
|
||||
- **"follow your custom instructions"** - Tells Cline to read Memory Bank and continue where you left off
|
||||
- **"initialize memory bank"** - Creates the initial structure for a new project
|
||||
- **"update memory bank"** - Triggers a full documentation review and update
|
||||
|
||||
These work alongside Cline's built-in [slash commands](/core-workflows/using-commands). In particular, [`/newtask`](/core-workflows/using-commands#newtask) and [`/smol`](/core-workflows/using-commands#smol) help you manage context windows without losing progress.
|
||||
|
||||
## Working with Plan & Act Modes
|
||||
|
||||
Memory Bank pairs naturally with [Plan & Act mode](/core-workflows/plan-and-act):
|
||||
|
||||
- **Plan mode**: Start here when resuming a project. Ask Cline to read the Memory Bank, review the current state, and discuss strategy before making changes.
|
||||
- **Act mode**: Switch to Act mode once you have a plan. Cline retains everything from the planning session and can implement changes.
|
||||
|
||||
For complex features, use [`/deep-planning`](/core-workflows/using-commands#deep-planning) to have Cline investigate your codebase and create a detailed implementation plan. The Memory Bank gives Cline the project context it needs to plan effectively.
|
||||
|
||||
## Managing Context Windows
|
||||
|
||||
Every AI model has a [context window](/core-workflows/task-management#context-window) that limits how much information it can process at once. As you work, this window fills with conversation history, file contents, and tool results. Memory Bank helps you preserve important knowledge when you need to free up space.
|
||||
|
||||
### Manual approach
|
||||
|
||||
When your context window fills up:
|
||||
|
||||
1. Ask Cline to "update memory bank" to document the current state
|
||||
2. Start a new conversation
|
||||
3. Ask Cline to "follow your custom instructions"
|
||||
|
||||
This preserves important context in your Memory Bank files before the window clears, letting you continue seamlessly in a fresh conversation.
|
||||
|
||||
### Using slash commands
|
||||
|
||||
Cline's built-in commands offer more targeted options:
|
||||
|
||||
- **[`/smol`](/core-workflows/using-commands#smol)** compresses your conversation history while keeping you in the same task. Use this when you want to free up space without starting over.
|
||||
- **[`/newtask`](/core-workflows/using-commands#newtask)** distills key decisions, file changes, and progress into a fresh task with a clean context window. This is like a developer handoff that preserves what matters.
|
||||
|
||||
### Automatic context management
|
||||
|
||||
Enable [Auto-Compact](/features/auto-compact) to let Cline automatically compress context as you work. This reduces how often you need to manually manage the context window, though you should still update the Memory Bank after significant milestones.
|
||||
|
||||
<Frame>
|
||||
<img src="https://storage.googleapis.com/cline_public_images/docs/assets/image%20(18).png" alt="Context window progress bar showing usage approaching the limit" />
|
||||
</Frame>
|
||||
|
||||
## Memory Bank and Checkpoints
|
||||
|
||||
Memory Bank and [Checkpoints](/core-workflows/checkpoints) solve different sides of the same problem:
|
||||
|
||||
- **Memory Bank** preserves *knowledge*: project context, decisions, patterns, and progress across sessions.
|
||||
- **Checkpoints** preserve *code state*: file snapshots you can restore if something goes wrong.
|
||||
|
||||
Together, they let you experiment freely. Checkpoints protect your code, and Memory Bank protects your understanding of the project. If you need to roll back code changes, your Memory Bank still has the context of what you were trying to do and why.
|
||||
|
||||
## Reducing Your Context Footprint
|
||||
|
||||
Memory Bank works best when your starting context is lean. If Cline loads your entire project into context, including dependencies, build artifacts, and generated files, you burn through tokens before the real work starts.
|
||||
|
||||
**Add a [`.clineignore`](/customization/clineignore) file.** This is the single biggest improvement most users can make. It tells Cline which files to skip when scanning your project. Adding one can drop your starting context from 200k+ tokens to under 50k, which means faster responses, lower costs, and the ability to use smaller models effectively.
|
||||
|
||||
**Keep Memory Bank files concise.** Each file adds to your context when Cline reads it at the start of a session. Keep `projectbrief.md` to one page, `activeContext.md` to current state only (not a running log), and `progress.md` to a summary rather than a detailed changelog. If a file grows beyond a page or two, split the detail into a separate doc and link to it. Cline can read linked files on demand.
|
||||
|
||||
**Use [Cline Rules](/customization/cline-rules) strategically.** Rules load into every request. Use [conditional rules](/customization/cline-rules#conditional-rules) to activate rules only when working with matching files, so frontend rules don't load when you're editing backend code.
|
||||
|
||||
## Best Practices
|
||||
|
||||
- Start with a basic project brief and let structure evolve
|
||||
- Let Cline help create the initial structure
|
||||
- `activeContext.md` changes most frequently; update it after each session
|
||||
- `progress.md` tracks milestones; review it when resuming work
|
||||
- Update after significant milestones or direction changes
|
||||
- Use [Cline Rules](/customization/cline-rules) to store the Memory Bank instructions per-project
|
||||
- Add a [`.clineignore`](/customization/clineignore) early to keep your starting context small
|
||||
|
||||
---
|
||||
|
||||
## Memory Bank Custom Instructions
|
||||
|
||||
Copy this into custom instructions or a `.clinerules` file:
|
||||
|
||||
```markdown
|
||||
# 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 core files and optional context files, all in Markdown format. Files build upon each other in a clear hierarchy:
|
||||
|
||||
### 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
|
||||
- Important patterns and preferences
|
||||
- Learnings and project insights
|
||||
|
||||
4. `systemPatterns.md`
|
||||
- System architecture
|
||||
- Key technical decisions
|
||||
- Design patterns in use
|
||||
- Component relationships
|
||||
- Critical implementation paths
|
||||
|
||||
5. `techContext.md`
|
||||
- Technologies used
|
||||
- Development setup
|
||||
- Technical constraints
|
||||
- Dependencies
|
||||
- Tool usage patterns
|
||||
|
||||
6. `progress.md`
|
||||
- What works
|
||||
- What's left to build
|
||||
- Current status
|
||||
- Known issues
|
||||
- Evolution of project decisions
|
||||
|
||||
### Additional Context
|
||||
Create additional files/folders within memory-bank/ when they help organize:
|
||||
- Complex feature documentation
|
||||
- Integration specifications
|
||||
- API documentation
|
||||
- Testing strategies
|
||||
- Deployment procedures
|
||||
|
||||
## 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
|
||||
|
||||
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.
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
**Custom instructions or .clinerules?**
|
||||
Either works. Custom instructions apply globally across all projects. A [`.clinerules` file](/customization/cline-rules) is project-specific and stored in your repo, which makes it easy to share with collaborators. You can also use [conditional rules](/customization/cline-rules#conditional-rules) to activate Memory Bank instructions only when working with `memory-bank/` files.
|
||||
|
||||
**How often should I update?**
|
||||
After significant milestones or direction changes. For active development, every few sessions. You can also let [Auto-Compact](/features/auto-compact) handle routine context management and reserve manual "update memory bank" for important checkpoints.
|
||||
|
||||
**How does Memory Bank relate to checkpoints?**
|
||||
[Checkpoints](/core-workflows/checkpoints) save your code state (file snapshots). Memory Bank saves your project knowledge (context, decisions, progress). They complement each other: checkpoints let you roll back code, Memory Bank lets you pick up where you left off intellectually.
|
||||
|
||||
**How does Memory Bank relate to context window limitations?**
|
||||
Memory Bank stores important information in structured files that Cline can load efficiently at the start of each session. This prevents context bloat while keeping critical information available. For more on how context windows work, see [Task Management](/core-workflows/task-management#context-window).
|
||||
|
||||
**Does this work with other AI tools?**
|
||||
Yes. Memory Bank is a documentation methodology that works with any AI that can read docs. Commands may differ but the approach works across tools.
|
||||
|
||||
**Different from README files?**
|
||||
Memory Bank provides structured, comprehensive documentation designed for AI context management, going beyond what a single README covers. It includes files for active context and progress tracking that change frequently, unlike a typical README.
|
||||
|
||||
For more information, see the [Memory Bank blog post](https://cline.bot/blog/memory-bank-how-to-make-cline-an-ai-agent-that-never-forgets).
|
||||
|
||||
## Related
|
||||
|
||||
- [Plan & Act Mode](/core-workflows/plan-and-act) - Separate thinking from doing with structured planning sessions
|
||||
- [Checkpoints](/core-workflows/checkpoints) - Roll back code changes while keeping your conversation context
|
||||
- [Cline Rules](/customization/cline-rules) - Define persistent instructions including Memory Bank setup
|
||||
- [Task Management](/core-workflows/task-management) - Understand tasks, context windows, and when to start fresh
|
||||
@@ -111,7 +111,7 @@ For each workspace folder, Cline detects:
|
||||
This means Cline understands that your frontend and backend might be at different commits, on different branches, or even use different version control systems.
|
||||
|
||||
<Note>
|
||||
While Cline detects VCS information for all workspace folders, certain features only use the **primary workspace** (the first folder): [Cline rules](/customization/cline-rules), [workflows](/customization/workflows), and [Git-related features](/core-workflows/working-with-files) like `@git` mentions.
|
||||
While Cline detects VCS information for all workspace folders, certain features only use the **primary workspace** (the first folder): [Cline rules](/customization/cline-rules), [skills](/customization/skills#triggering-skills-with-slash-commands), and [Git-related features](/core-workflows/working-with-files) like `@git` mentions.
|
||||
</Note>
|
||||
|
||||
## Referencing Files Across Workspaces
|
||||
|
||||
@@ -24,17 +24,13 @@ Subagent costs (tokens and API spend) are tracked separately per subagent and ro
|
||||
|
||||
## Enabling Subagents
|
||||
|
||||
Subagents are disabled by default. To turn them on:
|
||||
|
||||
1. Open Cline Settings (click the gear icon in the Cline panel)
|
||||
2. Go to **Features**
|
||||
3. Under the **Agent** section, toggle **Subagents** on
|
||||
Subagents are enabled by default. Cline decides when parallel research is worth the overhead — you don't need to opt in or call them out in your prompt. To turn subagents off, disable the `use_subagents` tool in Settings → Features → Agent.
|
||||
|
||||
This setting applies across all editors (VS Code, JetBrains, CLI).
|
||||
|
||||
## Using Subagents
|
||||
|
||||
Cline does not automatically decide to use subagents. You need to ask for them in your prompt. When the feature is enabled and you mention subagents (or describe a task that benefits from parallel exploration), Cline will use the `use_subagents` tool.
|
||||
When subagents are enabled, Cline picks them up on its own when a task benefits from parallel exploration. You can also nudge it explicitly by asking for parallel research in your prompt.
|
||||
|
||||
Example prompts:
|
||||
|
||||
@@ -49,8 +45,6 @@ You can also run only one subagent when the task is small enough that parallel d
|
||||
|
||||
Subagents follow the **Read project files** auto-approve permission. If you have "Read project files" enabled in [Auto Approve](/features/auto-approve), subagent launches will be auto-approved.
|
||||
|
||||
In [YOLO mode](/features/auto-approve#yolo-mode), subagents are always auto-approved.
|
||||
|
||||
If auto-approve is off, Cline will ask for your approval before launching subagents, showing you the prompts it plans to send.
|
||||
|
||||
## What Subagents Can Do
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
---
|
||||
title: "Web Tools"
|
||||
sidebarTitle: "Web Tools"
|
||||
description: "Search the web and fetch content from URLs directly within Cline"
|
||||
---
|
||||
|
||||
Web Tools give Cline the ability to search the internet and fetch content from specific URLs during your tasks. This is useful when you need up-to-date information, documentation lookups, or research that goes beyond your local codebase and the LLM's internal knowledge.
|
||||
|
||||
<Warning>
|
||||
Web Tools require the **Cline provider**. They are not available when using other providers like OpenRouter, Anthropic, AWS Bedrock, etc.
|
||||
</Warning>
|
||||
|
||||
## How Web Tools Work
|
||||
|
||||
Cline has two web tools:
|
||||
|
||||
- **web_search**: Searches the web and returns a list of relevant webpages based on your query
|
||||
- **web_fetch**: Fetches and analyzes content from a specific URL
|
||||
|
||||
When Cline determines that web information would help complete your task, it will use these tools automatically. The tools call Cline's backend API, which handles the search or fetch operation and returns the results.
|
||||
|
||||
## Enabling Web Tools
|
||||
|
||||
Web Tools are available when using the Cline provider. To use them:
|
||||
|
||||
1. Make sure you're signed in to Cline
|
||||
2. Ensure you're using the Cline provider
|
||||
3. Enable the Web Tools toggle in the Feature Settings menu
|
||||
|
||||
<Note>
|
||||
Web tools can be auto-approved using the "Use the browser" setting in [Auto Approve](/features/auto-approve).
|
||||
</Note>
|
||||
|
||||
## Use Cases
|
||||
|
||||
### Looking Up Documentation
|
||||
|
||||
When working with unfamiliar libraries or APIs:
|
||||
- Search for official documentation
|
||||
- Fetch specific API reference pages
|
||||
- Get examples and usage patterns
|
||||
|
||||
### Research Before Implementation
|
||||
|
||||
Before implementing a feature:
|
||||
- Search for best practices and common patterns
|
||||
- Find recent discussions about approaches
|
||||
- Look up known issues or limitations
|
||||
|
||||
### Checking Latest Information
|
||||
|
||||
For time-sensitive information:
|
||||
- Latest release notes and changelogs
|
||||
- Recent bug fixes or security updates
|
||||
- Current recommended versions
|
||||
@@ -1,274 +0,0 @@
|
||||
---
|
||||
title: "Worktrees"
|
||||
sidebarTitle: "Worktrees"
|
||||
---
|
||||
|
||||
Worktrees let you work on multiple branches simultaneously, each in its own folder. This enables Cline to work on tasks in parallel across separate VS Code windows, or lets Cline work independently while you continue coding in your main workspace.
|
||||
|
||||
## What Are Git Worktrees?
|
||||
|
||||
A Git worktree is a linked copy of your repository in a separate folder, checked out to a specific branch. All worktrees share the same Git history and `.git` directory, but each has its own working directory with different code checked out.
|
||||
|
||||
Key concepts:
|
||||
- **Main worktree**: Your original repository folder where the `.git` directory lives
|
||||
- **Linked worktrees**: Additional folders you create, each checked out to a different branch
|
||||
- **Shared history**: All worktrees share commits, branches, and Git configuration
|
||||
|
||||
<Tip>
|
||||
Unlike regular branch switching, worktrees let you have multiple branches checked out at the same time in different folders. This means you can have VS Code windows open for different features simultaneously.
|
||||
</Tip>
|
||||
|
||||
## Why Use Worktrees with Cline?
|
||||
|
||||
Worktrees solve a common problem: **Cline takes over your VS Code window while working on a task**. With worktrees, you can:
|
||||
|
||||
1. **Run Cline in parallel** - Have Cline work on multiple tasks simultaneously, each in its own worktree and VS Code window
|
||||
2. **Keep working while Cline works** - Let Cline handle a task in a separate worktree while you continue coding in your main workspace
|
||||
3. **Isolate experimental changes** - Test risky changes in a worktree without affecting your main branch
|
||||
4. **Quick context switching** - Jump between features without stashing or committing incomplete work
|
||||
|
||||
## Getting Started
|
||||
|
||||
### Quick Launch (Recommended)
|
||||
|
||||
The fastest way to start using worktrees is the **New Worktree Window** button on Cline's home screen:
|
||||
|
||||
1. Click **New Worktree Window** on the home screen
|
||||
2. Enter a branch name and folder path (defaults are auto-filled)
|
||||
3. Click **Create & Open**
|
||||
|
||||
A new VS Code window opens with your worktree, and Cline automatically opens ready to work.
|
||||
|
||||
<Tip>
|
||||
The home screen also shows your current branch and worktree path. Click it to open the full Worktrees view.
|
||||
</Tip>
|
||||
|
||||
### Full Worktrees View
|
||||
|
||||
For more control, open the full Worktrees view by clicking the **Worktrees** button in the Cline sidebar header, or by clicking your current branch info on the home screen:
|
||||
|
||||
<Steps>
|
||||
<Step title="Create a New Worktree">
|
||||
Click **New Worktree** at the bottom of the view. Enter a branch name and path (defaults are auto-filled).
|
||||
</Step>
|
||||
<Step title="Open in New Window">
|
||||
Once created, click the **Open in new window** button to open the worktree in a separate VS Code window. Cline will automatically open in the new window.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Typical Workflow
|
||||
|
||||
Here's how a typical worktree session looks:
|
||||
|
||||
<Steps>
|
||||
<Step title="Create a new worktree">
|
||||
Click **New Worktree Window** on the home screen or use the Worktrees view. A new VS Code window opens with Cline ready to go.
|
||||
</Step>
|
||||
<Step title="Do your work">
|
||||
Work on your feature or let Cline handle a task. Make commits as you go.
|
||||
</Step>
|
||||
<Step title="Close the worktree window">
|
||||
When you're done, close the worktree's VS Code window.
|
||||
</Step>
|
||||
<Step title="Merge from your primary worktree">
|
||||
Back in your main VS Code window, open the Worktrees view and click the **merge button** on the worktree you just worked in. This merges the branch and optionally deletes the worktree.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Managing Worktrees
|
||||
|
||||
### Viewing Worktrees
|
||||
|
||||
The Worktrees view shows all worktrees for your repository:
|
||||
|
||||
- **Current**: The worktree you're currently in (highlighted)
|
||||
- **Main**: The primary worktree where your `.git` directory lives (cannot be deleted)
|
||||
- **Locked**: Worktrees that are locked to prevent accidental deletion
|
||||
|
||||
### Opening Worktrees
|
||||
|
||||
Each worktree has two open options:
|
||||
- **Open in current window**: Replace your current workspace with the worktree
|
||||
- **Open in new window**: Open the worktree in a separate VS Code window (recommended for parallel Cline sessions)
|
||||
|
||||
Either way, Cline automatically opens in the new workspace, ready to start a task.
|
||||
|
||||
### Deleting Worktrees
|
||||
|
||||
Click the trash icon on any linked worktree to delete it. A confirmation dialog will show you exactly what will be deleted:
|
||||
- The branch itself
|
||||
- All project files in the worktree folder
|
||||
|
||||
<Warning>
|
||||
Deleting a worktree permanently removes the branch and all files in that folder. Make sure any important changes are committed and pushed first.
|
||||
</Warning>
|
||||
|
||||
<Note>
|
||||
You cannot delete the main worktree. It's the primary repository where your `.git` directory lives.
|
||||
</Note>
|
||||
|
||||
### Merging Worktrees
|
||||
|
||||
When you're done working in a worktree and ready to merge your changes back to the main branch:
|
||||
|
||||
1. Click the **merge icon** (git merge symbol) on any linked worktree
|
||||
2. Review the merge details in the confirmation modal
|
||||
3. Choose whether to delete the worktree after merging
|
||||
4. Click **Merge**
|
||||
|
||||
#### Handling Merge Conflicts
|
||||
|
||||
If your branch has conflicts with the main branch, Cline will detect them and show you the conflicting files. You have two options:
|
||||
|
||||
1. **Ask Cline to Resolve & Merge** - Creates a new Cline task with a prompt asking Cline to resolve the conflicts, complete the merge, and clean up the worktree
|
||||
2. **Resolve Manually** - Close the modal and resolve conflicts yourself using your preferred Git tools
|
||||
|
||||
<Tip>
|
||||
The "Ask Cline to Resolve" option is particularly useful for complex conflicts. Cline will analyze the conflicting files and attempt to merge them intelligently based on the intent of both branches.
|
||||
</Tip>
|
||||
|
||||
## .worktreeinclude: Automatic File Copying
|
||||
|
||||
When you create a new worktree, it starts with a fresh checkout—no `node_modules`, no build artifacts, no IDE settings. This means you'd normally need to run `npm install` or similar setup commands.
|
||||
|
||||
The `.worktreeinclude` file solves this by automatically copying specified files to new worktrees.
|
||||
|
||||
### How It Works
|
||||
|
||||
1. Create a `.worktreeinclude` file in your repository root
|
||||
2. Add glob patterns for files you want copied (using `.gitignore` syntax)
|
||||
3. When Cline creates a new worktree, files matching **both** `.worktreeinclude` **and** `.gitignore` are copied automatically
|
||||
|
||||
<Note>
|
||||
Only files that are both matched by `.worktreeinclude` AND listed in `.gitignore` are copied. This prevents accidentally duplicating tracked files.
|
||||
</Note>
|
||||
|
||||
### Example `.worktreeinclude`
|
||||
|
||||
```gitignore
|
||||
# Copy node_modules to avoid npm install
|
||||
node_modules/
|
||||
|
||||
# Copy IDE settings
|
||||
.vscode/
|
||||
|
||||
# Copy build cache
|
||||
.next/
|
||||
dist/
|
||||
|
||||
# Copy environment files (if gitignored)
|
||||
.env.local
|
||||
```
|
||||
|
||||
### Creating a `.worktreeinclude` File
|
||||
|
||||
The Worktrees view will show a tip if you don't have a `.worktreeinclude` file. If you have a `.gitignore`, you can click **Create from .gitignore** to create one pre-filled with your gitignore contents. Then edit it to keep only the patterns you want copied.
|
||||
|
||||
<Tip>
|
||||
For most JavaScript/TypeScript projects, just including `node_modules/` in your `.worktreeinclude` saves significant setup time for each new worktree.
|
||||
</Tip>
|
||||
|
||||
### Pro Tip: Symlink to .gitignore
|
||||
|
||||
Since `.gitignore` usually contains most of the files you'd want copied to new worktrees (dependencies, environment files, build caches, etc.), you can create a symlink so they stay in sync automatically:
|
||||
|
||||
```bash
|
||||
# In your repository root
|
||||
ln -s .gitignore .worktreeinclude
|
||||
```
|
||||
|
||||
Now whenever you update your `.gitignore`, your `.worktreeinclude` will have the same patterns. This is especially useful for projects where gitignored files are exactly what you want copied—no need to maintain two separate files.
|
||||
|
||||
<Note>
|
||||
If you need different patterns than your `.gitignore`, create a regular `.worktreeinclude` file instead of a symlink.
|
||||
</Note>
|
||||
|
||||
## Best Practices
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="For Parallel Cline Sessions">
|
||||
1. **Create purpose-specific worktrees** - Name branches clearly (e.g., `cline/refactor-auth`, `cline/add-tests`)
|
||||
2. **Open in new windows** - Always use "Open in new window" for true parallelism
|
||||
3. **Use .worktreeinclude** - Set up automatic file copying to reduce setup time
|
||||
</Accordion>
|
||||
<Accordion title="For Solo Development">
|
||||
1. **Keep your main branch clean** - Use worktrees for experimental or risky changes
|
||||
2. **Quick feature switches** - Instead of stashing, create a worktree for interruptions
|
||||
3. **Review in isolation** - Create worktrees to review PRs without disrupting your work
|
||||
</Accordion>
|
||||
<Accordion title="Worktree Hygiene">
|
||||
1. **Delete unused worktrees** - Remove worktrees when their branches are merged
|
||||
2. **Use meaningful names** - Branch names should indicate the worktree's purpose
|
||||
3. **Check for stale worktrees** - Periodically review and clean up old worktrees
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Limitations
|
||||
|
||||
Worktrees are not available in certain workspace configurations:
|
||||
|
||||
- **Multi-root workspaces**: If you have multiple folders open in VS Code, worktrees are disabled. Open a single repository folder instead.
|
||||
- **Subfolder of a repository**: If you've opened a subfolder within a Git repository (not the root), worktrees are disabled. Open the repository root folder instead.
|
||||
|
||||
The Worktrees view will display a message explaining the limitation if either of these applies to your workspace.
|
||||
|
||||
## Using Worktrees with Cline CLI
|
||||
|
||||
Cline CLI's `--cwd` flag unlocks powerful command-line worktree workflows:
|
||||
|
||||
- **Parallel execution**: Run multiple Cline instances simultaneously in different worktrees
|
||||
- **Context piping**: Pipe output from one worktree as input to another for iterative refinement
|
||||
- **Combined with other features**: Use with `--config` for different models per worktree, or `--thinking` for deep analysis
|
||||
|
||||
Example:
|
||||
```bash
|
||||
# Run parallel tasks in different worktrees
|
||||
cline --cwd ~/worktree-a -y "refactor authentication" &
|
||||
cline --cwd ~/worktree-b -y "add unit tests" &
|
||||
wait
|
||||
```
|
||||
|
||||
For complete CLI worktree patterns and examples, see [Worktree Workflows](/cline-cli/samples/worktree-workflows).
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Branch already exists error">
|
||||
Git doesn't allow the same branch to be checked out in multiple worktrees. Either:
|
||||
- Use a different branch name
|
||||
- Delete the existing worktree using that branch
|
||||
</Accordion>
|
||||
<Accordion title="Worktree folder already exists">
|
||||
The path you specified already contains files. Choose a different path or delete the existing folder first.
|
||||
</Accordion>
|
||||
<Accordion title="Can't delete worktree">
|
||||
If a worktree is locked, you'll need to unlock it first using `git worktree unlock <path>` in the terminal. If the worktree has uncommitted changes, you may need to use force delete.
|
||||
</Accordion>
|
||||
<Accordion title=".worktreeinclude files not copying">
|
||||
Make sure the files you want copied are:
|
||||
1. Listed in your `.worktreeinclude` file
|
||||
2. Also listed in your `.gitignore` (only gitignored files are copied)
|
||||
3. Actually exist in your current worktree
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Technical Details
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="How Worktrees Work Internally">
|
||||
- Worktrees are a native Git feature (`git worktree` command)
|
||||
- All worktrees share the same `.git` directory and object database
|
||||
- Each worktree has its own index, working directory, and HEAD
|
||||
- Worktree list is stored in `.git/worktrees/`
|
||||
</Accordion>
|
||||
<Accordion title="Storage Considerations">
|
||||
- Each worktree contains a full checkout of the repository
|
||||
- `.worktreeinclude` can significantly increase worktree size (e.g., copying `node_modules`)
|
||||
- Consider your disk space when creating many worktrees
|
||||
</Accordion>
|
||||
<Accordion title="Relationship with Checkpoints">
|
||||
Worktrees are separate from Cline's [checkpoint system](/core-workflows/checkpoints). Each worktree has its own checkpoint history. Checkpoints track changes within a single worktree, while worktrees let you work across multiple branches simultaneously.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
Worktrees unlock true parallel development with Cline. Create a worktree, open it in a new window, and let Cline work independently while you continue coding!
|
||||
@@ -1,100 +1,51 @@
|
||||
---
|
||||
title: "Authorization & Model Selection"
|
||||
title: "Authorization"
|
||||
description: "Authenticate with Cline and choose your first AI model"
|
||||
---
|
||||
|
||||
Cline connects to AI models through a **provider**. You have two paths:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Cline Provider" icon="bolt">
|
||||
Sign in with Google, GitHub, or email. No API keys to manage — access multiple models with built-in billing, free options, and early access to new releases.
|
||||
- **Cline Provider** (recommended): sign in with Google/GitHub/email, no API key setup.
|
||||
- **Bring Your Own Key (BYOK)**: use your own provider credentials (cloud or local runtimes).
|
||||
|
||||
**Best for:** Most users, fastest setup
|
||||
</Card>
|
||||
<Card title="Bring Your Own Key (BYOK)" icon="key">
|
||||
Use 3rd party provider or API keys from Anthropic, OpenAI, OpenRouter, or any supported provider. Run models locally with Ollama or LM Studio for complete privacy.
|
||||
## Menu
|
||||
|
||||
**Best for:** Enterprise, custom billing, local models
|
||||
</Card>
|
||||
</CardGroup>
|
||||
- [IDE Setup](#ide-setup)
|
||||
- [CLI Setup](#cli-setup)
|
||||
|
||||
<Tip>
|
||||
**Watch:** [Selecting Your Model](https://youtu.be/GuPmu5TVtfA) walks through choosing and configuring your first model.
|
||||
</Tip>
|
||||
|
||||
## Setup Steps
|
||||
## IDE Setup
|
||||
|
||||
<Steps>
|
||||
<Step title="Open Settings">
|
||||
Click the settings icon in the top-right of the Cline panel.
|
||||
<Step title="Open Cline Settings">
|
||||
Click the settings icon (⚙️) in the Cline panel.
|
||||
</Step>
|
||||
|
||||
<Step title="Select a Provider">
|
||||
Choose from the **API Provider** dropdown:
|
||||
- **Cline** — simplest setup, no API key needed
|
||||
- **OpenRouter** — many models, one API key
|
||||
- **Anthropic** — direct Claude access
|
||||
- **Ollama / LM Studio** — run models locally
|
||||
<Step title="Select Provider">
|
||||
Choose your desired provider from the **API Provider** dropdown.
|
||||
</Step>
|
||||
|
||||
<Step title="Authenticate">
|
||||
**Cline Provider:** Click **Sign In** and authenticate via Google, GitHub, or email. See [OAuth details](#how-oauth-works) below.
|
||||
|
||||
**BYOK:** Paste your API key from your provider's dashboard.
|
||||
|
||||
**Local:** No key needed — just ensure your local server is running.
|
||||
|
||||
<Note>
|
||||
API keys are stored in your system's credential manager and sent only to your selected provider. They are never logged or transmitted to Cline's servers.
|
||||
</Note>
|
||||
- **Cline Provider:** Click **Sign In** and complete OAuth.
|
||||
- **BYOK cloud provider:** Paste your API key into the **API Key** field.
|
||||
- **Local runtime (Ollama/LM Studio):** no key needed; ensure runtime is running.
|
||||
</Step>
|
||||
|
||||
<Step title="Choose a Model">
|
||||
Select a model from the **Model** dropdown. Consider:
|
||||
- **Context window** — how much code the model can process at once
|
||||
- **Speed** — smaller models respond faster
|
||||
- **Cost** — varies by model; local models are free
|
||||
</Step>
|
||||
|
||||
<Step title="Verify">
|
||||
Send any message. If Cline responds, you're ready.
|
||||
<Step title="Select Model">
|
||||
Choose your desired Claude model from the **Model** dropdown.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Cline Provider
|
||||
## Provider Options
|
||||
|
||||
The Cline Provider gives you one account, one billing relationship, and access to models from Anthropic, OpenAI, Google, and more.
|
||||
### Cline Provider
|
||||
|
||||
- **No API key juggling** — one sign-in, multiple models
|
||||
- **Built-in billing** — add credits once, use across all models
|
||||
- **Free models** — search "free" in the model selector to find no-cost options tagged **FREE**
|
||||
- **Stealth models** — early access to new releases before they're widely available
|
||||
- **Always current** — new models added as they launch
|
||||
- One sign-in, no key management
|
||||
- Built-in billing and free model options
|
||||
- Access to multiple providers from one account
|
||||
|
||||
### Adding Credits
|
||||
Add credits in Cline settings or at [app.cline.bot/dashboard](https://app.cline.bot/dashboard).
|
||||
|
||||
Click **Add Credits** in Cline settings or visit your [account dashboard](https://app.cline.bot/dashboard). Credits work across all available models.
|
||||
|
||||
### How OAuth Works
|
||||
|
||||
<Steps>
|
||||
<Step title="Sign In">
|
||||
Click **Sign In** in Cline settings. Your browser opens to `app.cline.bot`.
|
||||
</Step>
|
||||
<Step title="Authenticate">
|
||||
Choose Google, GitHub, or email.
|
||||
</Step>
|
||||
<Step title="Return to IDE">
|
||||
After authentication, you're redirected back with an authorization code.
|
||||
</Step>
|
||||
<Step title="Secure Storage">
|
||||
Tokens are stored in your IDE's native secret storage (VS Code Secrets, JetBrains Credential Store, etc.).
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Bring Your Own Key (BYOK)
|
||||
|
||||
Use your own API keys when you need specific billing arrangements, higher rate limits, access to beta models, or local privacy.
|
||||
### BYOK (cloud + local)
|
||||
|
||||
### Cloud Providers
|
||||
|
||||
@@ -102,9 +53,9 @@ Use your own API keys when you need specific billing arrangements, higher rate l
|
||||
|----------|----------|-------------|
|
||||
| **OpenRouter** | Multiple models, competitive pricing | [Setup](/provider-config/openrouter) |
|
||||
| **Anthropic** | Direct Claude access | [Setup](/provider-config/anthropic) |
|
||||
| **Claude Code** | Claude Max/Pro subscription | [Setup](/provider-config/claude-code) |
|
||||
| **Claude Code** | Claude Max/Pro subscription | [Setup](/provider-config/anthropic) |
|
||||
| **OpenAI** | GPT models | [Setup](/provider-config/openai) |
|
||||
| **Google Gemini** | Large context windows | [Setup](/provider-config/gcp-vertex-ai) |
|
||||
| **Google Gemini** | Gemini models | [Setup](/provider-config/google-gemini) |
|
||||
| **AWS Bedrock** | Enterprise | [Setup](/provider-config/aws-bedrock/api-key) |
|
||||
| **DeepSeek** | Great value | [Setup](/provider-config/deepseek) |
|
||||
|
||||
@@ -114,26 +65,12 @@ Run models on your own hardware for complete privacy and zero per-request costs.
|
||||
|
||||
| Provider | Best For | Setup Guide |
|
||||
|----------|----------|-------------|
|
||||
| **Ollama** | Easy setup, wide model selection | [Setup](/running-models-locally/ollama) |
|
||||
| **LM Studio** | GUI-based model management | [Setup](/running-models-locally/lm-studio) |
|
||||
| **Ollama** | CLI-based local runtime | [Setup](/running-models-locally/overview#runtime-options) |
|
||||
| **LM Studio** | GUI-based local runtime | [Setup](/running-models-locally/overview#runtime-options) |
|
||||
|
||||
Local models require sufficient hardware (especially GPU memory). See [Running Models Locally](/running-models-locally/overview) for requirements.
|
||||
|
||||
## Which Model Should I Choose?
|
||||
|
||||
| Priority | Recommended Model |
|
||||
|----------|-------------------|
|
||||
| **Reliability** | Claude Sonnet 4 |
|
||||
| **Value** | Qwen3 Coder |
|
||||
| **Speed** | Cerebras GLm 4.6 |
|
||||
| **Privacy** | Any Ollama/LM Studio model |
|
||||
| **Existing subscription** | Claude Code with Max/Pro |
|
||||
|
||||
<Note>
|
||||
Learn more about LLMs and models in [Chapter 2 of AI Coding University](https://cline.bot/learn).
|
||||
</Note>
|
||||
|
||||
## CLI Authentication
|
||||
## CLI Setup
|
||||
|
||||
```bash
|
||||
# Authenticate from the terminal
|
||||
@@ -143,12 +80,7 @@ cline auth
|
||||
cline a
|
||||
```
|
||||
|
||||
Opens a browser for OAuth, same as the IDE extension. Your session persists until you sign out.
|
||||
|
||||
## Account Management
|
||||
|
||||
- **Balance & usage:** Open Cline settings — your credit balance is at the top. Click **View Usage** for transaction history.
|
||||
- **Switch organization:** Go to Cline settings → **Switch Organization** to change which billing account is charged.
|
||||
Runs the same auth flow as IDE setup.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@@ -158,9 +90,3 @@ Opens a browser for OAuth, same as the IDE extension. Your session persists unti
|
||||
| Browser doesn't open | Check default browser settings. Copy the URL from the Cline output panel manually. |
|
||||
| Frequent re-authentication | Check org security policies. Ensure you're not clearing IDE secrets. Try a full sign-out/sign-in. |
|
||||
| Can't access organization | Verify membership at [app.cline.bot](https://app.cline.bot). Ask your admin about permissions. Sign out and back in. |
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [Your First Project](/getting-started/your-first-project) — build something with Cline
|
||||
- [Core Workflows](/core-workflows/task-management) — patterns you'll use daily
|
||||
- [Customization](/customization/overview) — tailor Cline to your workflow
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
title: "Cline provider"
|
||||
description: "Use the Cline provider for the fastest setup with built-in authentication and unified billing."
|
||||
---
|
||||
|
||||
The **Cline provider** is the simplest way to get started with Cline.
|
||||
|
||||
Instead of managing separate API keys across multiple vendors, you sign in once and select from available models directly in Cline.
|
||||
|
||||
## Why use Cline provider
|
||||
|
||||
- **Fastest setup**: no manual API key copy/paste
|
||||
- **One account**: sign in once with Google, GitHub, or email
|
||||
- **Unified billing**: one balance across supported models
|
||||
- **Free options**: look for models tagged **FREE** in the selector
|
||||
|
||||
## Setup
|
||||
|
||||
<Steps>
|
||||
<Step title="Open Cline Settings">
|
||||
Click the settings icon in the Cline panel.
|
||||
</Step>
|
||||
|
||||
<Step title="Choose Provider">
|
||||
Set **API Provider** to **Cline**.
|
||||
</Step>
|
||||
|
||||
<Step title="Sign In">
|
||||
Click **Sign In** and complete authentication in your browser.
|
||||
</Step>
|
||||
|
||||
<Step title="Select a Model">
|
||||
Choose a model from the **Model** dropdown.
|
||||
</Step>
|
||||
|
||||
<Step title="Verify">
|
||||
Send a test message. If Cline responds, setup is complete.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Credits and usage
|
||||
|
||||
- Add credits from your [Cline dashboard](https://app.cline.bot/dashboard)
|
||||
- View usage in Cline Settings → **View Usage**
|
||||
- Switch organizations in Cline Settings → **Switch Organization**
|
||||
|
||||
## Related
|
||||
|
||||
- [Authorization](/getting-started/authorizing-with-cline)
|
||||
- [Local models](/running-models-locally/overview)
|
||||
- [Provider setup guides](/provider-config/openrouter)
|
||||
@@ -0,0 +1,165 @@
|
||||
---
|
||||
title: "Config"
|
||||
sidebarTitle: "Config"
|
||||
description: "Understand where Cline stores configuration and how global and project config work together."
|
||||
---
|
||||
|
||||
Cline configuration lives in two scopes:
|
||||
|
||||
- **Global configuration** in `~/.cline/` (applies globally across all Cline applications, including IDE, CLI, and SDK)
|
||||
- **Project configuration** in `.cline/` (applies only to the current workspace)
|
||||
|
||||
## Configuration Directory Layout
|
||||
|
||||
Cline stores shared configuration across a few well-known locations. The primary root is `~/.cline/`, with structured app state under `~/.cline/data/`:
|
||||
|
||||
```text
|
||||
~/.cline/
|
||||
data/
|
||||
settings/
|
||||
providers.json # API keys and provider configuration
|
||||
global-settings.json # Global settings
|
||||
cline_mcp_settings.json # MCP settings
|
||||
teams/ # Team state
|
||||
sessions/ # Session data
|
||||
db/ # SQLite databases (for example cron.db)
|
||||
workflows/ # Global workflows
|
||||
rules/ # Global rules
|
||||
hooks/ # Global hooks
|
||||
skills/ # Global skills
|
||||
agents/ # Global agent definitions
|
||||
plugins/ # Global plugins (.js, .ts)
|
||||
cron/ # Global cron specs
|
||||
```
|
||||
|
||||
Additional global search paths supported by the code:
|
||||
|
||||
```text
|
||||
~/Documents/Cline/
|
||||
Rules/ # Additional global rules
|
||||
Hooks/ # Additional global hooks
|
||||
Plugins/ # Additional global plugins
|
||||
Workflows/ # Additional global workflows
|
||||
```
|
||||
|
||||
Project-level configuration lives in `.cline/` at your repository root:
|
||||
|
||||
```text
|
||||
.cline/
|
||||
rules/ # Project rules
|
||||
skills/ # Project skills
|
||||
hooks/ # Lifecycle hooks
|
||||
agents/ # Project agent definitions
|
||||
plugins/ # Project plugins
|
||||
cron/ # Workspace cron specs
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- Global provider settings, global settings, and MCP settings are stored under `~/.cline/data/settings/`.
|
||||
- Global workflows resolve from `~/.cline/data/workflows/`.
|
||||
- Global rules, hooks, skills, agents, plugins, and cron specs resolve directly under `~/.cline/`.
|
||||
- Rules, hooks, plugins, and workflows may also be discovered from `~/Documents/Cline/` for compatibility.
|
||||
|
||||
## What Goes Where?
|
||||
|
||||
- Use **global (`~/.cline/`)** for defaults shared across all Cline applications (IDE, CLI, SDK) on your machine.
|
||||
- Use **project (`.cline/`)** for team-shared behavior that should travel with the repo.
|
||||
|
||||
Commit `.cline/` files you want to share with your team. Keep secrets out of the repo.
|
||||
|
||||
## Configure Through the CLI
|
||||
|
||||
Use the interactive config UI:
|
||||
|
||||
```bash
|
||||
cline config
|
||||
```
|
||||
|
||||
From there, you can view/edit:
|
||||
|
||||
- Settings (global + workspace)
|
||||
- Rules
|
||||
- Skills
|
||||
- Hooks
|
||||
|
||||
## Useful Configuration Commands
|
||||
|
||||
Use a custom configuration directory:
|
||||
|
||||
```bash
|
||||
cline --config /path/to/custom/config "your task"
|
||||
```
|
||||
|
||||
Or via environment variable:
|
||||
|
||||
```bash
|
||||
export CLINE_DATA_DIR=/custom/path/to/cline
|
||||
cline "your task"
|
||||
```
|
||||
|
||||
View CLI logs when troubleshooting:
|
||||
|
||||
```bash
|
||||
cline dev log
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
| Variable | Description |
|
||||
|----------|-------------|
|
||||
| `CLINE_DATA_DIR` | Custom data directory (replaces `~/.cline/data/`) |
|
||||
| `CLINE_HUB_ADDRESS` | Override hub address (default: `127.0.0.1:25463`) |
|
||||
| `CLINE_SESSION_BACKEND_MODE` | Force backend mode (`local`, `hub`, `remote`, `auto`) |
|
||||
| `CLINE_SANDBOX` | Enable sandbox mode |
|
||||
| `CLINE_SANDBOX_DATA_DIR` | Sandbox session storage directory |
|
||||
| `CLINE_HOOKS_DIR` | Additional hooks directory |
|
||||
| `CLINE_COMMAND_PERMISSIONS` | JSON policy restricting shell commands |
|
||||
|
||||
### CLINE_DATA_DIR
|
||||
|
||||
```bash
|
||||
export CLINE_DATA_DIR=/custom/path/to/cline
|
||||
cline "your task"
|
||||
```
|
||||
|
||||
### CLINE_COMMAND_PERMISSIONS
|
||||
|
||||
Restrict which shell commands Cline can execute:
|
||||
|
||||
```bash
|
||||
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"], "deny": ["rm -rf *"]}'
|
||||
```
|
||||
|
||||
Format:
|
||||
|
||||
```json
|
||||
{
|
||||
"allow": ["pattern1", "pattern2"],
|
||||
"deny": ["pattern3"],
|
||||
"allowRedirects": true
|
||||
}
|
||||
```
|
||||
|
||||
Rules:
|
||||
|
||||
- `deny` overrides `allow`
|
||||
- If `allow` is set, commands not matching `allow` are denied
|
||||
- `allowRedirects` controls shell redirects (`>`, `>>`, `<`), default `false`
|
||||
|
||||
## Related Docs
|
||||
|
||||
- [CLI Configuration](/cli/configuration)
|
||||
- [Rules](/customization/cline-rules)
|
||||
- [Skills](/customization/skills)
|
||||
- [Hooks](/customization/hooks)
|
||||
- [Plugins](/customization/plugins)
|
||||
- [.clineignore](/customization/clineignore)
|
||||
|
||||
## Security Notes
|
||||
|
||||
<Warning>
|
||||
Only use rules, hooks, skills, and plugins from sources you trust.
|
||||
</Warning>
|
||||
|
||||
Hooks and plugins can execute code. Review them like any other executable artifact before adding them globally or to a project.
|
||||
@@ -1,296 +1,139 @@
|
||||
---
|
||||
title: "Installing Cline"
|
||||
description: "Get Cline up and running in your favorite IDE or terminal with these simple installation steps"
|
||||
description: "Choose your installation path: IDE Extension, CLI, SDK, or Kanban"
|
||||
---
|
||||
|
||||
## Before You Begin
|
||||
## Choose Your Install Path
|
||||
|
||||
1. **Create your account** at [app.cline.bot](https://app.cline.bot/login) for access to multiple AI models, seamless setup without managing API keys, and occasional free inferencing.
|
||||
- [IDE Extension](#ide-extension) — VS Code, Cursor, JetBrains, Windsurf, VSCodium, Antigravity
|
||||
- [CLI](#cli) — terminal workflows
|
||||
- [Kanban](#kanban) (preview) — easily manage through multiple agents through a kanban board
|
||||
- [SDK](#sdk) — build with `@cline/sdk`
|
||||
|
||||
2. **Choose your platform**: VS Code, Cursor, Antigravity, JetBrains IDEs, CLI (macOS/Linux preview), Zed, Neovim, VSCodium, or Windsurf.
|
||||
## IDE Extension
|
||||
|
||||
## Installation Instructions
|
||||
Use this if you want Cline inside your editor UI.
|
||||
|
||||
<Tabs>
|
||||
<Tab title="VS Code/Cursor/Antigravity">
|
||||
<Tab title="VS Code / Cursor / Windsurf / VSCodium / Antigravity">
|
||||
<Steps>
|
||||
<Step title="Open VS Code, Cursor, or Antigravity">
|
||||
Launch the editor on your computer.
|
||||
</Step>
|
||||
<Step title="Open Extensions">
|
||||
Press `Ctrl/Cmd + Shift + X` or click the Extensions icon in the Activity Bar.
|
||||
</Step>
|
||||
<Step title="Search for Cline">
|
||||
Type "Cline" in the search bar.
|
||||
</Step>
|
||||
<Step title="Install">
|
||||
Click the **Install** button on the Cline extension.
|
||||
</Step>
|
||||
<Step title="Access Cline">
|
||||
Click the Cline icon in the Activity Bar, or open Command Palette (`Ctrl/Cmd + Shift + P`) and type "Cline: Open In New Tab".
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Tip>
|
||||
If VS Code shows "Running extensions might..." dialog, click **Allow**. If you don't see the Cline icon, restart VS Code.
|
||||
</Tip>
|
||||
</Tab>
|
||||
<Tab title="JetBrains IDEs">
|
||||
<Note>
|
||||
Cline for JetBrains works almost identically to VS Code, with all core features: diff editing, tools, multiple API providers, MCP servers, Cline rules/workflows, and more.
|
||||
</Note>
|
||||
|
||||
<Steps>
|
||||
<Step title="Open your JetBrains IDE">
|
||||
Launch IntelliJ IDEA, PyCharm, WebStorm, or any JetBrains IDE.
|
||||
</Step>
|
||||
<Step title="Open Settings">
|
||||
Press `Ctrl+Alt+S` (Windows/Linux) or `Cmd+,` (macOS).
|
||||
</Step>
|
||||
<Step title="Navigate to Plugins">
|
||||
Go to **Plugins** → **Marketplace** tab.
|
||||
</Step>
|
||||
<Step title="Install Cline">
|
||||
Search for "Cline" and click **Install**.
|
||||
</Step>
|
||||
<Step title="Restart IDE">
|
||||
Restart your IDE to complete the installation.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
Find Cline in **View** → **Tool Windows** → **Cline** (usually on the right side).
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Alternative Installation Methods">
|
||||
**Browser Install:**
|
||||
1. Go to the [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/28247-cline)
|
||||
2. Click **Install to IDE**
|
||||
3. Confirm in your IDE and restart
|
||||
|
||||
**Manual Install:**
|
||||
1. Download from the [marketplace page](https://plugins.jetbrains.com/plugin/28247-cline)
|
||||
2. Go to **Settings** → **Plugins** → gear icon → **Install Plugin from Disk**
|
||||
3. Select the downloaded `.zip` file and restart
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Terminal Integration Difference">
|
||||
JetBrains shows terminal output differently than VS Code. In VS Code, output streams directly to chat. In JetBrains, output appears in collapsible "Command Output" sections.
|
||||
|
||||
Commands execute successfully in both. Expand the section to see results in JetBrains.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
</Tab>
|
||||
<Tab title="CLI">
|
||||
<Warning>
|
||||
**Preview Release**: Cline CLI is currently in preview and only available for macOS and Linux. Windows support is coming soon.
|
||||
</Warning>
|
||||
|
||||
Cline CLI runs AI coding agents directly in your terminal. Use it for automated code reviews in CI/CD, multi-instance development, or shell workflow integration.
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Node.js 20+">
|
||||
Check your version with `node --version`. If needed, visit [nodejs.org](https://nodejs.org) or use nvm.
|
||||
</Step>
|
||||
<Step title="Install Cline CLI">
|
||||
Run `npm install -g cline` in your terminal.
|
||||
</Step>
|
||||
<Step title="Authenticate">
|
||||
Run `cline auth` to sign in and configure your AI model provider.
|
||||
</Step>
|
||||
<Step title="Run Cline">
|
||||
Run `cline` to start an interactive session, or `cline "Your task here"` for headless execution.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Tip>
|
||||
Want to learn more? See the [Cline CLI documentation](/cline-cli/getting-started) for advanced usage patterns like multi-instance development and CI/CD integration.
|
||||
</Tip>
|
||||
</Tab>
|
||||
<Tab title="Zed/Neovim (ACP via CLI)">
|
||||
<Note>
|
||||
**ACP (Agent Client Protocol)** lets you run Cline in any ACP-compatible editor via the CLI. This gives you full access to Cline's capabilities—including Skills, Hooks, and MCP integrations—in your preferred editor.
|
||||
</Note>
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Node.js 20+">
|
||||
Check your version with `node --version`. If needed, visit [nodejs.org](https://nodejs.org) or use nvm.
|
||||
</Step>
|
||||
<Step title="Install Cline CLI">
|
||||
```bash
|
||||
npm install -g cline
|
||||
```
|
||||
</Step>
|
||||
<Step title="Authenticate">
|
||||
```bash
|
||||
cline auth
|
||||
```
|
||||
</Step>
|
||||
<Step title="Configure your editor">
|
||||
<Tabs>
|
||||
<Tab title="Zed">
|
||||
Open Zed settings (`Cmd/Ctrl + ,`) and add Cline to your `settings.json`:
|
||||
```json
|
||||
{
|
||||
"agent_servers": {
|
||||
"Cline": {
|
||||
"type": "custom",
|
||||
"command": "cline",
|
||||
"args": ["--acp"],
|
||||
"env": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
Then open the AI assistant panel, select **Cline** from the agent dropdown, and start coding.
|
||||
</Tab>
|
||||
<Tab title="Neovim (agentic.nvim)">
|
||||
Install [agentic.nvim](https://github.com/carlos-algms/agentic.nvim) using lazy.nvim:
|
||||
```lua
|
||||
{
|
||||
"carlos-algms/agentic.nvim",
|
||||
opts = {
|
||||
provider = "cline-acp",
|
||||
acp_providers = {
|
||||
["cline-acp"] = {
|
||||
command = "cline",
|
||||
args = {"--acp"},
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{"<C-\\>", function() require("agentic").toggle() end, mode={"n","v","i"}, desc="Toggle Cline Chat"},
|
||||
},
|
||||
}
|
||||
```
|
||||
Press `<C-\>` to toggle the Cline chat panel.
|
||||
</Tab>
|
||||
<Tab title="Neovim (avante.nvim)">
|
||||
Follow the [avante.nvim documentation](https://github.com/yetone/avante.nvim) for configuring external ACP agents and point it to `cline --acp`.
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Tip>
|
||||
For full details on ACP editor integrations—including JetBrains ACP setup and troubleshooting—see the [ACP Editor Integrations](/cline-cli/acp-editor-integrations) guide.
|
||||
</Tip>
|
||||
</Tab>
|
||||
<Tab title="VSCodium/Windsurf">
|
||||
<Note>
|
||||
These editors use the **Open VSX Registry** instead of the VS Code Marketplace, but the installation process is nearly identical.
|
||||
</Note>
|
||||
|
||||
<Steps>
|
||||
<Step title="Open your editor">
|
||||
Launch VSCodium, Windsurf, or another Open VSX-compatible editor.
|
||||
</Step>
|
||||
<Step title="Open Extensions">
|
||||
Press `Ctrl/Cmd + Shift + X`.
|
||||
</Step>
|
||||
<Step title="Search for Cline">
|
||||
Type "Cline" in the search bar.
|
||||
Type `Cline`.
|
||||
</Step>
|
||||
<Step title="Install">
|
||||
Select "Cline" by saoudrizwan and click **Install**.
|
||||
Click **Install** on the Cline extension.
|
||||
</Step>
|
||||
<Step title="Reload">
|
||||
Reload your editor if prompted.
|
||||
<Step title="Open Cline">
|
||||
Use the Cline activity bar icon, or run `Cline: Open In New Tab` from Command Palette.
|
||||
</Step>
|
||||
<Step title="Authorize with Cline">
|
||||
After installing the extension, complete provider setup in Cline settings.
|
||||
|
||||
[Authorize with Cline](/getting-started/authorizing-with-cline)
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
Look for the Cline icon in your Activity Bar or use the Command Palette.
|
||||
<Note>
|
||||
Windsurf and VSCodium use Open VSX. The install flow is the same.
|
||||
</Note>
|
||||
</Tab>
|
||||
|
||||
<Tab title="JetBrains">
|
||||
<Steps>
|
||||
<Step title="Open Plugins Marketplace">
|
||||
**Settings** → **Plugins** → **Marketplace**.
|
||||
</Step>
|
||||
<Step title="Install Cline">
|
||||
Search `Cline`, click **Install**, then restart the IDE.
|
||||
</Step>
|
||||
<Step title="Open Cline">
|
||||
**View** → **Tool Windows** → **Cline**.
|
||||
</Step>
|
||||
<Step title="Authorize with Cline">
|
||||
After installing the extension, complete provider setup in Cline settings.
|
||||
|
||||
[Authorize with Cline](/getting-started/authorizing-with-cline)
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
Alternative: install from the [JetBrains Marketplace](https://plugins.jetbrains.com/plugin/28247-cline).
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Sign In & Start Building
|
||||
## CLI
|
||||
|
||||
<Note>
|
||||
**CLI users:** If you installed via CLI, you already authenticated during setup with `cline auth`. You're ready to go!
|
||||
</Note>
|
||||
Use this if you want Cline in terminal workflows (interactive + automation).
|
||||
|
||||
1. **Open Cline** in your editor:
|
||||
- **VS Code/Cursor/Antigravity/VSCodium/Windsurf:** Click the Cline icon in the Activity Bar
|
||||
- **JetBrains:** Go to **View** → **Tool Windows** → **Cline**
|
||||
<Steps>
|
||||
<Step title="Install Node.js">
|
||||
Install Node.js 20+ (22 recommended).
|
||||
</Step>
|
||||
<Step title="Install CLI">
|
||||
```bash
|
||||
npm install -g cline
|
||||
```
|
||||
</Step>
|
||||
<Step title="Authenticate">
|
||||
```bash
|
||||
cline auth
|
||||
```
|
||||
</Step>
|
||||
<Step title="Run Cline">
|
||||
```bash
|
||||
cline
|
||||
# or
|
||||
cline "your task"
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
2. **Sign in** by clicking the **Sign Up** button in the Cline interface. You'll be redirected to [app.cline.bot](https://app.cline.bot) to authenticate.
|
||||
More details: [CLI Installation & Setup](/usage/cli-overview)
|
||||
|
||||
<Tip>
|
||||
Learn more about [authorizing with Cline](/getting-started/authorizing-with-cline), including how OAuth authentication works, using API keys with other providers, and troubleshooting auth issues.
|
||||
</Tip>
|
||||
## Kanban
|
||||
|
||||
3. **Start building!** After signing in, you'll automatically return to your editor-Cline is ready to help.
|
||||
Use this if you want task-board workflows with agent execution.
|
||||
|
||||
## Setting Up Cline in the Right Sidebar
|
||||
<Steps>
|
||||
<Step title="Install Node.js">
|
||||
Install Node.js 18+.
|
||||
</Step>
|
||||
<Step title="Launch Kanban">
|
||||
```bash
|
||||
npx kanban
|
||||
```
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
For the best coding experience, we recommend moving Cline to the right sidebar. This keeps your project files visible on the left while you chat with Cline on the right, giving you full visibility of your codebase as Cline works.
|
||||
More details: [Kanban](/usage/kanban)
|
||||
|
||||
<Tabs>
|
||||
<Tab title="VS Code">
|
||||
<Steps>
|
||||
<Step title="Align Extension View">
|
||||
Make sure your extension view is aligned vertically to the left.
|
||||
</Step>
|
||||
<Step title="Open Right Side View">
|
||||
Click the button that opens the right side panel (typically used for GitHub Copilot chat), or use `Option + Cmd/Ctrl + B`.
|
||||
</Step>
|
||||
<Step title="Drag Cline Icon">
|
||||
Drag the Cline icon over to the nav panel at the top of that right view.
|
||||
</Step>
|
||||
</Steps>
|
||||
## SDK
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/vscode_right_view.gif"
|
||||
alt="VS Code Right Sidebar Setup"
|
||||
/>
|
||||
</Frame>
|
||||
</Tab>
|
||||
<Tab title="Cursor">
|
||||
<Steps>
|
||||
<Step title="Set Vertical Activity Bar">
|
||||
Cursor uses a horizontal activity bar by default. To switch to vertical:
|
||||
1. Open Command Palette (`Cmd/Ctrl + Shift + P`)
|
||||
2. Search for "Preferences: Open Settings (UI)"
|
||||
3. Search for `workbench.activityBar.orientation`
|
||||
4. Set the value to `vertical`
|
||||
5. Restart Cursor
|
||||
</Step>
|
||||
<Step title="Open the AI Pane">
|
||||
Click the Cursor cube icon (AI Pane) to open the right side view panel.
|
||||
</Step>
|
||||
<Step title="Drag Cline to the AI Pane">
|
||||
Drag the Cline icon directly into the AI Pane sidebar.
|
||||
</Step>
|
||||
</Steps>
|
||||
Use this if you are building your own app/agent on top of Cline.
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/Cursor-sidebar.gif"
|
||||
alt="Cursor Right Sidebar Setup"
|
||||
/>
|
||||
</Frame>
|
||||
</Tab>
|
||||
</Tabs>
|
||||
<Steps>
|
||||
<Step title="Create project">
|
||||
```bash
|
||||
mkdir my-agent && cd my-agent
|
||||
npm init -y
|
||||
```
|
||||
</Step>
|
||||
<Step title="Install SDK">
|
||||
```bash
|
||||
npm install @cline/sdk
|
||||
```
|
||||
</Step>
|
||||
<Step title="Build and run">
|
||||
Follow the SDK quickstart to run your first agent.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## Troubleshooting
|
||||
Start here: [SDK Quickstart](/sdk/quickstart)
|
||||
|
||||
### Can't Find Cline in the Marketplace
|
||||
|
||||
Sometimes Cline doesn't show up in search results if you're looking in the wrong tab or using an incompatible IDE version. Make sure you're searching in the **Marketplace** tab (not Installed), try searching for "Cline AI" instead, and verify your IDE is up to date. If installation fails, restart your IDE and check your internet connection.
|
||||
|
||||
### Cline Icon Not Appearing After Install
|
||||
|
||||
The most common fix is a full restart-close your IDE completely (File → Exit) and reopen it. In VS Code/Cursor/VSCodium, you can also open the Command Palette (`Ctrl/Cmd + Shift + P`) and type "Cline: Open In New Tab". In JetBrains, check **View** → **Tool Windows** → **Cline**. If it's still missing, verify the plugin is enabled in your Extensions/Plugins settings.
|
||||
|
||||
### CLI: Node.js or Permission Errors
|
||||
|
||||
Cline CLI requires Node.js 20 or higher. Run `node --version` to check-if you need to upgrade, use nvm (`nvm install 22 && nvm use 22`) or download from [nodejs.org](https://nodejs.org). For permission errors on `npm install -g`, either prefix with `sudo` on macOS/Linux or configure npm to use a user-owned directory for global packages.
|
||||
|
||||
### Plugin Installed But Not Working
|
||||
|
||||
If Cline appears installed but doesn't respond, try disabling and re-enabling the extension in your IDE's settings. Check the Developer Console (VS Code: Help → Toggle Developer Tools) or Event Log (JetBrains) for error messages. Also ensure you're using a supported IDE version and close any resource-intensive extensions that might interfere.
|
||||
|
||||
## Need Help?
|
||||
|
||||
- Join our [Discord community](https://discord.gg/cline) for support, tips, and discussions.
|
||||
- [Read the docs](/getting-started/authorizing-with-cline) to explore model selection guides and advanced features.
|
||||
- [Troubleshooting](/troubleshooting/terminal-quick-fixes)
|
||||
- [Discord community](https://discord.gg/cline)
|
||||
@@ -1,101 +0,0 @@
|
||||
---
|
||||
title: "Quick Start"
|
||||
sidebarTitle: "Quick Start"
|
||||
description: "Get Cline running in under 2 minutes."
|
||||
---
|
||||
|
||||
Cline is an AI-powered coding assistant that works directly inside your editor. You describe what you want in plain text, and Cline writes code, creates files, runs terminal commands, and even tests web apps in a browser, all while asking for your permission before making any changes.
|
||||
|
||||
Think of it as pair programming with an AI that can actually touch your files and run your tools, but only when you say so.
|
||||
|
||||
This guide gets you from zero to working code in under 2 minutes.
|
||||
|
||||
<Info>
|
||||
**What You'll Need:**
|
||||
- One of: **VS Code**, **Cursor**, **Windsurf**, **Antigravity**, a **JetBrains IDE**, or **Node.js 20+** (for CLI)
|
||||
- An internet connection (Cline connects to AI models in the cloud)
|
||||
- ~2 minutes
|
||||
</Info>
|
||||
|
||||
## 1. Install
|
||||
|
||||
<Tabs>
|
||||
<Tab title="VS Code / Cursor / Windsurf / Antigravity">
|
||||
Open Extensions (`Cmd+Shift+X` on Mac, `Ctrl+Shift+X` on Windows/Linux), search **Cline**, click **Install**.
|
||||
</Tab>
|
||||
<Tab title="JetBrains">
|
||||
Go to **Settings > Plugins > Marketplace**, search **Cline**, click **Install**, then restart your IDE.
|
||||
</Tab>
|
||||
<Tab title="CLI">
|
||||
```bash
|
||||
npm install -g cline
|
||||
```
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
<Tip>
|
||||
For detailed installation instructions including troubleshooting, see the [full installation guide](/getting-started/installing-cline).
|
||||
</Tip>
|
||||
|
||||
## 2. Authenticate
|
||||
|
||||
Click the Cline icon in your editor's sidebar, then click **Sign Up**. You'll authenticate at [app.cline.bot](https://app.cline.bot) and return to your editor ready to go.
|
||||
|
||||
Authenticating gives you access to multiple AI models without managing separate API keys. Your account includes both free and paid models. Free models are labeled **FREE** in the model selector. For paid models, you can add credits in your [account dashboard](https://app.cline.bot/dashboard). You're always in control of which model you use.
|
||||
|
||||
Send any message to confirm you're connected, then move on to building something.
|
||||
|
||||
<Note>
|
||||
**CLI users:** Run `cline auth` to authenticate from your terminal.
|
||||
</Note>
|
||||
|
||||
## 3. Build Something
|
||||
|
||||
Now let's have Cline write some code. Open any folder in your editor, then paste this:
|
||||
|
||||
```text
|
||||
Create a Python function that checks if a string is a palindrome. Include tests.
|
||||
```
|
||||
|
||||
Cline will analyze your request, create a new file, and ask for your approval before writing anything to disk. Click **Approve** to create the file.
|
||||
|
||||
That's it. You have working code with tests.
|
||||
|
||||
<Note>
|
||||
**Not seeing file changes?** You might be in **Plan Mode**, where Cline discusses the approach without modifying files. Look for the **Plan/Act toggle** at the bottom of the Cline panel and switch to **Act** to let Cline start writing code. [Learn more about Plan & Act →](/core-workflows/plan-and-act)
|
||||
</Note>
|
||||
|
||||
## 4. You're All Set
|
||||
|
||||
Let's recap what you just did:
|
||||
|
||||
1. **Installed Cline** in your editor
|
||||
2. **Authenticated** to connect to AI models
|
||||
3. **Built working code**: Cline wrote it, you approved it
|
||||
|
||||
Every step of the way, Cline showed you exactly what it planned to do and waited for your approval. This is Cline's **human-in-the-loop** model: every file edit, terminal command, and browser action is shown to you first and only happens after you click Approve. You can review exactly what's changing, reject anything you don't want, and stay fully in control of your codebase. Nothing happens behind your back.
|
||||
|
||||
## What Else Can Cline Do?
|
||||
|
||||
The palindrome example is just the beginning. Here are some prompts to explore Cline's full capabilities:
|
||||
|
||||
- `Read my project and explain the architecture`: Cline navigates and analyzes your codebase
|
||||
- `Find and fix the bug in src/utils.ts`: Cline reads files, proposes edits, and can run tests
|
||||
- `Run my test suite and fix any failures`: Cline executes terminal commands and iterates on problems
|
||||
- `Open a browser and test my app at localhost:3000`: Cline launches a browser and interacts with pages
|
||||
- `Set up an MCP server for my database`: Cline can connect to external tools and APIs
|
||||
|
||||
Cline works best when you give it clear, specific instructions. The more context you provide about what you want, the better the results.
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="How does Cline work under the hood?">
|
||||
Cline runs entirely in your editor (or terminal). When you send a message, it goes to the AI model you've selected (like Claude, GPT-4, or Gemini). The model's response is parsed into actions (file edits, terminal commands, browser interactions) which Cline presents to you for approval. Your code never passes through Cline's servers. It goes directly from your machine to your chosen AI provider.
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [What is Cline?](/getting-started/what-is-cline): Understand Cline's full capabilities and how it works
|
||||
- [Build Your First Project](/getting-started/your-first-project): Hands-on tutorial building a complete todo app
|
||||
- [Select Your Model](/getting-started/authorizing-with-cline): Connect Claude, GPT-4, Gemini, DeepSeek, or local models
|
||||
- [Core Workflows](/core-workflows/task-management): Learn the patterns you'll use daily with Cline
|
||||
@@ -1,60 +0,0 @@
|
||||
---
|
||||
title: "What is Cline?"
|
||||
sidebarTitle: "What is Cline?"
|
||||
description: "An AI coding agent that lives in your editor. Read files, run commands, and build features through natural language."
|
||||
---
|
||||
|
||||
Cline is an open-source AI coding agent that runs in your editor. It 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.
|
||||
|
||||
<Tip>
|
||||
**New to coding agents?** Watch [What is a Coding Agent?](https://youtu.be/CYIteJeNcuw) to see how Cline works in action.
|
||||
</Tip>
|
||||
|
||||
## Get Started
|
||||
|
||||
<Steps>
|
||||
<Step title="Install Cline">
|
||||
Add Cline to VS Code, Cursor, or JetBrains from the extension marketplace; or download Cline CLI to work in the terminal.
|
||||
|
||||
[Install Guide →](/getting-started/installing-cline)
|
||||
</Step>
|
||||
<Step title="Pick Your Model">
|
||||
Connect your API key from Anthropic, OpenRouter, or any supported provider.
|
||||
|
||||
[Model Setup →](/getting-started/authorizing-with-cline)
|
||||
</Step>
|
||||
<Step title="Start Building">
|
||||
Open Cline from the sidebar and describe what you want to build.
|
||||
|
||||
[Your First Project →](/getting-started/your-first-project)
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## What Cline Can Do
|
||||
|
||||
Cline operates directly in your codebase with your permission:
|
||||
|
||||
- **Read and write files** - Navigate your codebase, create new files, and make targeted edits. You approve every change before it happens.
|
||||
- **Run terminal commands** - Execute shell commands, run tests, install packages, and debug errors in real-time.
|
||||
- **Use a browser** - Launch a browser to test web apps, capture screenshots, and interact with pages.
|
||||
- **Connect external tools** - Extend capabilities with [MCP servers](/mcp/mcp-overview) for databases, APIs, and documentation.
|
||||
- **Run from the command line** - Use the [Cline CLI](/cline-cli/getting-started) for headless automation, CI/CD pipelines, and shell workflows.
|
||||
|
||||
## Core Workflows
|
||||
|
||||
These are the patterns you'll use daily with Cline:
|
||||
|
||||
| Workflow | What It Does |
|
||||
|----------|--------------|
|
||||
| [Plan & Act](/core-workflows/plan-and-act) | Think first, then build. Plan mode explores your codebase without making changes. Act mode implements the solution. |
|
||||
| [Task Management](/core-workflows/task-management) | Start tasks, resume previous work, and manage long-running sessions. |
|
||||
| [Working with Files](/core-workflows/working-with-files) | Use @ mentions to reference files, folders, URLs, and terminal output in your prompts. |
|
||||
| [Commands](/core-workflows/using-commands) | Keyboard shortcuts, slash commands, and terminal integration. |
|
||||
| [Checkpoints](/core-workflows/checkpoints) | Automatic snapshots of your project. Restore to any previous state instantly. |
|
||||
|
||||
## Why Cline
|
||||
|
||||
- **Transparent by default** - Watch every file read, every decision considered, every token used. No black box.
|
||||
- **Any model, any provider** - Use Claude, GPT-4, Gemini, DeepSeek, or local models. Switch instantly as new models launch.
|
||||
- **Zero trust architecture** - Your code never touches our servers. Cline runs entirely client-side with your API keys.
|
||||
- **Open source** - Every line of code on [GitHub](https://github.com/cline/cline). 50k+ stars from developers who use it daily.
|
||||
@@ -1,49 +0,0 @@
|
||||
---
|
||||
title: "Cline Documentation"
|
||||
sidebarTitle: "Home"
|
||||
description: "Your AI-powered coding agent for complex work. Read files, write code, run commands, all with your approval."
|
||||
---
|
||||
|
||||
Welcome to the Cline documentation. Whether you're just getting started or looking to unlock advanced workflows, you'll find everything you need here.
|
||||
|
||||
## What is Cline?
|
||||
|
||||
Cline is an AI coding agent that lives in your editor and your terminal. It can read and write files, run terminal commands, use a browser, and help you build features through natural conversation. Every action requires your explicit approval. You're always in control.
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Quick Start" icon="rocket" href="/getting-started/quick-start">
|
||||
Get Cline running in under 2 minutes. Install, authenticate, and build your first piece of code.
|
||||
</Card>
|
||||
<Card title="What is Cline?" icon="circle-info" href="/getting-started/what-is-cline">
|
||||
Understand Cline's full capabilities, how it works, and what makes it different.
|
||||
</Card>
|
||||
<Card title="Your First Project" icon="hammer" href="/getting-started/your-first-project">
|
||||
A hands-on tutorial that walks you through building a complete project with Cline.
|
||||
</Card>
|
||||
<Card title="Install Cline" icon="download" href="/getting-started/installing-cline">
|
||||
Detailed installation instructions for VS Code, Cursor, Windsurf, JetBrains, Antigravity, and the CLI.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Explore the Docs
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Core Workflows" icon="arrows-spin" href="/core-workflows/task-management">
|
||||
Learn the daily patterns: task management, plan & act, working with files, commands, and checkpoints.
|
||||
</Card>
|
||||
<Card title="Customization" icon="sliders" href="/customization/overview">
|
||||
Tailor Cline to your workflow with rules, skills, workflows, hooks, and .clineignore.
|
||||
</Card>
|
||||
<Card title="Features" icon="sparkles" href="/features/memory-bank">
|
||||
Discover Memory Bank, Focus Chain, auto-approve, subagents, Jupyter support, and more.
|
||||
</Card>
|
||||
<Card title="Models & Providers" icon="microchip" href="/core-features/model-selection-guide">
|
||||
Choose and configure AI models: cloud providers, local models, and advanced setups.
|
||||
</Card>
|
||||
<Card title="MCP Servers" icon="plug" href="/mcp/mcp-overview">
|
||||
Extend Cline's capabilities with Model Context Protocol servers and tools.
|
||||
</Card>
|
||||
<Card title="Cline CLI" icon="terminal" href="/cline-cli/overview">
|
||||
Use Cline from the command line: interactive mode, headless automation, and CI/CD integration.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -1,120 +0,0 @@
|
||||
---
|
||||
title: "Features"
|
||||
description: "Detailed overview of Cline Kanban features: worktrees, auto-commit, task linking, diff viewer, git interface, and more"
|
||||
---
|
||||
|
||||
<Warning>
|
||||
Kanban is a **research preview**. Some features described here use experimental capabilities. Expect changes.
|
||||
</Warning>
|
||||
|
||||
## Ephemeral Worktrees
|
||||
|
||||
Every task card runs in its own [git worktree](https://git-scm.com/docs/git-worktree) — an isolated checkout of your repository. This is the foundation that enables parallel agent execution:
|
||||
|
||||
- Each agent works in its own directory with its own terminal
|
||||
- Changes in one worktree don't affect other worktrees or your main working directory
|
||||
- No merge conflicts between agents running simultaneously
|
||||
- Worktrees are cleaned up when you move a card to trash
|
||||
|
||||
### Symlinked Dependencies
|
||||
|
||||
When creating a worktree, Kanban symlinks gitignored files (like `node_modules`) from your main repo rather than copying or reinstalling them. This avoids the overhead of running `npm install` for every task.
|
||||
|
||||
<Warning>
|
||||
Symlinks point back to the original files in your main repo. This works well for dependencies that agents don't modify, but if an agent does modify a symlinked file, the change affects the original too.
|
||||
</Warning>
|
||||
|
||||
## Auto-Commit
|
||||
|
||||
When enabled, agents automatically commit their changes to the worktree branch as they work. This creates a trail of incremental commits rather than one large diff at the end.
|
||||
|
||||
Auto-commit can be toggled in the Kanban settings.
|
||||
|
||||
## Auto-PR
|
||||
|
||||
When enabled alongside auto-commit, agents can automatically create pull requests when they finish their work. The agent generates a PR with the changes from its worktree branch.
|
||||
|
||||
Auto-PR can be toggled in the Kanban settings.
|
||||
|
||||
## Task Linking & Dependency Chains
|
||||
|
||||
Task linking lets you create sequential workflows where completing one task triggers the next:
|
||||
|
||||
1. **⌘ + click** a card to link it to another card
|
||||
2. When the first card is completed and moved to trash, the linked card **starts automatically**
|
||||
3. Chain multiple cards together for multi-step workflows
|
||||
|
||||
When combined with auto-commit, this creates fully autonomous pipelines — one agent finishes, its work is committed, and the next agent picks up where it left off.
|
||||
|
||||
## Diff Viewer & Checkpoints
|
||||
|
||||
Clicking a card opens a detail view with a full diff of all changes in that worktree. The diff viewer includes:
|
||||
|
||||
- **Checkpoint-scoped diffs** — rather than showing only the cumulative diff, you can view changes from specific message ranges. This is useful for understanding what changed at each step.
|
||||
- **Inline commenting** — click any line in the diff to leave a comment that gets sent back to the agent. Use this to give targeted feedback like "handle this edge case" or "use a different pattern here."
|
||||
|
||||
## Sidebar Chat & Board Management
|
||||
|
||||
The sidebar chat gives you a conversational interface for managing the board. Instead of manually creating and configuring cards, you can ask the agent to:
|
||||
|
||||
- Break down a piece of work into multiple task cards
|
||||
- Link cards together into dependency chains
|
||||
- Start tasks on the board
|
||||
|
||||
The agent manipulates the board directly based on your instructions.
|
||||
|
||||
## Keyboard Shortcuts
|
||||
|
||||
Kanban includes keyboard shortcuts for common actions:
|
||||
|
||||
| Shortcut | Action |
|
||||
|----------|--------|
|
||||
| **C** | Create a new task card |
|
||||
| **⌘ + click** | Link a card to another card |
|
||||
|
||||
<Tip>
|
||||
The "C" shortcut works from the main board view. You need at least one project open to create a task.
|
||||
</Tip>
|
||||
|
||||
## Settings
|
||||
|
||||
Open the settings dialog to configure how Kanban behaves. Available settings include:
|
||||
|
||||
- **Auto-commit** — toggle whether agents automatically commit changes as they work
|
||||
- **Auto-PR** — toggle whether agents automatically create pull requests on completion (requires auto-commit)
|
||||
- **Script shortcuts** — define frequently-used commands that appear as buttons on task cards
|
||||
- **Project paths** — displayed with `~` instead of full home directory paths for readability
|
||||
|
||||
## Script Shortcuts
|
||||
|
||||
Define frequently-used commands (like `npm run dev` or `npm test`) in the Kanban settings. These appear as play buttons on task cards, giving you quick access to run, test, or debug the application within a worktree without switching to a separate terminal.
|
||||
|
||||
## Git Interface
|
||||
|
||||
Click the **branch name** in the navbar to open a full git interface. From here you can:
|
||||
|
||||
- Browse commit history
|
||||
- Switch branches
|
||||
- Fetch, pull, and push
|
||||
- Visualize the git graph
|
||||
|
||||
This lets you manage your repository without leaving Kanban or opening a separate git client.
|
||||
|
||||
## Agent Compatibility
|
||||
|
||||
Kanban works with CLI-based coding agents. It uses experimental features that bypass permissions and runtime hooks, giving agents more autonomy to work without interruption. Agents currently compatible with Kanban include:
|
||||
|
||||
- **Cline CLI**
|
||||
- **Claude Code**
|
||||
- **Codex**
|
||||
- **OpenCode**
|
||||
|
||||
and more. Check settings for all available agent runtimes
|
||||
|
||||
## Resume Tasks
|
||||
|
||||
When you move a card to trash, the worktree is cleaned up but Kanban saves a **resume ID**. If you need to continue work on a trashed task, you can use this ID to pick up where you left off without starting from scratch.
|
||||
|
||||
## Remote Config Gating
|
||||
|
||||
For teams and organizations, Kanban access can be gated via Cline remote config. This allows administrators to control who can access the Kanban board within their organization, enabling phased rollouts or restricting access to specific teams.
|
||||
@@ -1,67 +0,0 @@
|
||||
---
|
||||
title: "Getting Started"
|
||||
description: "Install Cline Kanban and launch your first board"
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- **Node.js 18 or higher** — check with `node --version`
|
||||
- **A git repository** — Kanban must be run from the root of a git repo
|
||||
|
||||
## Installation
|
||||
|
||||
Install Cline CLI globally via npm:
|
||||
|
||||
```bash
|
||||
npm i -g cline
|
||||
```
|
||||
|
||||
Then launch Kanban:
|
||||
|
||||
```bash
|
||||
cline
|
||||
```
|
||||
|
||||
<Tip>
|
||||
This launches a local web server and opens the Kanban board in your default browser.
|
||||
</Tip>
|
||||
|
||||
## First Launch
|
||||
|
||||
1. Open your terminal and `cd` to the root of any git repository
|
||||
2. Run `cline`
|
||||
3. Your browser opens to the Kanban board
|
||||
|
||||
### Onboarding
|
||||
|
||||
On your first launch, Kanban walks you through a short setup:
|
||||
|
||||
1. **Pick a project directory** — a directory picker opens so you can select (or confirm) the repository you want to work in
|
||||
2. **Choose your agent** — select which coding agent to use for tasks (Cline, Claude Code, or Codex)
|
||||
|
||||
After onboarding, you land on the board and can start creating tasks immediately. No account creation, API keys, or configuration files required.
|
||||
|
||||
## Creating Your First Task
|
||||
|
||||
Once the board is open:
|
||||
|
||||
1. **Create a card** — click the add button to create a new task card
|
||||
2. **Write a task description** — describe what you want the agent to do
|
||||
3. **Hit play** — Kanban creates an ephemeral git worktree for the task and starts an agent in its own terminal
|
||||
|
||||
The card updates in real time, showing the agent's latest message or tool call so you can monitor progress from the board.
|
||||
|
||||
<Tip>
|
||||
You can also use the **sidebar chat** to create tasks. Open the chat and ask the agent to break down work into multiple task cards — it can create, link, and start tasks directly on the board.
|
||||
</Tip>
|
||||
|
||||
## Next Steps
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="Core Workflow" icon="arrows-spin" href="/kanban/core-workflow">
|
||||
Learn the full workflow: create → link → start → review → ship.
|
||||
</Card>
|
||||
<Card title="Features" icon="list-check" href="/kanban/features">
|
||||
Explore worktrees, auto-commit, task linking, the diff viewer, and more.
|
||||
</Card>
|
||||
</Columns>
|
||||
@@ -1,64 +0,0 @@
|
||||
---
|
||||
title: "Cline Kanban"
|
||||
sidebarTitle: "Overview"
|
||||
description: "A kanban board for orchestrating coding agents in parallel using git worktrees"
|
||||
---
|
||||
|
||||
<Warning>
|
||||
Kanban is a **research preview**. Share feedback in [#kanban on Discord](https://discord.gg/cline).
|
||||
</Warning>
|
||||
|
||||
## What is Cline Kanban?
|
||||
|
||||
Cline Kanban is a terminal-launched kanban board that runs in your browser. Each task card gets its own git worktree and terminal, so you can run multiple coding agents in parallel without merge conflicts. You create tasks, assign them to agents, review diffs, leave inline comments, and ship commits or PRs — all from one interface.
|
||||
|
||||
It runs locally, requires no account or setup, and works out of the box from any git repository.
|
||||
|
||||
```bash
|
||||
npm i -g cline
|
||||
cline
|
||||
```
|
||||
|
||||
## How It Works
|
||||
|
||||
1. **Run `cline`** from the root of any git repo — a local web server opens in your browser
|
||||
2. **Create task cards** manually or ask the sidebar chat agent to break work into tasks
|
||||
3. **Hit play** on a card — Kanban creates an ephemeral worktree and starts an agent
|
||||
4. **Monitor progress** — each card shows the agent's latest message or tool call
|
||||
5. **Review diffs** — click a card to see all changes, leave inline comments to steer the agent
|
||||
6. **Ship it** — hit Commit or Open PR, then trash the card to clean up the worktree
|
||||
|
||||
## Key Capabilities
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Parallel Execution" icon="clone">
|
||||
Each task runs in its own git worktree with its own terminal. Multiple agents work simultaneously without stepping on each other.
|
||||
</Card>
|
||||
<Card title="Unified Task Board" icon="table-columns">
|
||||
Create, triage, link, and monitor all agent tasks from a single browser-based kanban board.
|
||||
</Card>
|
||||
<Card title="Works With Existing Agents" icon="plug">
|
||||
Compatible with CLI agents you already use — Cline, Claude Code, and Codex. Kanban uses experimental features that bypass permissions and runtime hooks for more agent autonomy.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Links
|
||||
|
||||
- [GitHub Repository](https://github.com/cline/kanban) — source code, issues, and feature requests
|
||||
- [npm Package](https://www.npmjs.com/package/kanban) — version history and package details
|
||||
- [Cline App](https://app.cline.bot) — account management
|
||||
- [Discord #kanban](https://discord.gg/cline) — feedback and discussion
|
||||
|
||||
## Next Steps
|
||||
|
||||
<Columns cols={2}>
|
||||
<Card title="Getting Started" icon="rocket" href="/kanban/getting-started">
|
||||
Install Kanban and launch your first board.
|
||||
</Card>
|
||||
<Card title="Core Workflow" icon="arrows-spin" href="/kanban/core-workflow">
|
||||
The full workflow from creating tasks to shipping PRs.
|
||||
</Card>
|
||||
<Card title="Features" icon="list-check" href="/kanban/features">
|
||||
Worktrees, auto-commit, task linking, diff viewer, git interface, and more.
|
||||
</Card>
|
||||
</Columns>
|
||||
@@ -1,137 +0,0 @@
|
||||
---
|
||||
title: "Adding & Configuring Servers"
|
||||
sidebarTitle: "Adding & Configuring"
|
||||
description: "Find MCP servers, add them to Cline, and configure settings."
|
||||
---
|
||||
|
||||
This guide covers finding MCP servers, adding them to Cline, and configuring their settings.
|
||||
|
||||
## Finding MCP Servers
|
||||
|
||||
Several places to find MCP servers:
|
||||
|
||||
- **[Cline MCP Marketplace](/mcp/mcp-marketplace)**: Browse and install directly from Cline
|
||||
- **[Official MCP servers](https://github.com/modelcontextprotocol/servers)**: GitHub repository
|
||||
- **[Awesome-MCP servers](https://github.com/punkpeye/awesome-mcp-servers)**: Community collection
|
||||
- **Online directories**: [mcpservers.org](https://mcpservers.org/), [mcp.so](https://mcp.so/), [glama.ai/mcp/servers](https://glama.ai/mcp/servers)
|
||||
|
||||
## Adding Servers with Cline
|
||||
|
||||
The easiest way to add an MCP server is to have Cline build it for you:
|
||||
|
||||
1. Provide Cline with the GitHub repository URL
|
||||
2. Optionally include the README contents for context
|
||||
3. Cline clones the repo, builds it, and adds the configuration
|
||||
|
||||
Example conversation:
|
||||
```text
|
||||
User: "Add the MCP server from https://github.com/modelcontextprotocol/servers/tree/main/src/brave-search"
|
||||
|
||||
Cline: "Cloning the repository. It needs to be built. Should I run 'npm run build'?"
|
||||
|
||||
User: "Yes"
|
||||
|
||||
Cline: "Build complete. This server needs an API key. Where should I find it?"
|
||||
```
|
||||
|
||||
## Managing Servers
|
||||
|
||||
Access server settings through the MCP Servers icon in Cline's top navigation bar.
|
||||
|
||||
### Enable/Disable
|
||||
|
||||
Toggle the switch next to any server to enable or disable it.
|
||||
|
||||
### Restart
|
||||
|
||||
Click "Restart Server" if a server becomes unresponsive.
|
||||
|
||||
### Delete
|
||||
|
||||
Click the trash icon or "Delete Server" button. No confirmation dialog.
|
||||
|
||||
### Network Timeout
|
||||
|
||||
Set how long to wait for responses (30 seconds to 1 hour, default 1 minute).
|
||||
|
||||
## Editing Configuration Files
|
||||
|
||||
Settings are stored in `cline_mcp_settings.json`:
|
||||
|
||||
1. Click MCP Servers icon
|
||||
2. Select "Configure" tab
|
||||
3. Click "Configure MCP Servers"
|
||||
|
||||
### STDIO Transport (Local Servers)
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"local-server": {
|
||||
"command": "node",
|
||||
"args": ["/path/to/server.js"],
|
||||
"env": {
|
||||
"API_KEY": "your_api_key"
|
||||
},
|
||||
"alwaysAllow": ["tool1", "tool2"],
|
||||
"disabled": false
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### SSE Transport (Remote Servers)
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"remote-server": {
|
||||
"url": "https://your-server-url.com/mcp",
|
||||
"headers": {
|
||||
"Authorization": "Bearer your-token"
|
||||
},
|
||||
"alwaysAllow": ["tool3"],
|
||||
"disabled": false
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Global MCP Mode
|
||||
|
||||
Control how MCP servers affect token usage:
|
||||
|
||||
1. Click MCP Servers icon
|
||||
2. Select "Configure" tab
|
||||
3. Click "Advanced MCP Settings"
|
||||
4. Find `Cline>Mcp:Mode` and select your preference
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/MCP-settings-edit%20(1).png"
|
||||
alt="MCP settings"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
## Using MCP Tools
|
||||
|
||||
After configuring a server, Cline automatically detects available tools:
|
||||
|
||||
1. Type your request in chat
|
||||
2. Cline identifies when an MCP tool can help
|
||||
3. Approve the tool use (or use [auto-approval](/features/auto-approve))
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
| Issue | Solution |
|
||||
|-------|----------|
|
||||
| Server not responding | Check if process is running, verify network connectivity |
|
||||
| Permission errors | Ensure API keys and credentials are configured |
|
||||
| Tool not available | Confirm server implements the tool and it's not disabled |
|
||||
| Slow performance | Increase network timeout for the server |
|
||||
|
||||
## Related
|
||||
|
||||
- [What is MCP?](/mcp/mcp-overview)
|
||||
- [MCP Marketplace](/mcp/mcp-marketplace)
|
||||
- [Building Your Own MCP Server](/mcp/mcp-server-development-protocol)
|
||||
@@ -1,184 +0,0 @@
|
||||
---
|
||||
title: "Connecting to a Remote Server"
|
||||
description: "The Model Context Protocol (MCP) allows Cline to communicate with external servers that provide additional tools and resources to extend its capabilities. This guide explains how to add and connect to remote MCP servers through the MCP Servers interface."
|
||||
---
|
||||
|
||||
## Adding and Managing Remote MCP Servers
|
||||
|
||||
### Accessing the MCP Servers Interface
|
||||
|
||||
To access the MCP Servers interface in Cline:
|
||||
|
||||
1. Click on the Cline icon in the VSCode sidebar
|
||||
2. Open the menu (⋮) in the top right corner of the Cline panel
|
||||
3. Select "MCP Servers" from the dropdown menu
|
||||
|
||||
### Understanding the MCP Servers Interface
|
||||
|
||||
The MCP Servers interface is divided into three main tabs:
|
||||
|
||||
- **Marketplace**: Discover and install pre-configured MCP servers (if enabled)
|
||||
- **Remote Servers**: Connect to existing MCP servers via URL endpoints
|
||||
- **Installed**: Manage your connected MCP servers
|
||||
|
||||
### Adding a Remote MCP Server
|
||||
|
||||
The "Remote Servers" tab allows you to connect to any MCP server that's accessible via a URL endpoint:
|
||||
|
||||
1. Click on the "Remote Servers" tab in the MCP Servers interface
|
||||
2. Fill in the required information:
|
||||
- **Server Name**: Provide a unique, descriptive name for the server
|
||||
- **Server URL**: Enter the complete URL endpoint of the MCP server (e.g., `https://example.com/mcp-sse`)
|
||||
- **Transport Type**: Select the connection protocol (Streamable HTTP is recommended for modern servers)
|
||||
3. Click "Add Server" to initiate the connection
|
||||
4. Cline will attempt to connect to the server and display the connection status
|
||||
|
||||
> **Note**: When connecting to a remote server, ensure you trust the source, as MCP servers can execute code in your environment.
|
||||
|
||||
#### Transport Types
|
||||
|
||||
Cline supports two transport protocols for remote MCP servers:
|
||||
|
||||
- **Streamable HTTP (Recommended)**: The modern MCP transport protocol with better performance, reliability, and full OAuth 2.1 authentication support. Use this for most remote servers.
|
||||
- **SSE (Legacy)**: Server-Sent Events transport. Use this only if the server specifically requires SSE or doesn't support Streamable HTTP.
|
||||
|
||||
#### OAuth Authentication
|
||||
|
||||
Some MCP servers (like Vercel's MCP) require OAuth authentication to access your data securely. When connecting to an OAuth-enabled server:
|
||||
|
||||
1. Add the server as usual with its URL
|
||||
2. If the server requires authentication, you'll see an error message asking to authenticate.
|
||||
3. Click the **"Authenticate"** button that appears
|
||||
4. Your browser will open to the server's authorization page
|
||||
5. Sign in and grant permission
|
||||
6. You'll be redirected back to Cline automatically
|
||||
7. The server will connect and show a green status dot
|
||||
|
||||
Once authenticated, your credentials are securely stored and the server will reconnect automatically when you reload Cline. You won't need to authenticate again unless you delete the server or your credentials expire.
|
||||
|
||||
### Remote Server Discovery
|
||||
|
||||
If you're looking for MCP servers to connect to, several third-party marketplaces provide directories of available servers with various capabilities.
|
||||
|
||||
> **Warning**: The following third-party marketplaces are listed for informational purposes only. Cline does not endorse, verify, or take responsibility for any servers listed on these marketplaces. These servers are cloud-hosted services that process your requests and may have access to data you share with them. Always review privacy policies and terms of use before connecting to third-party services.
|
||||
|
||||
#### Composio MCP Integration
|
||||
|
||||
[Composio's MCP Marketplace](https://mcp.composio.dev/) provides access to a wide range of third-party servers that support the Model Context Protocol (MCP). These servers expose APIs for services like GitHub, Notion, Slack, and others. Each server includes configuration instructions and built-in authentication support (e.g. OAuth or API keys). To connect, locate the desired service in the marketplace and follow the integration steps provided there.
|
||||
|
||||
#### Connecting via Smithery
|
||||
|
||||
Smithery is a third-party MCP server marketplace that allows users to discover and connect to a variety of Model Context Protocol (MCP) servers. If you're using an MCP-compatible client (such as Cursor, Claude Desktop, or Cline), you can browse available servers and integrate them directly into your workflow.
|
||||
|
||||
To explore available options, visit the Smithery marketplace: [https://smithery.ai](https://smithery.ai)
|
||||
|
||||
Please note: Smithery is maintained independently and is not affiliated with our project. Use at your own discretion.
|
||||
|
||||
### Managing Installed MCP Servers
|
||||
|
||||
Once added, your MCP servers appear in the "Configure" tab where you can:
|
||||
|
||||
#### View Server Status
|
||||
|
||||
Each server displays its current status:
|
||||
|
||||
- **Green dot**: Connected and ready to use
|
||||
- **Yellow dot**: In the process of connecting
|
||||
- **Red dot**: Disconnected or experiencing errors
|
||||
|
||||
#### Configure Server Settings
|
||||
|
||||
Click on a server to expand its settings panel:
|
||||
|
||||
1. **Tools & Resources**:
|
||||
- View all available tools and resources from the server
|
||||
- Configure auto-approval settings for tools (if enabled)
|
||||
2. **Request Timeout**:
|
||||
- Set how long Cline should wait for server responses
|
||||
- Options range from 30 seconds to 1 hour
|
||||
3. **Server Management**:
|
||||
- **Restart Server**: Reconnect if the server becomes unresponsive
|
||||
- **Delete Server**: Remove the server from your configuration
|
||||
|
||||
#### Enable/Disable Servers
|
||||
|
||||
Toggle the switch next to each server to enable or disable it:
|
||||
|
||||
- **Enabled**: Cline can use the server's tools and resources
|
||||
- **Disabled**: The server remains in your configuration but is not active
|
||||
|
||||
### Troubleshooting Connection Issues
|
||||
|
||||
If a server fails to connect:
|
||||
|
||||
1. An error message will be displayed with details about the failure
|
||||
2. **For OAuth errors**: Click the "Authenticate" button to complete the authorization flow
|
||||
3. Check that the server URL is correct and the server is running
|
||||
4. Try selecting a different transport type (Streamable HTTP vs SSE)
|
||||
5. Use the "Restart Server" button to attempt reconnection
|
||||
6. If problems persist, you can delete the server and try adding it again
|
||||
|
||||
#### OAuth-Specific Issues
|
||||
|
||||
If you're having trouble authenticating with an OAuth-enabled server:
|
||||
|
||||
- **"Authentication required" persists**: Make sure you completed the authorization flow in your browser and didn't cancel it
|
||||
- **Browser doesn't open**: Check your system's default browser settings and ensure external URLs can be opened
|
||||
- **Redirect errors**: Verify you're using the latest version of Cline - older versions may not support OAuth
|
||||
- **Reset authentication**: Delete the server and re-add it to start fresh with a new OAuth flow
|
||||
|
||||
### Advanced Configuration
|
||||
|
||||
For advanced users, Cline stores MCP server configurations in a JSON file that can be modified:
|
||||
|
||||
1. In the "Configure" tab, click "Configure MCP Servers" to access the settings file
|
||||
2. The configuration for each server follows this format:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"exampleServer": {
|
||||
"url": "https://example.com/mcp-server",
|
||||
"type": "streamableHttp",
|
||||
"disabled": false,
|
||||
"autoApprove": ["tool1", "tool2"],
|
||||
"timeout": 60
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Key configuration options:
|
||||
|
||||
- **url**: The endpoint URL (for remote servers)
|
||||
- **type**: Transport protocol - `"streamableHttp"` (recommended) or `"sse"` (legacy)
|
||||
- **disabled**: Whether the server is currently enabled (true/false)
|
||||
- **autoApprove**: List of tool names that don't require confirmation
|
||||
- **timeout**: Maximum time in seconds to wait for server responses (default: 60)
|
||||
|
||||
For additional MCP settings, click the "Advanced MCP Settings" link to access VSCode settings.
|
||||
|
||||
### Using MCP Server Tools
|
||||
|
||||
Once connected, Cline can use the tools and resources provided by the MCP server. When Cline suggests using an MCP tool:
|
||||
|
||||
1. A tool approval prompt will appear (unless auto-approved)
|
||||
2. Review the tool details and parameters before approving
|
||||
3. The tool will execute and return results to Cline
|
||||
|
||||
### Example: Connecting to Vercel MCP
|
||||
|
||||
[Vercel MCP](https://vercel.com/docs/mcp/vercel-mcp) is an OAuth-enabled server that provides tools for managing your Vercel projects and deployments:
|
||||
|
||||
1. Click "Remote Servers" tab
|
||||
2. Enter:
|
||||
- **Server Name**: `vercel`
|
||||
- **Server URL**: `https://mcp.vercel.com`
|
||||
- **Transport Type**: Streamable HTTP (pre-selected)
|
||||
3. Click "Add Server"
|
||||
4. You'll see "Authentication required" - click the **"Authenticate"** button
|
||||
5. Sign in to Vercel in your browser and authorize Cline
|
||||
6. Return to Cline - the server will automatically connect
|
||||
7. Vercel's tools (deploy, logs, projects) are now available to Cline!
|
||||
|
||||
Your Vercel authentication persists across sessions, so you won't need to re-authenticate each time you use Cline.
|
||||
@@ -1,199 +0,0 @@
|
||||
---
|
||||
title: "MCP Made Easy"
|
||||
description: "Learn how to use the MCP Marketplace to discover, install, and configure MCP servers that enhance Cline's capabilities with additional tools and resources."
|
||||
---
|
||||
|
||||
## What's an MCP Server?
|
||||
|
||||
MCP servers are specialized extensions that enhance Cline's capabilities. They enable Cline to perform additional tasks like fetching web pages, processing images, accessing APIs, and much more.
|
||||
|
||||
## MCP Marketplace Walkthrough
|
||||
|
||||
The MCP Marketplace provides a one-click installation experience for hundreds of MCP servers across various categories.
|
||||
|
||||
### 1. Access the Marketplace
|
||||
|
||||
- In Cline, click the "Extensions" button (square icon) in the top toolbar
|
||||
- The MCP marketplace will open, showing available servers by category
|
||||
|
||||
### 2. Browse and Select a Server
|
||||
|
||||
- Browse servers by category (Search, File-systems, Browser-automation, Research-data, etc.)
|
||||
- Click on a server to see details about its capabilities and requirements
|
||||
|
||||
### 3. Install and Configure
|
||||
|
||||
- Click the install button for your chosen server
|
||||
- If the server requires an API key (most do), Cline will guide you through:
|
||||
- Where to get the API key
|
||||
- How to enter it securely
|
||||
- The server will be added to your MCP settings automatically
|
||||
|
||||
### 4. Verify Installation
|
||||
|
||||
- Cline will show confirmation when installation is complete
|
||||
- Check the server status in Cline's MCP settings UI
|
||||
|
||||
### 5. Using Your New Server
|
||||
|
||||
- After successful installation, Cline will automatically integrate the server's capabilities
|
||||
- You'll see new tools and resources available in Cline's system prompt
|
||||
- Simply ask Cline to use the capabilities of your new server
|
||||
- Example: "Search the web for recent React updates using Perplexity"
|
||||
|
||||
**Corporate Users:** If you're using Cline in a corporate environment, ensure you have permission to install third-party MCP servers according to your organization's security policies.
|
||||
|
||||
## What Happens Behind the Scenes
|
||||
|
||||
When you install an MCP server, several things happen automatically:
|
||||
|
||||
### 1. Installation Process
|
||||
|
||||
- The server code is cloned/installed to `/Users/<username>/Documents/Cline/MCP/`
|
||||
- Dependencies are installed
|
||||
- The server is built (TypeScript/JavaScript compilation or Python package installation)
|
||||
|
||||
### 2. Configuration
|
||||
|
||||
- The MCP settings file is updated with your server configuration
|
||||
- This file is located at: `/Users/<username>/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`
|
||||
- Environment variables (like API keys) are securely stored
|
||||
- The server path is registered
|
||||
|
||||
### 3. Server Launch
|
||||
|
||||
- Cline detects the configuration change
|
||||
- Cline launches your server as a separate process
|
||||
- Communication is established via stdio or HTTP
|
||||
|
||||
### 4. Integration with Cline
|
||||
|
||||
- Your server's capabilities are added to Cline's system prompt
|
||||
- Tools become available via `use_mcp_tool` commands
|
||||
- Resources become available via `access_mcp_resource` commands
|
||||
- Cline can now use these capabilities when prompted by the user
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### System Requirements
|
||||
|
||||
Make sure your system meets these requirements:
|
||||
|
||||
- **Node.js 18.x or newer**
|
||||
- Check by running: `node --version`
|
||||
- Install from: https://nodejs.org/
|
||||
- Required for JavaScript/TypeScript implementations
|
||||
- **Python 3.10 or newer**
|
||||
- Check by running: `python --version`
|
||||
- Install from: https://python.org/
|
||||
- Note: Some specialized implementations may require Python 3.11+
|
||||
- **UV Package Manager**
|
||||
- Modern Python package manager for dependency isolation
|
||||
- Install using:
|
||||
```bash
|
||||
curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||
```
|
||||
Or: `pip install uv`
|
||||
- Verify with: `uv --version`
|
||||
|
||||
If any of these commands fail or show older versions, please install/update before continuing!
|
||||
|
||||
### Common Installation Issues
|
||||
|
||||
- Ensure your internet connection is stable
|
||||
- Check that you have the necessary permissions to install new software
|
||||
- Verify that the API key was entered correctly (if required)
|
||||
- Check the server status in the MCP settings UI for any error messages
|
||||
|
||||
### How to Remove an MCP Server
|
||||
|
||||
To completely remove a faulty MCP server:
|
||||
|
||||
1. Open the MCP settings file: `/Users/<username>/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`
|
||||
2. Delete the entire entry for your server from the `mcpServers` object
|
||||
3. Save the file
|
||||
4. Restart Cline
|
||||
|
||||
### I'm Still Getting an Error
|
||||
|
||||
If you're getting an error when using an MCP server, you can try the following:
|
||||
|
||||
- Check the MCP settings file for errors
|
||||
- Use a Claude Sonnet model for installation
|
||||
- Verify that paths to your server's files are correct
|
||||
- Ensure all required environment variables are set
|
||||
- Check if another process is using the same port (for HTTP-based servers)
|
||||
- Try removing and reinstalling the server (remove from both the `cline_mcp_settings.json` file and the `/Users/<username>/Documents/Cline/MCP/` directory)
|
||||
- Use a terminal and run the command with its arguments directly. This will allow you to see the same errors that Cline is seeing
|
||||
|
||||
## MCP Server Rules
|
||||
|
||||
Cline is already aware of your active MCP servers and what they are for, but when you have a lot of MCP servers enabled, it can be useful to define when to use each server.
|
||||
|
||||
Utilize a `.clinerules` file or custom instructions to support intelligent MCP server activation through keyword-based triggers, making Cline's tool selection more intuitive and context-aware.
|
||||
|
||||
### How MCP Rules Work
|
||||
|
||||
MCP Rules group your connected MCP servers into functional categories and define trigger keywords that activate them automatically when detected in your conversations with Cline.
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpRules": {
|
||||
"webInteraction": {
|
||||
"servers": ["firecrawl-mcp-server", "fetch-mcp"],
|
||||
"triggers": ["web", "scrape", "browse", "website"],
|
||||
"description": "Tools for web browsing and scraping"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Configuration Structure
|
||||
|
||||
1. **Categories**: Group related servers (e.g., "webInteraction", "mediaAndDesign")
|
||||
2. **Servers**: List server names in each category
|
||||
3. **Triggers**: Keywords that activate these servers
|
||||
4. **Description**: Human-readable category explanation
|
||||
|
||||
### Benefits of MCP Rules
|
||||
|
||||
- **Contextual Tool Selection**: Cline selects appropriate tools based on conversation context
|
||||
- **Reduced Friction**: No need to manually specify which tool to use
|
||||
- **Organized Capabilities**: Logically group related tools and servers
|
||||
- **Prioritization**: Handle ambiguous cases with explicit priority ordering
|
||||
|
||||
### Example Usage
|
||||
|
||||
When you write "Can you scrape this website?", Cline detects "scrape" and "website" as triggers, automatically selecting web-related MCP servers.
|
||||
|
||||
For finance tasks like "What's Apple's stock price?", keywords like "stock" and "price" trigger finance-related servers.
|
||||
|
||||
### Quick Start Template
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpRules": {
|
||||
"category1": {
|
||||
"servers": ["server-name-1", "server-name-2"],
|
||||
"triggers": ["keyword1", "keyword2", "phrase1", "phrase2"],
|
||||
"description": "Description of what these tools do"
|
||||
},
|
||||
"category2": {
|
||||
"servers": ["server-name-3"],
|
||||
"triggers": ["keyword3", "keyword4", "phrase3"],
|
||||
"description": "Description of what these tools do"
|
||||
},
|
||||
"category3": {
|
||||
"servers": ["server-name-4", "server-name-5"],
|
||||
"triggers": ["keyword5", "keyword6", "phrase4"],
|
||||
"description": "Description of what these tools do"
|
||||
}
|
||||
},
|
||||
"defaultBehavior": {
|
||||
"priorityOrder": ["category1", "category2", "category3"],
|
||||
"fallbackBehavior": "Ask user which tool would be most appropriate"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Add this to your `.clinerules` file or to your custom instructions to make Cline's MCP server selection more intuitive and context-aware.
|
||||
+117
-76
@@ -1,109 +1,150 @@
|
||||
---
|
||||
title: "MCP Overview"
|
||||
description: "Learn about Model Context Protocol (MCP) servers, their capabilities, and how Cline can help build and use them. MCP standardizes how applications provide context to LLMs, acting like a USB-C port for AI applications."
|
||||
title: "MCP"
|
||||
sidebarTitle: "MCP"
|
||||
description: "Add, configure, and use MCP servers in Cline."
|
||||
---
|
||||
|
||||
## Quick Links
|
||||
MCP (Model Context Protocol) lets Cline use external tools and data sources through MCP servers.
|
||||
|
||||
- [Adding and Configuring MCP Servers](/mcp/adding-and-configuring-servers)
|
||||
- [Building Custom MCP Servers from Scratch](/mcp/mcp-server-development-protocol)
|
||||
## What MCP gives you
|
||||
|
||||
## Overview
|
||||
- Connect Cline to external APIs and services
|
||||
- Add custom tools beyond built-in Cline tools
|
||||
- Use either local servers or remote hosted servers
|
||||
|
||||
Model Context Protocol is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications; it provides a standardized way to connect AI models to different data sources and tools. 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.
|
||||
## Quick start
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/mcp-diagram.png"
|
||||
alt="MCP diagram showing how MCP servers connect LLMs to external tools and data sources"
|
||||
/>
|
||||
</Frame>
|
||||
1. Open **MCP Servers** in Cline
|
||||
2. Add a server (from Marketplace or manually)
|
||||
3. Configure credentials/environment variables
|
||||
4. Verify tools appear and test one tool call
|
||||
|
||||
## Key Concepts
|
||||
## Add servers
|
||||
|
||||
MCP servers define a set of "**tools,**" which are functions the LLM can execute. These tools offer a wide range of capabilities.
|
||||
### Option 1: Marketplace
|
||||
|
||||
**Here's how MCP works:**
|
||||
Use Cline's MCP Marketplace for one-click install when available.
|
||||
1. In the Cline panel, click the MCP Servers icon (stacked server icon in the top toolbar).
|
||||
2. Open the Marketplace tab.
|
||||
|
||||
- **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.
|
||||
### Option 2: Manual config
|
||||
|
||||
## Use Cases
|
||||
Edit your MCP config file and add either:
|
||||
|
||||
The potential of MCP servers is vast. They can be used for a variety of purposes.
|
||||
- **CLI:** `~/.cline/mcp.json`
|
||||
- **IDE extensions:**
|
||||
1. In the Cline panel, click the **MCP Servers** icon (stacked server icon in the top toolbar).
|
||||
2. Open the **Configure** tab.
|
||||
3. Click **Configure MCP Servers** (button near the bottom).
|
||||
4. This opens the MCP settings JSON used by the extension; add/update entries under `mcpServers`.
|
||||
- If you're adding a hosted endpoint (instead of editing JSON directly), use the **Remote Servers** tab:
|
||||
1. Enter **Server Name** (any unique label).
|
||||
2. Enter **Server URL** (full endpoint URL).
|
||||
3. Choose **Transport Type**:
|
||||
- **Streamable HTTP** (recommended)
|
||||
- **SSE (Legacy)**
|
||||
4. Click **Add Server**.
|
||||
|
||||
**Here are some concrete examples of how MCP servers can be used:**
|
||||
- Server config shape:
|
||||
- **Local (STDIO)** server using `command` + `args`
|
||||
- **Remote (HTTP/SSE)** server using `url`
|
||||
|
||||
- **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
|
||||
### CLI MCP wizard
|
||||
|
||||
## Getting Started
|
||||
From CLI, run:
|
||||
|
||||
Cline does not come with any pre-installed MCP servers. You'll need to find and install them separately.
|
||||
```bash
|
||||
cline mcp
|
||||
```
|
||||
|
||||
**Choose the right approach for your needs:**
|
||||
The wizard supports:
|
||||
|
||||
- **Community Repositories:** Check for community-maintained lists of MCP servers on GitHub. See [Adding and Configuring Servers](/mcp/adding-and-configuring-servers)
|
||||
- **Cline Marketplace:** Install one from Cline's [MCP Marketplace](/mcp/mcp-marketplace)
|
||||
- **Ask Cline:** You can ask Cline to help you find or create MCP servers
|
||||
- **Build Your Own:** Create custom MCP servers using the [MCP SDK](https://github.com/modelcontextprotocol/)
|
||||
- **Customize Existing Servers:** Modify existing servers to fit your specific requirements
|
||||
| Action | Description |
|
||||
|---|---|
|
||||
| List servers | Show configured servers and enabled/disabled status |
|
||||
| Add server | Create a new MCP server entry |
|
||||
| Edit server | Modify an existing server |
|
||||
| Enable/Disable | Toggle a server without deleting it |
|
||||
| Delete server | Remove a server permanently |
|
||||
|
||||
## Integration with Cline
|
||||
When adding a server, the CLI prompts for server name, transport type, command/args (for stdio), or URL/headers (for remote transports).
|
||||
|
||||
MCP servers work with both the **Cline VS Code extension** and the **[Cline CLI](/cline-cli/overview)**. If you use the CLI, see [MCP Server Configuration for the CLI](/cline-cli/configuration#mcp-server-configuration) to get set up.
|
||||
## Configuration examples
|
||||
|
||||
Cline simplifies the building and use of MCP servers through its AI capabilities.
|
||||
### Local server (STDIO)
|
||||
|
||||
### Building MCP Servers
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"local-server": {
|
||||
"command": "node",
|
||||
"args": ["/path/to/server.js"],
|
||||
"env": {
|
||||
"API_KEY": "your_api_key"
|
||||
},
|
||||
"disabled": false,
|
||||
"autoApprove": []
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- **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.
|
||||
### Remote server (HTTP/SSE)
|
||||
|
||||
### Using MCP Servers
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"remote-server": {
|
||||
"url": "https://example.com/mcp",
|
||||
"headers": {
|
||||
"Authorization": "Bearer your-token"
|
||||
},
|
||||
"disabled": false,
|
||||
"autoApprove": []
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
- **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.
|
||||
## Transport types
|
||||
|
||||
## Security Considerations
|
||||
- **STDIO**: local process, lower latency, simpler local setup
|
||||
- **Remote HTTP/SSE**: hosted endpoint, centralized deployment, supports multi-client usage
|
||||
|
||||
When working with MCP servers, it's important to follow security best practices:
|
||||
Use STDIO for local tools and remote transport for shared hosted services.
|
||||
|
||||
- **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
|
||||
## Managing servers
|
||||
|
||||
## Resources
|
||||
In MCP settings you can:
|
||||
|
||||
There are various resources available for finding and learning about MCP servers.
|
||||
- Enable/disable servers
|
||||
- Restart unresponsive servers
|
||||
- Set request timeouts
|
||||
- Remove servers
|
||||
|
||||
**Here are some links to resources for finding and learning about MCP servers:**
|
||||
## Security basics
|
||||
|
||||
- **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)
|
||||
- Only install servers you trust
|
||||
- Store secrets in environment variables
|
||||
- Limit `autoApprove` to safe tools
|
||||
- Review tool calls before approval
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
| Issue | Fix |
|
||||
|---|---|
|
||||
| Server won't connect | Verify command/URL, server process status, and port |
|
||||
| Missing tools | Confirm server started successfully and tools are exposed |
|
||||
| Auth errors | Re-check API keys/tokens and required headers |
|
||||
| Timeout errors | Increase MCP timeout and test server response directly |
|
||||
|
||||
## CLI
|
||||
|
||||
MCP also works in Cline CLI. Configure servers in CLI MCP settings and use the same server definitions.
|
||||
|
||||
You can also list servers non-interactively:
|
||||
|
||||
```bash
|
||||
cline config mcp
|
||||
cline config mcp --json
|
||||
```
|
||||
|
||||
@@ -1,705 +0,0 @@
|
||||
---
|
||||
title: "MCP Server Development Protocol"
|
||||
description: "This protocol is designed to streamline the development process of building MCP servers with Cline."
|
||||
---
|
||||
|
||||
> **Build and share your MCP servers with the world.** Once you've created a great MCP server, submit it to the [Cline MCP Marketplace](https://github.com/cline/mcp-marketplace) to make it discoverable and one-click installable by thousands of developers.
|
||||
|
||||
## What Are MCP Servers?
|
||||
|
||||
Model Context Protocol (MCP) servers extend AI assistants like Cline by giving them the ability to:
|
||||
|
||||
- Access external APIs and services
|
||||
- Retrieve real-time data
|
||||
- Control applications and local systems
|
||||
- Perform actions beyond what text prompts alone can achieve
|
||||
|
||||
Without MCP, AI assistants are powerful but isolated. With MCP, they gain the ability to interact with virtually any digital system.
|
||||
|
||||
## The Development Protocol
|
||||
|
||||
The heart of effective MCP server development is following a structured protocol. This protocol is implemented through a `.clinerules` file that lives at the **root** of your MCP working directory (/Users/your-name/Documents/Cline/MCP).
|
||||
|
||||
### Using `.clinerules` Files
|
||||
|
||||
A `.clinerules` file is a special configuration that Cline reads automatically when working in the directory where it's placed. These files:
|
||||
|
||||
- Configure Cline's behavior and enforce best practices
|
||||
- Switch Cline into a specialized MCP development mode
|
||||
- Provide a step-by-step protocol for building servers
|
||||
- Implement safety measures like preventing premature completion
|
||||
- Guide you through planning, implementation, and testing phases
|
||||
|
||||
Here's the complete MCP Server Development Protocol that should be placed in your `.clinerules` file:
|
||||
|
||||
````markdown
|
||||
# MCP Server Development Protocol
|
||||
|
||||
CRITICAL: DO NOT USE attempt_completion BEFORE TESTING
|
||||
|
||||
## Step 1: Planning (PLAN MODE)
|
||||
|
||||
- What problem does this tool solve?
|
||||
- What API/service will it use?
|
||||
- What are the authentication requirements?
|
||||
□ Standard API key
|
||||
□ OAuth (requires separate setup script)
|
||||
□ Other credentials
|
||||
|
||||
## Step 2: Implementation (ACT MODE)
|
||||
|
||||
1. Bootstrap
|
||||
|
||||
- For web services, JavaScript integration, or Node.js environments:
|
||||
```bash
|
||||
npx @modelcontextprotocol/create-server my-server
|
||||
cd my-server
|
||||
npm install
|
||||
```
|
||||
- For data science, ML workflows, or Python environments:
|
||||
```bash
|
||||
pip install mcp
|
||||
# Or with uv (recommended)
|
||||
uv add "mcp[cli]"
|
||||
```
|
||||
|
||||
2. Core Implementation
|
||||
|
||||
- Use MCP SDK
|
||||
- Implement comprehensive logging
|
||||
- TypeScript (for web/JS projects):
|
||||
```typescript
|
||||
console.error("[Setup] Initializing server...")
|
||||
console.error("[API] Request to endpoint:", endpoint)
|
||||
console.error("[Error] Failed with:", error)
|
||||
```
|
||||
- Python (for data science/ML projects):
|
||||
```python
|
||||
import logging
|
||||
logging.error('[Setup] Initializing server...')
|
||||
logging.error(f'[API] Request to endpoint: {endpoint}')
|
||||
logging.error(f'[Error] Failed with: {str(error)}')
|
||||
```
|
||||
- Add type definitions
|
||||
- Handle errors with context
|
||||
- Implement rate limiting if needed
|
||||
|
||||
3. Configuration
|
||||
|
||||
- Get credentials from user if needed
|
||||
- Add to MCP settings:
|
||||
|
||||
- For TypeScript projects:
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-server": {
|
||||
"command": "node",
|
||||
"args": ["path/to/build/index.js"],
|
||||
"env": {
|
||||
"API_KEY": "key"
|
||||
},
|
||||
"disabled": false,
|
||||
"autoApprove": []
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
- For Python projects:
|
||||
|
||||
```bash
|
||||
# Directly with command line
|
||||
mcp install server.py -v API_KEY=key
|
||||
|
||||
# Or in settings.json
|
||||
{
|
||||
"mcpServers": {
|
||||
"my-server": {
|
||||
"command": "python",
|
||||
"args": ["server.py"],
|
||||
"env": {
|
||||
"API_KEY": "key"
|
||||
},
|
||||
"disabled": false,
|
||||
"autoApprove": []
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Step 3: Testing (BLOCKER ⛔️)
|
||||
|
||||
<thinking>
|
||||
BEFORE using attempt_completion, I MUST verify:
|
||||
□ Have I tested EVERY tool?
|
||||
□ Have I confirmed success from the user for each test?
|
||||
□ Have I documented the test results?
|
||||
|
||||
If ANY answer is "no", I MUST NOT use attempt_completion.
|
||||
</thinking>
|
||||
|
||||
1. Test Each Tool (REQUIRED)
|
||||
□ Test each tool with valid inputs
|
||||
□ Verify output format is correct
|
||||
DO NOT PROCEED UNTIL ALL TOOLS TESTED
|
||||
|
||||
## Step 4: Completion
|
||||
|
||||
❗ STOP AND VERIFY:
|
||||
□ Every tool has been tested with valid inputs
|
||||
□ Output format is correct for each tool
|
||||
|
||||
Only after ALL tools have been tested can attempt_completion be used.
|
||||
|
||||
## Key Requirements
|
||||
|
||||
- ✓ Must use MCP SDK
|
||||
- ✓ Must have comprehensive logging
|
||||
- ✓ Must test each tool individually
|
||||
- ✓ Must handle errors gracefully
|
||||
- NEVER skip testing before completion
|
||||
````
|
||||
|
||||
When this `.clinerules` file is present in your working directory, Cline will:
|
||||
|
||||
1. Start in **PLAN MODE** to design your server before implementation
|
||||
2. Enforce proper implementation patterns in **ACT MODE**
|
||||
3. Require testing of all tools before allowing completion
|
||||
4. Guide you through the entire development lifecycle
|
||||
|
||||
## Getting Started
|
||||
|
||||
Creating an MCP server requires just a few simple steps to get started:
|
||||
|
||||
### 1. Create a `.clinerules` file (IMPORTANT)
|
||||
|
||||
First, add a `.clinerules` file to the root of your MCP working directory using the protocol above. This file configures Cline to use the MCP development protocol when working in this folder.
|
||||
|
||||
### 2. Start a Chat with a Clear Description
|
||||
|
||||
Begin your Cline chat by clearly describing what you want to build. Be specific about:
|
||||
|
||||
- The purpose of your MCP server
|
||||
- Which API or service you want to integrate with
|
||||
- Any specific tools or features you need
|
||||
|
||||
For example:
|
||||
|
||||
```plaintext
|
||||
I want to build an MCP server for the AlphaAdvantage financial API.
|
||||
It should allow me to get real-time stock data, perform technical
|
||||
analysis, and retrieve company financial information.
|
||||
```
|
||||
|
||||
### 3. Work Through the Protocol
|
||||
|
||||
Cline will automatically start in PLAN MODE, guiding you through the planning process:
|
||||
|
||||
- Discussing the problem scope
|
||||
- Reviewing API documentation
|
||||
- Planning authentication methods
|
||||
- Designing tool interfaces
|
||||
|
||||
When ready, switch to ACT MODE using the toggle at the bottom of the chat to begin implementation.
|
||||
|
||||
### 4. Provide API Documentation Early
|
||||
|
||||
One of the most effective ways to help Cline build your MCP server is to share official API documentation right at the start:
|
||||
|
||||
```plaintext
|
||||
Here's the API documentation for the service:
|
||||
[Paste API documentation here]
|
||||
```
|
||||
|
||||
Providing comprehensive API details (endpoints, authentication, data structures) significantly improves Cline's ability to implement an effective MCP server.
|
||||
|
||||
## Understanding the Two Modes
|
||||
|
||||
### PLAN MODE
|
||||
|
||||
In this collaborative phase, you work with Cline to design your MCP server:
|
||||
|
||||
- Define the problem scope
|
||||
- Choose appropriate APIs
|
||||
- Plan authentication methods
|
||||
- Design the tool interfaces
|
||||
- Determine data formats
|
||||
|
||||
### ACT MODE
|
||||
|
||||
Once planning is complete, Cline helps implement the server:
|
||||
|
||||
- Set up the project structure
|
||||
- Write the implementation code
|
||||
- Configure settings
|
||||
- Test each component thoroughly
|
||||
- Finalize documentation
|
||||
|
||||
## Case Study: AlphaAdvantage Stock Analysis Server
|
||||
|
||||
Let's walk through the development process of our AlphaAdvantage MCP server, which provides stock data analysis and reporting capabilities.
|
||||
|
||||
### Planning Phase
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/planning-phase.gif"
|
||||
alt="Planning phase demonstration"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
During the planning phase, we:
|
||||
|
||||
1. **Defined the problem**: Users need access to financial data, stock analysis, and market insights directly through their AI assistant
|
||||
2. **Selected the API**: AlphaAdvantage API for financial market data
|
||||
- Standard API key authentication
|
||||
- Rate limits of 5 requests per minute (free tier)
|
||||
- Various endpoints for different financial data types
|
||||
3. **Designed the tools needed**:
|
||||
- Stock overview information (current price, company details)
|
||||
- Technical analysis with indicators (RSI, MACD, etc.)
|
||||
- Fundamental analysis (financial statements, ratios)
|
||||
- Earnings report data
|
||||
- News and sentiment analysis
|
||||
4. **Planned data formatting**:
|
||||
- Clean, well-formatted markdown output
|
||||
- Tables for structured data
|
||||
- Visual indicators (↑/↓) for trends
|
||||
- Proper formatting of financial numbers
|
||||
|
||||
### Implementation
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/building-mcp-plugin.gif"
|
||||
alt="Building MCP plugin demonstration"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
We began by bootstrapping the project:
|
||||
|
||||
```bash
|
||||
npx @modelcontextprotocol/create-server alphaadvantage-mcp
|
||||
cd alphaadvantage-mcp
|
||||
npm install axios node-cache
|
||||
```
|
||||
|
||||
Next, we structured our project with:
|
||||
|
||||
```plaintext
|
||||
src/
|
||||
├── api/
|
||||
│ └── alphaAdvantageClient.ts # API client with rate limiting & caching
|
||||
├── formatters/
|
||||
│ └── markdownFormatter.ts # Output formatters for clean markdown
|
||||
└── index.ts # Main MCP server implementation
|
||||
```
|
||||
|
||||
#### API Client Implementation
|
||||
|
||||
The API client implementation included:
|
||||
|
||||
- **Rate limiting**: Enforcing the 5 requests per minute limit
|
||||
- **Caching**: Reducing API calls with strategic caching
|
||||
- **Error handling**: Robust error detection and reporting
|
||||
- **Typed interfaces**: Clear TypeScript types for all data
|
||||
|
||||
Key implementation details:
|
||||
|
||||
```typescript
|
||||
/**
|
||||
* Manage rate limiting based on free tier (5 calls per minute)
|
||||
*/
|
||||
private async enforceRateLimit() {
|
||||
if (this.requestsThisMinute >= 5) {
|
||||
console.error("[Rate Limit] Rate limit reached. Waiting for next minute...");
|
||||
return new Promise<void>((resolve) => {
|
||||
const remainingMs = 60 * 1000 - (Date.now() % (60 * 1000));
|
||||
setTimeout(resolve, remainingMs + 100); // Add 100ms buffer
|
||||
});
|
||||
}
|
||||
|
||||
this.requestsThisMinute++;
|
||||
return Promise.resolve();
|
||||
}
|
||||
```
|
||||
|
||||
#### Markdown Formatting
|
||||
|
||||
We implemented formatters to display financial data beautifully:
|
||||
|
||||
```typescript
|
||||
/**
|
||||
* Format company overview into markdown
|
||||
*/
|
||||
export function formatStockOverview(overviewData: any, quoteData: any): string {
|
||||
// Extract data
|
||||
const overview = overviewData
|
||||
const quote = quoteData["Global Quote"]
|
||||
|
||||
// Calculate price change
|
||||
const currentPrice = parseFloat(quote["05. price"] || "0")
|
||||
const priceChange = parseFloat(quote["09. change"] || "0")
|
||||
const changePercent = parseFloat(quote["10. change percent"]?.replace("%", "") || "0")
|
||||
|
||||
// Format markdown
|
||||
let markdown = `# ${overview.Symbol} (${overview.Name}) - ${formatCurrency(currentPrice)} ${addTrendIndicator(priceChange)}${changePercent > 0 ? "+" : ""}${changePercent.toFixed(2)}%\n\n`
|
||||
|
||||
// Add more details...
|
||||
|
||||
return markdown
|
||||
}
|
||||
```
|
||||
|
||||
#### Tool Implementation
|
||||
|
||||
We defined five tools with clear interfaces:
|
||||
|
||||
```typescript
|
||||
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
||||
console.error("[Setup] Listing available tools")
|
||||
|
||||
return {
|
||||
tools: [
|
||||
{
|
||||
name: "get_stock_overview",
|
||||
description: "Get basic company info and current quote for a stock symbol",
|
||||
inputSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
symbol: {
|
||||
type: "string",
|
||||
description: "Stock symbol (e.g., 'AAPL')",
|
||||
},
|
||||
market: {
|
||||
type: "string",
|
||||
description: "Optional market (e.g., 'US')",
|
||||
default: "US",
|
||||
},
|
||||
},
|
||||
required: ["symbol"],
|
||||
},
|
||||
},
|
||||
// Additional tools defined here...
|
||||
],
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
Each tool's handler included:
|
||||
|
||||
- Input validation
|
||||
- API client calls with error handling
|
||||
- Markdown formatting of responses
|
||||
- Comprehensive logging
|
||||
|
||||
### Testing Phase
|
||||
|
||||
This critical phase involved systematically testing each tool:
|
||||
|
||||
1. First, we configured the MCP server in the settings:
|
||||
|
||||
```json
|
||||
{
|
||||
"mcpServers": {
|
||||
"alphaadvantage-mcp": {
|
||||
"command": "node",
|
||||
"args": ["/path/to/alphaadvantage-mcp/build/index.js"],
|
||||
"env": {
|
||||
"ALPHAVANTAGE_API_KEY": "YOUR_API_KEY"
|
||||
},
|
||||
"disabled": false,
|
||||
"autoApprove": []
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. Then we tested each tool individually:
|
||||
|
||||
- **get_stock_overview**: Retrieved AAPL stock overview information
|
||||
|
||||
```markdown
|
||||
# AAPL (Apple Inc) - $241.84 ↑+1.91%
|
||||
|
||||
**Sector:** TECHNOLOGY
|
||||
**Industry:** ELECTRONIC COMPUTERS
|
||||
**Market Cap:** 3.63T
|
||||
**P/E Ratio:** 38.26
|
||||
...
|
||||
```
|
||||
|
||||
- **get_technical_analysis**: Obtained price action and RSI data
|
||||
|
||||
```markdown
|
||||
# Technical Analysis: AAPL
|
||||
|
||||
## Daily Price Action
|
||||
|
||||
Current Price: $241.84 (↑$4.54, +1.91%)
|
||||
|
||||
### Recent Daily Prices
|
||||
|
||||
| Date | Open | High | Low | Close | Volume |
|
||||
| ---------- | ------- | ------- | ------- | ------- | ------ |
|
||||
| 2025-02-28 | $236.95 | $242.09 | $230.20 | $241.84 | 56.83M |
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
- **get_earnings_report**: Retrieved MSFT earnings history and formatted report
|
||||
|
||||
```markdown
|
||||
# Earnings Report: MSFT (Microsoft Corporation)
|
||||
|
||||
**Sector:** TECHNOLOGY
|
||||
**Industry:** SERVICES-PREPACKAGED SOFTWARE
|
||||
**Current EPS:** $12.43
|
||||
|
||||
## Recent Quarterly Earnings
|
||||
|
||||
| Quarter | Date | EPS Estimate | EPS Actual | Surprise % |
|
||||
| ---------- | ---------- | ------------ | ---------- | ---------- |
|
||||
| 2024-12-31 | 2025-01-29 | $3.11 | $3.23 | ↑4.01% |
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
### Challenges and Solutions
|
||||
|
||||
During development, we encountered several challenges:
|
||||
|
||||
1. **API Rate Limiting**:
|
||||
- **Challenge**: Free tier limited to 5 calls per minute
|
||||
- **Solution**: Implemented queuing, enforced rate limits, and added comprehensive caching
|
||||
2. **Data Formatting**:
|
||||
- **Challenge**: Raw API data not user-friendly
|
||||
- **Solution**: Created formatting utilities for consistent display of financial data
|
||||
3. **Timeout Issues**:
|
||||
- **Challenge**: Complex tools making multiple API calls could timeout
|
||||
- **Solution**: Suggested breaking complex tools into smaller pieces, optimizing caching
|
||||
|
||||
### Lessons Learned
|
||||
|
||||
Our AlphaAdvantage implementation taught us several key lessons:
|
||||
|
||||
1. **Plan for API Limits**: Understand and design around API rate limits from the beginning
|
||||
2. **Cache Strategically**: Identify high-value caching opportunities to improve performance
|
||||
3. **Format for Readability**: Invest in good data formatting for improved user experience
|
||||
4. **Test Every Path**: Test all tools individually before completion
|
||||
5. **Handle API Complexity**: For APIs requiring multiple calls, design tools with simpler scopes
|
||||
|
||||
## Core Implementation Best Practices
|
||||
|
||||
### Comprehensive Logging
|
||||
|
||||
Effective logging is essential for debugging MCP servers:
|
||||
|
||||
```typescript
|
||||
// Start-up logging
|
||||
console.error("[Setup] Initializing AlphaAdvantage MCP server...")
|
||||
|
||||
// API request logging
|
||||
console.error(`[API] Getting stock overview for ${symbol}`)
|
||||
|
||||
// Error handling with context
|
||||
console.error(`[Error] Tool execution failed: ${error.message}`)
|
||||
|
||||
// Cache operations
|
||||
console.error(`[Cache] Using cached data for: ${cacheKey}`)
|
||||
```
|
||||
|
||||
### Strong Typing
|
||||
|
||||
Type definitions prevent errors and improve maintainability:
|
||||
|
||||
```typescript
|
||||
export interface AlphaAdvantageConfig {
|
||||
apiKey: string
|
||||
cacheTTL?: Partial<typeof DEFAULT_CACHE_TTL>
|
||||
baseURL?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate that a stock symbol is provided and looks valid
|
||||
*/
|
||||
function validateSymbol(symbol: unknown): asserts symbol is string {
|
||||
if (typeof symbol !== "string" || symbol.trim() === "") {
|
||||
throw new McpError(ErrorCode.InvalidParams, "A valid stock symbol is required")
|
||||
}
|
||||
|
||||
// Basic symbol validation (letters, numbers, dots)
|
||||
const symbolRegex = /^[A-Za-z0-9.]+$/
|
||||
if (!symbolRegex.test(symbol)) {
|
||||
throw new McpError(ErrorCode.InvalidParams, `Invalid stock symbol: ${symbol}`)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Intelligent Caching
|
||||
|
||||
Reduce API calls and improve performance:
|
||||
|
||||
```typescript
|
||||
// Default cache TTL in seconds
|
||||
const DEFAULT_CACHE_TTL = {
|
||||
STOCK_OVERVIEW: 60 * 60, // 1 hour
|
||||
TECHNICAL_ANALYSIS: 60 * 30, // 30 minutes
|
||||
FUNDAMENTAL_ANALYSIS: 60 * 60 * 24, // 24 hours
|
||||
EARNINGS_REPORT: 60 * 60 * 24, // 24 hours
|
||||
NEWS: 60 * 15, // 15 minutes
|
||||
}
|
||||
|
||||
// Check cache first
|
||||
const cachedData = this.cache.get<T>(cacheKey)
|
||||
if (cachedData) {
|
||||
console.error(`[Cache] Using cached data for: ${cacheKey}`)
|
||||
return cachedData
|
||||
}
|
||||
|
||||
// Cache successful responses
|
||||
this.cache.set(cacheKey, response.data, cacheTTL)
|
||||
```
|
||||
|
||||
### Graceful Error Handling
|
||||
|
||||
Implement robust error handling that maintains a good user experience:
|
||||
|
||||
```typescript
|
||||
try {
|
||||
switch (request.params.name) {
|
||||
case "get_stock_overview": {
|
||||
// Implementation...
|
||||
}
|
||||
|
||||
// Other cases...
|
||||
|
||||
default:
|
||||
throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${request.params.name}`)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`[Error] Tool execution failed: ${error instanceof Error ? error.message : String(error)}`)
|
||||
|
||||
if (error instanceof McpError) {
|
||||
throw error
|
||||
}
|
||||
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: `Error: ${error instanceof Error ? error.message : String(error)}`,
|
||||
},
|
||||
],
|
||||
isError: true,
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## MCP Resources
|
||||
|
||||
Resources let your MCP servers expose data to Cline without executing code. They're perfect for providing context like files, API responses, or database records that Cline can reference during conversations.
|
||||
|
||||
### Adding Resources to Your MCP Server
|
||||
|
||||
1. **Define the resources** your server will expose:
|
||||
|
||||
```typescript
|
||||
server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
||||
return {
|
||||
resources: [
|
||||
{
|
||||
uri: "file:///project/readme.md",
|
||||
name: "Project README",
|
||||
mimeType: "text/markdown",
|
||||
},
|
||||
],
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
2. **Implement read handlers** to deliver the content:
|
||||
|
||||
```typescript
|
||||
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
||||
if (request.params.uri === "file:///project/readme.md") {
|
||||
const content = await fs.promises.readFile("/path/to/readme.md", "utf-8")
|
||||
return {
|
||||
contents: [
|
||||
{
|
||||
uri: request.params.uri,
|
||||
mimeType: "text/markdown",
|
||||
text: content,
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error("Resource not found")
|
||||
})
|
||||
```
|
||||
|
||||
Resources make your MCP servers more context-aware, allowing Cline to access specific information without requiring you to copy/paste. For more information, refer to the [official documentation](https://modelcontextprotocol.io/docs/concepts/resources).
|
||||
|
||||
## Common Challenges and Solutions
|
||||
|
||||
### API Authentication Complexities
|
||||
|
||||
**Challenge**: APIs often have different authentication methods.
|
||||
|
||||
**Solution**:
|
||||
|
||||
- For API keys, use environment variables in the MCP configuration
|
||||
- For OAuth, create a separate script to obtain refresh tokens
|
||||
- Store sensitive tokens securely
|
||||
|
||||
```typescript
|
||||
// Authenticate using API key from environment
|
||||
const API_KEY = process.env.ALPHAVANTAGE_API_KEY
|
||||
if (!API_KEY) {
|
||||
console.error("[Error] Missing ALPHAVANTAGE_API_KEY environment variable")
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
// Initialize API client
|
||||
const apiClient = new AlphaAdvantageClient({
|
||||
apiKey: API_KEY,
|
||||
})
|
||||
```
|
||||
|
||||
### Missing or Limited API Features
|
||||
|
||||
**Challenge**: APIs may not provide all the functionality you need.
|
||||
|
||||
**Solution**:
|
||||
|
||||
- Implement fallbacks using available endpoints
|
||||
- Create simulated functionality where necessary
|
||||
- Transform API data to match your needs
|
||||
|
||||
### API Rate Limiting
|
||||
|
||||
**Challenge**: Most APIs have rate limits that can cause failures.
|
||||
|
||||
**Solution**:
|
||||
|
||||
- Implement proper rate limiting
|
||||
- Add intelligent caching
|
||||
- Provide graceful degradation
|
||||
- Add transparent errors about rate limits
|
||||
|
||||
```typescript
|
||||
if (this.requestsThisMinute >= 5) {
|
||||
console.error("[Rate Limit] Rate limit reached. Waiting for next minute...")
|
||||
return new Promise<void>((resolve) => {
|
||||
const remainingMs = 60 * 1000 - (Date.now() % (60 * 1000))
|
||||
setTimeout(resolve, remainingMs + 100) // Add 100ms buffer
|
||||
})
|
||||
}
|
||||
```
|
||||
|
||||
## Additional Resources
|
||||
|
||||
- [MCP Protocol Documentation](https://github.com/modelcontextprotocol/mcp)
|
||||
- [MCP SDK Documentation](https://github.com/modelcontextprotocol/sdk-js)
|
||||
- [MCP Server Examples](https://github.com/modelcontextprotocol/servers)
|
||||
@@ -1,197 +0,0 @@
|
||||
---
|
||||
title: "MCP Transport Mechanisms"
|
||||
description: "Learn about the two primary transport mechanisms for communication between Cline and MCP servers: Standard Input/Output (STDIO) and Server-Sent Events (SSE). Each has distinct characteristics, advantages, and use cases."
|
||||
---
|
||||
|
||||
Model Context Protocol (MCP) supports two primary transport mechanisms for communication between Cline and MCP servers: Standard Input/Output (STDIO) and Server-Sent Events (SSE). Each has distinct characteristics, advantages, and use cases.
|
||||
|
||||
## STDIO Transport
|
||||
|
||||
STDIO transport runs locally on your machine and communicates via standard input/output streams.
|
||||
|
||||
### How STDIO Transport Works
|
||||
|
||||
1. The client (Cline) spawns an MCP server as a child process
|
||||
2. Communication happens through process streams: client writes to server's STDIN, server responds to STDOUT
|
||||
3. Each message is delimited by a newline character
|
||||
4. Messages are formatted as JSON-RPC 2.0
|
||||
|
||||
```plaintext
|
||||
Client Server
|
||||
| |
|
||||
|<---- JSON message ----->| (via STDIN)
|
||||
| | (processes request)
|
||||
|<---- JSON message ------| (via STDOUT)
|
||||
| |
|
||||
```
|
||||
|
||||
### STDIO Characteristics
|
||||
|
||||
- **Locality**: Runs on the same machine as Cline
|
||||
- **Performance**: Very low latency and overhead (no network stack involved)
|
||||
- **Simplicity**: Direct process communication without network configuration
|
||||
- **Relationship**: One-to-one relationship between client and server
|
||||
- **Security**: Inherently more secure as no network exposure
|
||||
|
||||
### When to Use STDIO
|
||||
|
||||
STDIO transport is ideal for:
|
||||
|
||||
- Local integrations and tools running on the same machine
|
||||
- Security-sensitive operations
|
||||
- Low-latency requirements
|
||||
- Single-client scenarios (one Cline instance per server)
|
||||
- Command-line tools or IDE extensions
|
||||
|
||||
### STDIO Implementation Example
|
||||
|
||||
```typescript
|
||||
import { Server } from "@modelcontextprotocol/sdk/server/index.js"
|
||||
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
||||
|
||||
const server = new Server({ name: "local-server", version: "1.0.0" })
|
||||
// Register tools...
|
||||
|
||||
// Use STDIO transport
|
||||
const transport = new StdioServerTransport(server)
|
||||
transport.listen()
|
||||
```
|
||||
|
||||
## SSE Transport
|
||||
|
||||
Server-Sent Events (SSE) transport runs on a remote server and communicates over HTTP/HTTPS.
|
||||
|
||||
### How SSE Transport Works
|
||||
|
||||
1. The client (Cline) connects to the server's SSE endpoint via HTTP GET request
|
||||
2. This establishes a persistent connection where the server can push events to the client
|
||||
3. For client-to-server communication, the client makes HTTP POST requests to a separate endpoint
|
||||
4. Communication happens over two channels:
|
||||
- Event Stream (GET): Server-to-client updates
|
||||
- Message Endpoint (POST): Client-to-server requests
|
||||
|
||||
```plaintext
|
||||
Client Server
|
||||
| |
|
||||
|---- HTTP GET /events ----------->| (establish SSE connection)
|
||||
|<---- SSE event stream -----------| (persistent connection)
|
||||
| |
|
||||
|---- HTTP POST /message --------->| (client request)
|
||||
|<---- SSE event with response ----| (server response)
|
||||
| |
|
||||
```
|
||||
|
||||
### SSE Characteristics
|
||||
|
||||
- **Remote Access**: Can be hosted on a different machine from your Cline instance
|
||||
- **Scalability**: Can handle multiple client connections concurrently
|
||||
- **Protocol**: Works over standard HTTP (no special protocols needed)
|
||||
- **Persistence**: Maintains a persistent connection for server-to-client messages
|
||||
- **Authentication**: Can use standard HTTP authentication mechanisms
|
||||
|
||||
### When to Use SSE
|
||||
|
||||
SSE transport is better for:
|
||||
|
||||
- Remote access across networks
|
||||
- Multi-client scenarios
|
||||
- Public services
|
||||
- Centralized tools that many users need to access
|
||||
- Integration with web services
|
||||
|
||||
### SSE Implementation Example
|
||||
|
||||
```typescript
|
||||
import { Server } from "@modelcontextprotocol/sdk/server/index.js"
|
||||
import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js"
|
||||
import express from "express"
|
||||
|
||||
const app = express()
|
||||
const server = new Server({ name: "remote-server", version: "1.0.0" })
|
||||
// Register tools...
|
||||
|
||||
// Use SSE transport
|
||||
const transport = new SSEServerTransport(server)
|
||||
app.use("/mcp", transport.requestHandler())
|
||||
app.listen(3000, () => {
|
||||
console.log("MCP server listening on port 3000")
|
||||
})
|
||||
```
|
||||
|
||||
## Local vs. Hosted: Deployment Aspects
|
||||
|
||||
The choice between STDIO and SSE transports directly impacts how you'll deploy and manage your MCP servers.
|
||||
|
||||
### STDIO: Local Deployment Model
|
||||
|
||||
STDIO servers run locally on the same machine as Cline, which has several important implications:
|
||||
|
||||
- **Installation**: The server executable must be installed on each user's machine
|
||||
- **Distribution**: You need to provide installation packages for different operating systems
|
||||
- **Updates**: Each instance must be updated separately
|
||||
- **Resources**: Uses the local machine's CPU, memory, and disk
|
||||
- **Access Control**: Relies on the local machine's filesystem permissions
|
||||
- **Integration**: Easy integration with local system resources (files, processes)
|
||||
- **Execution**: Starts and stops with Cline (child process lifecycle)
|
||||
- **Dependencies**: Any dependencies must be installed on the user's machine
|
||||
|
||||
#### Practical Example
|
||||
|
||||
A local file search tool using STDIO would:
|
||||
|
||||
- Run on the user's machine
|
||||
- Have direct access to the local filesystem
|
||||
- Start when needed by Cline
|
||||
- Not require network configuration
|
||||
- Need to be installed alongside Cline or via a package manager
|
||||
|
||||
### SSE: Hosted Deployment Model
|
||||
|
||||
SSE servers can be deployed to remote servers and accessed over the network:
|
||||
|
||||
- **Installation**: Installed once on a server, accessed by many users
|
||||
- **Distribution**: Single deployment serves multiple clients
|
||||
- **Updates**: Centralized updates affect all users immediately
|
||||
- **Resources**: Uses server resources, not local machine resources
|
||||
- **Access Control**: Managed through authentication and authorization systems
|
||||
- **Integration**: More complex integration with user-specific resources
|
||||
- **Execution**: Runs as an independent service (often continuously)
|
||||
- **Dependencies**: Managed on the server, not on user machines
|
||||
|
||||
#### Practical Example
|
||||
|
||||
A database query tool using SSE would:
|
||||
|
||||
- Run on a central server
|
||||
- Connect to databases with server-side credentials
|
||||
- Be continuously available for multiple users
|
||||
- Require proper network security configuration
|
||||
- Be deployed using container or cloud technologies
|
||||
|
||||
### Hybrid Approaches
|
||||
|
||||
Some scenarios benefit from a hybrid approach:
|
||||
|
||||
1. **STDIO with Network Access**: A local STDIO server that acts as a proxy to remote services
|
||||
2. **SSE with Local Commands**: A remote SSE server that can trigger operations on the client machine through callbacks
|
||||
3. **Gateway Pattern**: STDIO servers for local operations that connect to SSE servers for specialized functions
|
||||
|
||||
## Choosing Between STDIO and SSE
|
||||
|
||||
| Consideration | STDIO | SSE |
|
||||
| -------------------- | ------------------------ | ----------------------------------- |
|
||||
| **Location** | Local machine only | Local or remote |
|
||||
| **Clients** | Single client | Multiple clients |
|
||||
| **Performance** | Lower latency | Higher latency (network overhead) |
|
||||
| **Setup Complexity** | Simpler | More complex (requires HTTP server) |
|
||||
| **Security** | Inherently secure | Requires explicit security measures |
|
||||
| **Network Access** | Not needed | Required |
|
||||
| **Scalability** | Limited to local machine | Can distribute across network |
|
||||
| **Deployment** | Per-user installation | Centralized installation |
|
||||
| **Updates** | Distributed updates | Centralized updates |
|
||||
| **Resource Usage** | Uses client resources | Uses server resources |
|
||||
| **Dependencies** | Client-side dependencies | Server-side dependencies |
|
||||
|
||||
## Configuring Transports in Cline
|
||||
|
||||
For detailed information on configuring STDIO and SSE transports in Cline, including examples, see [Configuring MCP Servers](/mcp/configuring-mcp-servers).
|
||||
@@ -1,159 +0,0 @@
|
||||
---
|
||||
title: "Context Window Guide"
|
||||
description: "Understanding and managing AI model context windows"
|
||||
---
|
||||
|
||||
## What is a Context Window?
|
||||
|
||||
A context window is the maximum amount of text an AI model can process at once. Think of it as the model's "working memory" - it determines how much of your conversation and code the model can consider when generating responses.
|
||||
|
||||
<Note>
|
||||
**Key Point**: Larger context windows allow the model to understand more of your codebase at once, but may increase costs and response times.
|
||||
</Note>
|
||||
|
||||
## Context Window Sizes
|
||||
|
||||
### Quick Reference
|
||||
|
||||
| Size | Tokens | Approximate Words | Use Case |
|
||||
|------|--------|------------------|----------|
|
||||
| **Small** | 8K-32K | 6,000-24,000 | Single files, quick fixes |
|
||||
| **Medium** | 128K | ~96,000 | Most coding projects |
|
||||
| **Large** | 200K | ~150,000 | Complex codebases |
|
||||
| **Extra Large** | 400K+ | ~300,000+ | Entire applications |
|
||||
| **Massive** | 1M+ | ~750,000+ | Multi-project analysis |
|
||||
|
||||
### Model Context Windows
|
||||
|
||||
| Model | Context Window | Effective Window* | Notes |
|
||||
|-------|---------------|------------------|-------|
|
||||
| **Claude Sonnet 4.5** | 1M tokens | ~500K tokens | Best quality at high context |
|
||||
| **GPT-5** | 400K tokens | ~300K tokens | Three modes affect performance |
|
||||
| **Gemini 2.5 Pro** | 1M+ tokens | ~600K tokens | Excellent for documents |
|
||||
| **DeepSeek V3** | 128K tokens | ~100K tokens | Optimal for most tasks |
|
||||
| **Qwen3 Coder** | 256K tokens | ~200K tokens | Good balance |
|
||||
|
||||
*Effective window is where model maintains high quality
|
||||
|
||||
## Managing Context Efficiently
|
||||
|
||||
### What Counts Toward Context
|
||||
|
||||
1. **Your current conversation** - All messages in the chat
|
||||
2. **File contents** - Any files you've shared or Cline has read
|
||||
3. **Tool outputs** - Results from executed commands
|
||||
4. **System prompts** - Cline's instructions (minimal impact)
|
||||
|
||||
### Optimization Strategies
|
||||
|
||||
#### 1. Start Fresh for New Features
|
||||
```text
|
||||
/new - Creates a new task with clean context
|
||||
```
|
||||
Benefits:
|
||||
- Maximum context available
|
||||
- No irrelevant history
|
||||
- Better model focus
|
||||
|
||||
#### 2. Use @ Mentions Strategically
|
||||
Instead of including entire files:
|
||||
- `@filename.ts` - Include only when needed
|
||||
- Use search instead of reading large files
|
||||
- Reference specific functions rather than whole files
|
||||
|
||||
#### 3. Enable Auto-compact
|
||||
Cline can automatically summarize long conversations:
|
||||
- Settings → Features → Auto-compact
|
||||
- Preserves important context
|
||||
- Reduces token usage
|
||||
|
||||
## Context Window Warnings
|
||||
|
||||
### Signs You're Hitting Limits
|
||||
|
||||
| Warning Sign | What It Means | Solution |
|
||||
|-------------|---------------|----------|
|
||||
| **"Context window exceeded"** | Hard limit reached | Start new task or enable auto-compact |
|
||||
| **Slower responses** | Model struggling with context | Reduce included files |
|
||||
| **Repetitive suggestions** | Context fragmentation | Summarize and start fresh |
|
||||
| **Missing recent changes** | Context overflow | Use checkpoints to track changes |
|
||||
|
||||
### Best Practices by Project Size
|
||||
|
||||
#### Small Projects (< 50 files)
|
||||
- Any model works well
|
||||
- Include relevant files freely
|
||||
- No special optimization needed
|
||||
|
||||
#### Medium Projects (50-500 files)
|
||||
- Use 128K+ context models
|
||||
- Include only working set of files
|
||||
- Clear context between features
|
||||
|
||||
#### Large Projects (500+ files)
|
||||
- Use 200K+ context models
|
||||
- Focus on specific modules
|
||||
- Use search instead of reading many files
|
||||
- Break work into smaller tasks
|
||||
|
||||
## Advanced Context Management
|
||||
|
||||
### Plan/Act Mode Optimization
|
||||
|
||||
Leverage Plan/Act mode for better context usage:
|
||||
- **Plan Mode**: Use smaller context for discussion
|
||||
- **Act Mode**: Include necessary files for implementation
|
||||
|
||||
Configuration:
|
||||
```text
|
||||
Plan Mode: DeepSeek V3 (128K) - Lower cost planning
|
||||
Act Mode: Claude Sonnet (1M) - Maximum context for coding
|
||||
```
|
||||
|
||||
### Context Pruning Strategies
|
||||
|
||||
1. **Temporal Pruning**: Remove old conversation parts
|
||||
2. **Semantic Pruning**: Keep only relevant code sections
|
||||
3. **Hierarchical Pruning**: Maintain high-level structure, prune details
|
||||
|
||||
### Token Counting Tips
|
||||
|
||||
#### Rough Estimates
|
||||
- **1 token ≈ 0.75 words**
|
||||
- **1 token ≈ 4 characters**
|
||||
- **100 lines of code ≈ 500-1000 tokens**
|
||||
|
||||
#### File Size Guidelines
|
||||
| File Type | Tokens per KB |
|
||||
|-----------|---------------|
|
||||
| **Code** | ~250-400 |
|
||||
| **JSON** | ~300-500 |
|
||||
| **Markdown** | ~200-300 |
|
||||
| **Plain text** | ~200-250 |
|
||||
|
||||
## Context Window FAQ
|
||||
|
||||
### Q: Why do responses get worse with very long conversations?
|
||||
**A:** Models can lose focus with too much context. The "effective window" is typically 50-70% of the advertised limit.
|
||||
|
||||
### Q: Should I use the largest context window available?
|
||||
**A:** Not always. Larger contexts increase cost and can reduce response quality. Match the context to your task size.
|
||||
|
||||
### Q: How can I tell how much context I'm using?
|
||||
**A:** Cline shows token usage in the interface. Watch for the context meter approaching limits.
|
||||
|
||||
### Q: What happens when I exceed the context limit?
|
||||
**A:** Cline will either:
|
||||
- Automatically compact the conversation (if enabled)
|
||||
- Show an error and suggest starting a new task
|
||||
- Truncate older messages (with warning)
|
||||
|
||||
## Recommendations by Use Case
|
||||
|
||||
| Use Case | Recommended Context | Model Suggestion |
|
||||
|----------|-------------------|------------------|
|
||||
| **Quick fixes** | 32K-128K | DeepSeek V3 |
|
||||
| **Feature development** | 128K-200K | Qwen3 Coder |
|
||||
| **Large refactoring** | 400K+ | Claude Sonnet 4.5 |
|
||||
| **Code review** | 200K-400K | GPT-5 |
|
||||
| **Documentation** | 128K | Any budget model |
|
||||
@@ -1,29 +0,0 @@
|
||||
---
|
||||
title: "AIhubmix"
|
||||
description: "Learn how to configure and use AIhubmix with Cline. Access multiple AI models through a unified API aggregator."
|
||||
---
|
||||
|
||||
AIhubmix is an AI model aggregator that provides access to multiple AI models through a unified OpenAI-compatible API.
|
||||
|
||||
**Website:** [https://aihubmix.com/](https://aihubmix.com/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [AIhubmix](https://aihubmix.com/). Create an account or sign in.
|
||||
2. **Navigate to API Keys:** Access the API key section in your dashboard.
|
||||
3. **Create a Key:** Generate a new API key.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely.
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "AIhubmix" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your AIhubmix API key.
|
||||
4. **Enter Model ID:** Specify the model you want to use.
|
||||
5. **Configure Settings:** Optionally set context window size and max output tokens.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **OpenAI Compatible:** AIhubmix uses an OpenAI-compatible API format.
|
||||
- **Model Aggregation:** Access models from multiple providers through a single API.
|
||||
- **Custom Model IDs:** You can specify any model ID available on the AIhubmix platform.
|
||||
@@ -1,10 +1,17 @@
|
||||
---
|
||||
title: "Anthropic"
|
||||
description: "Learn how to configure and use Anthropic Claude models with Cline. Covers API key setup, model selection, and advanced features like prompt caching."
|
||||
title: "Anthropic / Claude Code"
|
||||
description: "Configure Anthropic API keys or Claude Code subscription with Cline."
|
||||
---
|
||||
|
||||
**Website:** [https://www.anthropic.com/](https://www.anthropic.com/)
|
||||
|
||||
## Choose an Anthropic Path
|
||||
|
||||
- **[Anthropic API (key-based)](#getting-an-api-key):** Use an Anthropic API key.
|
||||
- **[Claude Code (subscription-based)](#claude-code-subscription):** Use your Claude Max/Pro subscription through the Claude CLI.
|
||||
|
||||
## Anthropic API (key-based)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to the [Anthropic Console](https://console.anthropic.com/). Create an account or sign in.
|
||||
@@ -12,49 +19,33 @@ description: "Learn how to configure and use Anthropic Claude models with Cline.
|
||||
3. **Create a Key:** Click "Create Key". 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 Anthropic Claude models:
|
||||
|
||||
#### Claude Opus 4.7 Series
|
||||
- `claude-opus-4-7` - Most capable Opus model, best for complex reasoning and long-horizon tasks
|
||||
- `claude-opus-4-7:1m` - 1M context window variant
|
||||
|
||||
#### Claude 4.6 Series
|
||||
- `claude-sonnet-4-6` - Latest Sonnet with extended thinking support
|
||||
- `claude-sonnet-4-6:1m` - 1M context window variant with tiered pricing
|
||||
|
||||
#### Claude 4.5 Series
|
||||
- `claude-sonnet-4-5-20250929` (Recommended) - Stable default Sonnet with reasoning support
|
||||
- `claude-sonnet-4-5-20250929:1m` - 1M context window variant with tiered pricing
|
||||
|
||||
#### Claude 4 Series
|
||||
- `claude-haiku-4-5-20251001` - Fast, affordable model with reasoning support
|
||||
- `claude-sonnet-4-20250514` - High-performance coding and reasoning
|
||||
- `claude-sonnet-4-20250514:1m` - 1M context window variant
|
||||
- `claude-opus-4-6` - Previous Opus generation
|
||||
- `claude-opus-4-6:1m` - 1M context window variant
|
||||
- `claude-opus-4-5-20251101` - Earlier Opus release
|
||||
- `claude-opus-4-1-20250805` - Earlier Opus release
|
||||
- `claude-opus-4-20250514` - Original Opus 4
|
||||
|
||||
#### Claude 3 Series (Legacy)
|
||||
- `claude-3-7-sonnet-20250219` - Extended thinking support
|
||||
- `claude-3-5-sonnet-20241022` - Previous generation Sonnet
|
||||
- `claude-3-5-haiku-20241022` - Fast and affordable
|
||||
- `claude-3-opus-20240229` - Previous generation Opus
|
||||
- `claude-3-haiku-20240307` - Most affordable Claude model
|
||||
|
||||
See [Anthropic's Model Documentation](https://docs.anthropic.com/en/docs/about-claude/models) for more details on each model's capabilities.
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
> See [Authorization & Model Selection](/getting-started/authorizing-with-cline#menu).
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Anthropic" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Anthropic API key into the "Anthropic API Key" field.
|
||||
4. **Select Model:** Choose your desired Claude model from the "Model" dropdown.
|
||||
5. **(Optional) Custom Base URL:** If you need to use a custom base URL for the Anthropic API, check "Use custom base URL" and enter the URL. Most users won't need to adjust this setting.
|
||||
|
||||
## Claude Code (Subscription)
|
||||
|
||||
Use this path if you already have Claude Max/Pro and want to use subscription-based access in Cline.
|
||||
|
||||
1. Install and authenticate Claude CLI via Anthropic docs: [Claude Code setup](https://docs.anthropic.com/en/docs/claude-code/setup).
|
||||
2. In Cline settings, select **Claude Code** as provider.
|
||||
3. Set the Claude CLI path (usually `claude` if available in PATH).
|
||||
|
||||
Find Claude path:
|
||||
- macOS / Linux / WSL / Git Bash: `which claude`
|
||||
- Windows Command Prompt: `where claude`
|
||||
|
||||
Notes:
|
||||
- Uses your Claude subscription limits instead of API token billing.
|
||||
- Responses may not stream token-by-token.
|
||||
- Image uploads and prompt caching are limited in this mode.
|
||||
|
||||
### Extended Thinking
|
||||
|
||||
Anthropic models offer an "Extended Thinking" feature, designed to give them enhanced reasoning capabilities for complex tasks. This feature allows the model to output its step-by-step thought process before delivering a final answer, providing transparency and enabling more thorough analysis for challenging prompts.
|
||||
@@ -64,7 +55,6 @@ Cline users can leverage this by checking the `Enable Extended Thinking` box bel
|
||||
|
||||
**Key Aspects of Extended Thinking:**
|
||||
|
||||
- **Supported Models:** This feature is available for select models, including Claude Opus 4, Claude Sonnet 3.7+.
|
||||
- **Summarized Thinking (Claude 3.7+):** For Claude 3.7+ models, the API returns a summary of the full thinking process to balance insight with efficiency and prevent misuse. You are billed for the full thinking tokens, not just the summary.
|
||||
- **Streaming:** Extended thinking responses, including the `thinking` blocks, can be streamed.
|
||||
- **Tool Use & Prompt Caching:** Extended thinking interacts with tool use (requiring thinking blocks to be passed back) and prompt caching (with specific behaviors around cache invalidation and context).
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
---
|
||||
title: "AskSage"
|
||||
description: "Learn how to configure and use AskSage with Cline. Access AI models through a government and enterprise-focused platform with FedRAMP compliance."
|
||||
---
|
||||
|
||||
AskSage is a government and enterprise-focused AI platform providing access to multiple AI models with security compliance features including FedRAMP authorization.
|
||||
|
||||
**Website:** [https://www.asksage.ai/](https://www.asksage.ai/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [AskSage](https://www.asksage.ai/). Create an account or sign in.
|
||||
2. **Navigate to API Keys:** Access the API key section in your dashboard.
|
||||
3. **Create a Key:** Generate a new API key.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following AskSage models (subscription-based pricing):
|
||||
|
||||
#### Claude Models
|
||||
- `claude-4-sonnet` (Default) - Claude 4 Sonnet via AskSage
|
||||
- `claude-4.6-sonnet` - Claude 4.6 Sonnet via AskSage
|
||||
- `claude-4-opus` - Claude 4 Opus via AskSage
|
||||
- `claude-37-sonnet` - Claude 3.7 Sonnet
|
||||
- `claude-35-sonnet` - Claude 3.5 Sonnet
|
||||
- `aws-bedrock-claude-35-sonnet-gov` - Government cloud variant
|
||||
|
||||
#### OpenAI Models
|
||||
- `gpt-5` - GPT-5 via AskSage
|
||||
- `gpt-5-mini` - GPT-5 Mini
|
||||
- `gpt-5-nano` - GPT-5 Nano
|
||||
- `gpt-4.1` - GPT-4.1 with 1M context
|
||||
- `gpt-4o` - GPT-4o
|
||||
- `gpt-4o-gov` - Government cloud variant
|
||||
|
||||
#### Google Models
|
||||
- `google-gemini-2.5-pro` - Gemini 2.5 Pro with 1M context
|
||||
- `google-claude-45-sonnet` - Claude 4.5 Sonnet via Google
|
||||
- `google-claude-4-opus` - Claude 4 Opus via Google
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "AskSage" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your AskSage API key.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Government Compliance:** FedRAMP authorized for government use cases.
|
||||
- **Subscription Pricing:** All models are included in the AskSage subscription (no per-token costs).
|
||||
- **Gov Variants:** Select `-gov` models for government cloud deployments.
|
||||
- **Documentation:** Refer to [AskSage docs](https://docs.asksage.ai/) for more information.
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "API Key (Simple Setup)"
|
||||
sidebarTitle: "API Key"
|
||||
description: "Set up AWS Bedrock with Cline using Bedrock API Keys. Simplest setup for individual developers to access frontier models."
|
||||
description: "Set up AWS Bedrock with Cline using Bedrock API Keys. Simplest setup for individual developers to access frontier provider."
|
||||
---
|
||||
|
||||
### Overview
|
||||
@@ -59,7 +59,7 @@ You can create a custom IAM policy with these permissions and attach it to your
|
||||
|
||||
---
|
||||
|
||||
### Step 2: Verify Regional and Model Access
|
||||
### Step 2: Verify Regional Access
|
||||
|
||||
#### 2.1 Choose and Confirm a Region
|
||||
|
||||
@@ -91,8 +91,7 @@ You can create a custom IAM policy with these permissions and attach it to your
|
||||
3. **Enter Your AWS API Key:**
|
||||
- Input your **API Key**
|
||||
- Specify the correct **AWS Region** (e.g., `us-east-1` or your enterprise-approved region).
|
||||
4. **Select a Model:**
|
||||
- Choose an on-demand model (e.g., **anthropic.claude-3-5-sonnet-20241022-v2:0**).
|
||||
4. **Select a Provider Model:**
|
||||
5. **Save and Test:**
|
||||
- Click **Done/Save** to apply your settings.
|
||||
- Test the integration by sending a simple prompt (e.g., "Generate a Python function to check if a number is prime.").
|
||||
@@ -119,18 +118,3 @@ You can create a custom IAM policy with these permissions and attach it to your
|
||||
- Follow internal data privacy and governance policies.
|
||||
|
||||
---
|
||||
|
||||
### Conclusion
|
||||
|
||||
By following these steps, you can quickly integrate AWS Bedrock with the Cline VS Code extension to accelerate development:
|
||||
|
||||
1. **Prepare Your AWS Environment:** Create a Bedrock API Key with the necessary permissions.
|
||||
2. **Verify Region and Model Access:** Confirm that your selected region supports your required models.
|
||||
3. **Configure Cline in VS Code:** Install and set up Cline with your AWS API Key and choose an appropriate model.
|
||||
4. **Implement Security and Monitoring:** Use best practices for IAM, network security, monitoring, and cost management.
|
||||
|
||||
For further details, consult the [AWS Bedrock Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html). Happy coding!
|
||||
|
||||
---
|
||||
|
||||
_This guide will be updated as AWS Bedrock and Cline evolve. Always refer to the latest documentation and internal policies for up-to-date practices._
|
||||
|
||||
@@ -64,7 +64,7 @@ You can create a custom IAM policy with these permissions and attach it to your
|
||||
|
||||
---
|
||||
|
||||
### Step 2: Verify Regional and Model Access
|
||||
### Step 2: Verify Regional Access
|
||||
|
||||
#### 2.1 Choose and Confirm a Region
|
||||
|
||||
@@ -106,8 +106,7 @@ You can create a custom IAM policy with these permissions and attach it to your
|
||||
3. **Enter Your AWS Credentials:**
|
||||
- Input your **Access Key** and **Secret Key** (or use temporary credentials if using AWS SSO).
|
||||
- Specify the correct **AWS Region** (e.g., `us-east-1` or your enterprise-approved region).
|
||||
4. **Select a Model:**
|
||||
- Choose an on-demand model (e.g., **anthropic.claude-3-5-sonnet-20241022-v2:0**).
|
||||
4. **Select a Provider Model:**
|
||||
5. **Save and Test:**
|
||||
- Click **Done/Save** to apply your settings.
|
||||
- Test the integration by sending a simple prompt (e.g., "Generate a Python function to check if a number is prime.").
|
||||
@@ -134,18 +133,3 @@ You can create a custom IAM policy with these permissions and attach it to your
|
||||
- Follow internal data privacy and governance policies.
|
||||
|
||||
---
|
||||
|
||||
### Conclusion
|
||||
|
||||
By following these steps, your enterprise team can securely integrate AWS Bedrock with the Cline VS Code extension to accelerate development:
|
||||
|
||||
1. **Prepare Your AWS Environment:** Create or use a secure IAM role/user, attach the `AmazonBedrockLimitedAccess` policy, and ensure necessary permissions.
|
||||
2. **Verify Region and Model Access:** Confirm that your selected region supports your required models and subscribe via AWS Marketplace if needed.
|
||||
3. **Configure Cline in VS Code:** Install and set up Cline with your AWS credentials and choose an appropriate model.
|
||||
4. **Implement Security and Monitoring:** Use best practices for IAM, network security, monitoring, and cost management.
|
||||
|
||||
For further details, consult the [AWS Bedrock Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html) and coordinate with your internal cloud team. Happy coding!
|
||||
|
||||
---
|
||||
|
||||
_This guide will be updated as AWS Bedrock and Cline evolve. Always refer to the latest documentation and internal policies for up-to-date practices._
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
---
|
||||
title: "Baseten"
|
||||
description: "Learn how to configure and use Baseten's Model APIs with Cline. Access frontier open-source models with enterprise-grade performance, reliability, and competitive pricing."
|
||||
---
|
||||
|
||||
Baseten provides on-demand frontier model APIs designed for production applications, not just experimentation. Built on the Baseten Inference Stack, these APIs deliver optimized inference for leading open-source models from OpenAI, DeepSeek, Moonshot AI, and Alibaba Cloud.
|
||||
|
||||
**Website:** [https://www.baseten.co/products/model-apis/](https://www.baseten.co/products/model-apis/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [Baseten](https://www.baseten.co/) and create an account or sign in.
|
||||
2. **Navigate to API Keys:** Access your dashboard and go to the API Keys section.
|
||||
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 and store it securely.
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Baseten" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Baseten API key into the "Baseten API Key" field.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
**IMPORTANT: For Kimi K2 Thinking:** To use the `moonshotai/Kimi-K2-Thinking` model, you must enable **Native Tool Call (Experimental)** in Cline settings. This setting allows Cline to call tools through their native tool processor and is required for this reasoning model to function properly.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports all current models under Baseten Model APIs, including:
|
||||
For the most updated pricing, please visit: https://www.baseten.co/products/model-apis/
|
||||
|
||||
- `moonshotai/Kimi-K2-Thinking` (Moonshot AI) - Enhanced reasoning capabilities with step-by-step thought processes (262K context) - \$0.60/\$2.50 per 1M tokens
|
||||
- `zai-org/GLM-4.6` (Z AI) - Frontier open model with advanced agentic, reasoning and coding capabilities by Z AI (200k context) \$0.60/\$2.20 per 1M tokens
|
||||
- `moonshotai/Kimi-K2-Instruct-0905` (Moonshot AI) - September update with enhanced capabilities (262K context) - \$0.60/\$2.50 per 1M tokens
|
||||
- `openai/gpt-oss-120b` (OpenAI) - 120B MoE with strong reasoning capabilities (128K context) - \$0.10/\$0.50 per 1M tokens
|
||||
- `Qwen/Qwen3-Coder-480B-A35B-Instruct`- Advanced coding and reasoning (262K context) - \$0.38/\$1.53 per 1M tokens
|
||||
- `Qwen/Qwen3-235B-A22B-Instruct-2507` - Math and reasoning expert (262K context) - \$0.22/\$0.80 per 1M tokens
|
||||
- `deepseek-ai/DeepSeek-R1` - DeepSeek's first-generation reasoning model (163K context) - \$2.55/\$5.95 per 1M tokens
|
||||
- `deepseek-ai/DeepSeek-R1-0528` - Latest revision of DeepSeek's reasoning model (163K context) - \$2.55/\$5.95 per 1M tokens
|
||||
- `deepseek-ai/DeepSeek-V3-0324` - Fast general-purpose with enhanced reasoning (163K context) - \$0.77/\$0.77 per 1M tokens
|
||||
- `deepseek-ai/DeepSeek-V3.1` - Hybrid reasoning with advanced tool calling (163K context) - \$0.50/\$1.50 per 1M tokens
|
||||
- `deepseek-ai/DeepSeek-V3.2` - Hybrid reasoning with efficient long context scaling (163K context) - \$0.30/\$0.45 per 1M tokens
|
||||
|
||||
### Production-First Architecture
|
||||
|
||||
Baseten's Model APIs are built for production environments with several key advantages:
|
||||
|
||||
#### Enterprise-Grade Reliability
|
||||
- **Four nines of uptime** (99.99%) through active-active redundancy
|
||||
- **Cloud-agnostic, multi-cluster autoscaling** for consistent availability
|
||||
- **SOC 2 Type II certified** and **HIPAA compliant** for security requirements
|
||||
|
||||
#### Optimized Performance
|
||||
- **Pre-optimized models** shipped with the Baseten Inference Stack
|
||||
- **Latest-generation GPUs** with multi-cloud infrastructure
|
||||
- **Ultra-fast inference** optimized from the bottom up for production workloads
|
||||
|
||||
#### Cost Efficiency
|
||||
- **5-10x less expensive** than closed alternatives
|
||||
- **Optimized multi-cloud infrastructure** for efficient resource utilization
|
||||
- **Transparent pricing** with no hidden costs or rate limit surprises
|
||||
|
||||
#### Developer Experience
|
||||
- **OpenAI compatible API** - migrate by swapping a single URL
|
||||
- **Drop-in replacement** for closed models with comprehensive observability and analytics
|
||||
- **Seamless scaling** from Model APIs to dedicated deployments
|
||||
|
||||
### Special Features
|
||||
|
||||
#### Function Calling & Tool Use
|
||||
All Baseten models support structured outputs, function calling, and tool use as part of the Baseten Inference Stack, making them ideal for agentic applications and coding workflows.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Dynamic Model Updates:** Cline automatically fetches the latest model list from Baseten, ensuring access to new models as they're released in real time.
|
||||
- **Multi-Cloud Capacity Management (MCM):** Baseten's multi-cloud infrastructure ensures high availability and low latency globally.
|
||||
- **Support:** Baseten provides dedicated support for production deployments and can work with you on dedicated resources as you scale.
|
||||
|
||||
### Pricing Information
|
||||
|
||||
Current pricing is highly competitive and transparent. For the most up-to-date pricing, visit the [Baseten Model APIs page](https://www.baseten.co/products/model-apis/). Prices typically range from \$0.10-\$6.00 per million tokens, making Baseten significantly more cost-effective than many closed-model alternatives while providing access to state-of-the-art open-source models.
|
||||
@@ -1,93 +0,0 @@
|
||||
---
|
||||
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:
|
||||
|
||||
- `zai-glm-4.7` - Highly capable general-purpose model on Cerebras (up to 1,000 tokens/s), competitive with leading proprietary models on coding tasks.
|
||||
- `gpt-oss-120b` - Intelligent general purpose model with 3,000 tokens/s
|
||||
- `qwen-3-235b-a22b-instruct-2507` - Advanced instruction-following model
|
||||
|
||||
### 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 131K 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.
|
||||
@@ -1,87 +0,0 @@
|
||||
---
|
||||
title: "Claude Code"
|
||||
description: "Use your Claude Max or Pro subscription with Cline instead of paying per token. Learn how to set up and configure the Claude Code provider."
|
||||
---
|
||||
|
||||
**Website:** [https://docs.anthropic.com/en/docs/claude-code/setup](https://docs.anthropic.com/en/docs/claude-code/setup)
|
||||
|
||||
The Claude Code provider lets you use your existing Claude subscription with Cline. If you have Claude Max or Pro, this means you can use Claude in Cline without paying extra API costs.
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/claude-code-use-opus.gif"
|
||||
alt="Using the Claude Code provider in Cline with Opus model"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
## Setup
|
||||
|
||||
First, you'll need to install and authenticate Claude Code on your system:
|
||||
|
||||
1. **Install Claude Code**: Follow Anthropic's [official setup guide](https://docs.anthropic.com/en/docs/claude-code/setup) to install and authenticate the Claude CLI.
|
||||
|
||||
2. **Configure in Cline**:
|
||||
- Open Cline settings (⚙️ icon)
|
||||
- Select **Claude Code** from the **API Provider** dropdown
|
||||
- Set the path to your Claude CLI executable (usually just `claude` if it's in your PATH)
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/claude-code-setup.gif"
|
||||
alt="Setting up the Claude Code provider in Cline"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
<br />
|
||||
|
||||
### Finding your Claude Code path
|
||||
|
||||
- **macOS / Linux / WSL / Git Bash**: `which claude`
|
||||
- **Windows Command Prompt**: `where claude`
|
||||
|
||||
## Supported Models
|
||||
|
||||
The Claude Code provider supports these models:
|
||||
|
||||
- `claude-sonnet-4-20250514` (Recommended)
|
||||
- `claude-opus-4-7`
|
||||
- `claude-opus-4-1-20250805`
|
||||
- `claude-opus-4-20250514`
|
||||
- `claude-3-7-sonnet-20250219`
|
||||
- `claude-3-5-sonnet-20241022`
|
||||
- `claude-3-5-haiku-20241022`
|
||||
|
||||
## How it works
|
||||
|
||||
When you use Claude Code with Cline, here's what happens behind the scenes:
|
||||
|
||||
Cline wraps the Claude Code CLI to handle your requests. Each time you send a message, Cline starts a new `claude` process, sends your conversation, and streams the response back. The AI reasoning comes from Claude Code, but all the actual file editing, terminal commands, and other tools are handled by Cline.
|
||||
|
||||
The main difference you'll notice is that responses don't stream character-by-character like other providers. Instead, Claude Code processes your full request before sending back the complete response.
|
||||
|
||||
## Limitations
|
||||
|
||||
There are a few things to keep in mind with Claude Code:
|
||||
|
||||
- Images in your messages get converted to text placeholders since Claude Code doesn't support image uploads through the CLI
|
||||
- Prompt caching isn't available with this provider
|
||||
- Responses don't stream in real-time like other providers
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If you run into issues:
|
||||
|
||||
**Authentication problems**: Make sure you're logged into Claude Code with your subscription account. Run `claude auth status` to check.
|
||||
|
||||
**Path issues**: Double-check that the Claude CLI path in Cline's settings is correct. Try running `claude --version` in your terminal to verify it's working.
|
||||
|
||||
**Still having trouble?** We're actively improving this integration. Report issues on our [GitHub](https://github.com/cline/cline/issues) or ask for help in our [Discord](https://discord.gg/cline).
|
||||
|
||||
## Usage with subscriptions
|
||||
|
||||
If you have a Claude Max subscription, your usage in Cline shows up as $0.00 in the billing interface since you're not paying additional API costs. Your usage still counts against your subscription limits, but you won't see per-token charges.
|
||||
|
||||
For more details about using Claude Code with your subscription, check out Anthropic's documentation:
|
||||
|
||||
- [Claude Code Setup Guide](https://docs.anthropic.com/en/docs/claude-code/setup)
|
||||
- [Using Claude Code with Pro/Max Plans](https://support.anthropic.com/en/articles/11145838-using-claude-code-with-your-pro-or-max-plan)
|
||||
@@ -1,33 +1,24 @@
|
||||
---
|
||||
title: "DeepSeek"
|
||||
description: "Learn how to configure and use DeepSeek models like deepseek-chat and deepseek-reasoner with Cline."
|
||||
description: "Learn how to configure and use DeepSeek provider."
|
||||
---
|
||||
|
||||
Cline supports accessing models through the DeepSeek API, including `deepseek-chat` and `deepseek-reasoner`.
|
||||
|
||||
**Website:** [https://platform.deepseek.com/](https://platform.deepseek.com/)
|
||||
|
||||
### Getting an API Key
|
||||
### Get API Credentials
|
||||
|
||||
1. **Sign Up/Sign In:** Go to the [DeepSeek Platform](https://platform.deepseek.com/). Create an account or sign in.
|
||||
2. **Navigate to API Keys:** Find your API keys in the [API keys](https://platform.deepseek.com/api_keys) section of the platform.
|
||||
3. **Create a Key:** Click "Create new API key". 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 DeepSeek models:
|
||||
|
||||
- `deepseek-chat` - General-purpose chat model with 128K context, built-in context caching, and competitive pricing ($0.27/M cache writes, $0.07/M cache reads, $1.10/M output)
|
||||
- `deepseek-reasoner` - Reasoning model with step-by-step thinking capabilities and 128K context ($0.55/M cache writes, $0.14/M cache reads, $2.19/M output)
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
> See [Authorization & Model Selection](/getting-started/authorizing-with-cline#menu).
|
||||
|
||||
1. **Open Cline Settings:** Click the ⚙️ icon in the Cline panel.
|
||||
2. **Select Provider:** Choose "DeepSeek" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your DeepSeek API key into the "DeepSeek API Key" field.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
4. **Select Provider Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Pricing:** Refer to the [DeepSeek Pricing](https://api-docs.deepseek.com/quick_start/pricing/) page for details on model costs.
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
---
|
||||
title: "Dify.ai"
|
||||
description: "Learn how to configure and use Dify.ai workflows with Cline. Connect to Dify's workflow-based AI platform for custom model orchestration."
|
||||
---
|
||||
|
||||
Dify.ai is a workflow-based AI platform that allows you to build and deploy custom AI workflows. When used with Cline, Dify acts as a proxy to your configured workflows - no model selection is needed as models are configured within Dify itself.
|
||||
|
||||
**Website:** [https://dify.ai/](https://dify.ai/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [Dify.ai](https://dify.ai/). Create an account or sign in.
|
||||
2. **Create a Workflow:** Set up your AI workflow with your desired model configuration.
|
||||
3. **Get API Key:** Generate an API key for your workflow.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely.
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Dify.ai" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Dify workflow API key.
|
||||
4. **Enter Base URL:** Configure the Dify API endpoint URL.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **No Model Selection:** Models are configured within Dify workflows, not in Cline.
|
||||
- **Custom Workflows:** Build complex AI pipelines with multiple models and tools.
|
||||
- **Self-Hosted Option:** Dify can be self-hosted for complete control over your AI infrastructure.
|
||||
@@ -1,82 +0,0 @@
|
||||
---
|
||||
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-1-5-pro-256k-250115` (Default) - Pro model with 256K context window ($0.70/$1.30 per 1M tokens)
|
||||
- `doubao-1-5-pro-32k-250115` - Pro model with 32K context window ($0.11/$0.30 per 1M tokens)
|
||||
- `deepseek-v3-250324` - DeepSeek V3 hosted on Doubao (128K context, $0.55/$2.19 per 1M tokens)
|
||||
- `deepseek-r1-250120` - DeepSeek R1 reasoning model hosted on Doubao (64K context, $0.27/$1.09 per 1M tokens)
|
||||
|
||||
### 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.
|
||||
@@ -1,125 +0,0 @@
|
||||
---
|
||||
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
|
||||
|
||||
Cline supports the following Fireworks AI models:
|
||||
|
||||
- `accounts/fireworks/models/kimi-k2p5` (Default) - Kimi K2.5 flagship agentic model with multimodal support (262K context, prompt caching, $0.60/$3.00 per 1M tokens)
|
||||
- `accounts/fireworks/models/qwen3-vl-30b-a3b-thinking` - Qwen3-VL reasoning model with image support (262K context, prompt caching, $0.15/$0.60 per 1M tokens)
|
||||
- `accounts/fireworks/models/qwen3-vl-30b-a3b-instruct` - Qwen3-VL instruct model with image support (262K context, $0.15/$0.60 per 1M tokens)
|
||||
- `accounts/fireworks/models/deepseek-v3p2` - DeepSeek V3.2 model (164K context, prompt caching, $0.56/$1.68 per 1M tokens)
|
||||
- `accounts/fireworks/models/glm-4p7` - GLM-4.7 model (203K context, prompt caching, $0.60/$2.20 per 1M tokens)
|
||||
- `accounts/fireworks/models/glm-5` - GLM-5 model (203K context, prompt caching, $1.00/$3.20 per 1M tokens)
|
||||
- `accounts/fireworks/models/minimax-m2p5` - MiniMax M2.5 model (197K context, prompt caching, $0.30/$1.20 per 1M tokens)
|
||||
- `accounts/fireworks/models/minimax-m2p1` - MiniMax M2.1 model (197K context, prompt caching, $0.30/$1.20 per 1M tokens)
|
||||
- `accounts/fireworks/models/gpt-oss-120b` - OpenAI gpt-oss-120b model (131K context, prompt caching, $0.15/$0.60 per 1M tokens)
|
||||
|
||||
### 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/kimi-k2p5").
|
||||
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.
|
||||
@@ -1,209 +0,0 @@
|
||||
---
|
||||
title: "GCP Vertex AI"
|
||||
description: "Configure GCP Vertex AI with Cline to access leading generative AI models like Claude 3.5 Sonnet v2. This guide covers GCP environment setup, authentication, and secure integration for enterprise teams."
|
||||
---
|
||||
|
||||
### Overview
|
||||
|
||||
**GCP Vertex AI:**\
|
||||
A fully managed service that provides access to leading generative AI models-such as Anthropic's Claude 3.5 Sonnet v2-through Google Cloud.\
|
||||
[Learn more about GCP Vertex AI](https://cloud.google.com/vertex-ai).
|
||||
|
||||
This guide is tailored for organizations with established GCP environments (leveraging IAM roles, service accounts, and best practices in resource management) to ensure secure and compliant usage.
|
||||
|
||||
---
|
||||
|
||||
### Step 1: Prepare Your GCP Environment
|
||||
|
||||
#### 1.1 Create or Use a GCP Project
|
||||
|
||||
- **Sign in to the GCP Console:**\
|
||||
[Google Cloud Console](https://console.cloud.google.com/)
|
||||
- **Select or Create a Project:**\
|
||||
Use an existing project or create a new one dedicated to Vertex AI.
|
||||
|
||||
#### 1.2 Set Up IAM Permissions and Service Accounts
|
||||
|
||||
- **Assign Required Roles:**
|
||||
|
||||
- Grant your user (or service account) the **Vertex AI User** role (`roles/aiplatform.user`)
|
||||
- For service accounts, also attach the **Vertex AI Service Agent** role (`roles/aiplatform.serviceAgent`) to enable certain operations
|
||||
- Consider additional predefined roles as needed:
|
||||
- Vertex AI Platform Express Admin
|
||||
- Vertex AI Platform Express User
|
||||
- Vertex AI Migration Service User
|
||||
|
||||
- **Cross-Project Resource Access:**
|
||||
- For BigQuery tables in different projects, assign the **BigQuery Data Viewer** role
|
||||
- For Cloud Storage buckets in different projects, assign the **Storage Object Viewer** role
|
||||
- For external data sources, refer to the [GCP Vertex AI Access Control documentation](https://cloud.google.com/vertex-ai/docs/general/access-control)
|
||||
|
||||
---
|
||||
|
||||
### Step 2: Verify Regional and Model Access
|
||||
|
||||
#### 2.1 Choose and Confirm a Region
|
||||
|
||||
Vertex AI supports multiple regions. Select a region that meets your latency, compliance, and capacity needs. Examples include:
|
||||
|
||||
- **us-east5 (Columbus, Ohio)**
|
||||
- **us-central1 (Iowa)**
|
||||
- **europe-west1 (Belgium)**
|
||||
- **europe-west4 (Netherlands)**
|
||||
- **asia-southeast1 (Singapore)**
|
||||
- **global (Global)**
|
||||
|
||||
The Global endpoint may offer higher availability and reduce resource exhausted errors. Only Gemini models are supported.
|
||||
|
||||
#### 2.2 Enable the Claude 3.5 Sonnet v2 Model
|
||||
|
||||
- **Open Vertex AI Model Garden:**\
|
||||
In the Cloud Console, navigate to **Vertex AI → Model Garden**
|
||||
- **Enable Claude 3.5 Sonnet v2:**\
|
||||
Locate the model card for Claude 3.5 Sonnet v2 and click **Enable**
|
||||
|
||||
---
|
||||
|
||||
### Step 3: Configure the Cline VS Code Extension
|
||||
|
||||
#### 3.1 Install and Open Cline
|
||||
|
||||
- **Download VS Code:**\
|
||||
[Download Visual Studio Code](https://code.visualstudio.com/)
|
||||
- **Install the Cline Extension:**
|
||||
- Open VS Code
|
||||
- Navigate to the Extensions Marketplace (Ctrl+Shift+X or Cmd+Shift+X)
|
||||
- Search for **Cline** and install the extension
|
||||
|
||||
<Frame>
|
||||
<img
|
||||
src="https://storage.googleapis.com/cline_public_images/docs/assets/cline-extension-arrow.png"
|
||||
alt="Cline extension in VS Code"
|
||||
/>
|
||||
</Frame>
|
||||
|
||||
#### 3.2 Configure Cline Settings
|
||||
|
||||
- **Open Cline Settings:**\
|
||||
Click the settings ⚙️ icon within the Cline extension
|
||||
- **Set API Provider:**\
|
||||
Choose **GCP Vertex AI** from the API Provider dropdown
|
||||
- **Enter Your Google Cloud Project ID:**\
|
||||
Provide the project ID you set up earlier
|
||||
- **Select the Region:**\
|
||||
Choose one of the supported regions (e.g., `us-east5`)
|
||||
- **Select the Model:**\
|
||||
From the available list, choose **Claude 3.5 Sonnet v2**
|
||||
- **Save and Test:**\
|
||||
Save your settings and test by sending a simple prompt (e.g., "Generate a Python function to check if a number is prime.")
|
||||
|
||||
---
|
||||
|
||||
### Step 4: Authentication and Credentials Setup
|
||||
|
||||
#### Option A: Using Your Google Account (User Credentials)
|
||||
|
||||
1. **Install the Google Cloud CLI:**\
|
||||
Follow the [installation guide](https://cloud.google.com/sdk/docs/install)
|
||||
2. **Initialize and Authenticate:**
|
||||
|
||||
```bash
|
||||
gcloud init
|
||||
gcloud auth application-default login
|
||||
```
|
||||
|
||||
- This sets up Application Default Credentials (ADC) using your Google account
|
||||
|
||||
3. **Restart VS Code:**\
|
||||
Ensure VS Code is restarted so that the Cline extension picks up the new credentials
|
||||
|
||||
#### Option B: Using a Service Account (JSON Key)
|
||||
|
||||
1. **Create a Service Account:**
|
||||
|
||||
- In the GCP Console, navigate to **IAM & Admin > Service Accounts**
|
||||
- Create a new service account (e.g., "vertex-ai-client")
|
||||
|
||||
2. **Assign Roles:**
|
||||
|
||||
- Attach **Vertex AI User** (`roles/aiplatform.user`)
|
||||
- Attach **Vertex AI Service Agent** (`roles/aiplatform.serviceAgent`)
|
||||
- Optionally, add other roles as required
|
||||
|
||||
3. **Generate a JSON Key:**
|
||||
|
||||
- In the Service Accounts section, manage keys for your service account and download the JSON key
|
||||
|
||||
4. **Set the Environment Variable:**
|
||||
|
||||
```bash
|
||||
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/service-account-key.json"
|
||||
```
|
||||
|
||||
- This instructs Google Cloud client libraries (and Cline) to use this key
|
||||
|
||||
5. **Restart VS Code:**\
|
||||
Launch VS Code from a terminal where the `GOOGLE_APPLICATION_CREDENTIALS` variable is set
|
||||
|
||||
---
|
||||
|
||||
### Step 5: Security, Monitoring, and Best Practices
|
||||
|
||||
#### 5.1 Enforce Least Privilege
|
||||
|
||||
- **Principle of Least Privilege:**\
|
||||
Only grant the minimum necessary permissions. Custom roles can offer finer control compared to broad predefined roles
|
||||
- **Best Practices:**\
|
||||
Refer to [GCP IAM Best Practices](https://cloud.google.com/iam/docs/best-practices)
|
||||
|
||||
#### 5.2 Manage Resource Access
|
||||
|
||||
- **Project vs. Resource-Level Access:**\
|
||||
Access can be managed at both levels. Note that resource-level permissions (e.g., for BigQuery or Cloud Storage) add to, but do not override, project-level policies
|
||||
|
||||
#### 5.3 Monitor Usage and Quotas
|
||||
|
||||
- **Model Observability Dashboard:**
|
||||
|
||||
- In the Vertex AI Console, navigate to the **Model Observability** dashboard
|
||||
- Monitor metrics such as request throughput, latency, and error rates (including 429 quota errors)
|
||||
|
||||
- **Quota Management:**
|
||||
- If you encounter 429 errors, check the **IAM & Admin > Quotas** page
|
||||
- Request a quota increase if necessary\
|
||||
[Learn more about GCP Vertex AI Quotas](https://cloud.google.com/vertex-ai/docs/quotas)
|
||||
|
||||
#### 5.4 Service Agents and Cross-Project Considerations
|
||||
|
||||
- **Service Agents:**\
|
||||
Be aware of the different service agents:
|
||||
|
||||
- Vertex AI Service Agent
|
||||
- Vertex AI RAG Data Service Agent
|
||||
- Vertex AI Custom Code Service Agent
|
||||
- Vertex AI Extension Service Agent
|
||||
|
||||
- **Cross-Project Access:**\
|
||||
For resources in other projects (e.g., BigQuery, Cloud Storage), ensure that the appropriate roles (BigQuery Data Viewer, Storage Object Viewer) are assigned
|
||||
|
||||
---
|
||||
|
||||
### Conclusion
|
||||
|
||||
By following these steps, your enterprise team can securely integrate GCP Vertex AI with the Cline VS Code extension to harness the power of **Claude 3.5 Sonnet v2**:
|
||||
|
||||
- **Prepare Your GCP Environment:**\
|
||||
Create or use a project, configure IAM with least privilege, and ensure necessary roles (including the Vertex AI Service Agent role) are attached
|
||||
- **Verify Regional and Model Access:**\
|
||||
Confirm that your chosen region supports Claude 3.5 Sonnet v2 and that the model is enabled
|
||||
- **Configure Cline in VS Code:**\
|
||||
Install Cline, enter your project ID, select the appropriate region, and choose the model
|
||||
- **Set Up Authentication:**\
|
||||
Use either user credentials (via `gcloud auth application-default login`) or a service account with a JSON key
|
||||
- **Implement Security and Monitoring:**\
|
||||
Adhere to best practices for IAM, manage resource access carefully, and monitor usage with the Model Observability dashboard
|
||||
|
||||
For further details, please consult the [GCP Vertex AI Documentation](https://cloud.google.com/vertex-ai/docs) and your internal security policies.\
|
||||
Happy coding!
|
||||
|
||||
_This guide will be updated as GCP Vertex AI and Cline evolve. Always refer to the latest documentation for current practices._
|
||||
@@ -1,69 +1,28 @@
|
||||
---
|
||||
title: "Google Gemini"
|
||||
description: "Learn how to configure and use Google Gemini models with Cline. Access Gemini 3, 2.5, and 2.0 series models with large context windows and multimodal capabilities."
|
||||
description: "Learn how to configure and use Google Gemini with Cline."
|
||||
---
|
||||
|
||||
Google Gemini is Google's family of multimodal AI models, offering some of the largest context windows available and strong performance across coding, reasoning, and document analysis tasks.
|
||||
|
||||
**Website:** [https://ai.google.dev/](https://ai.google.dev/)
|
||||
|
||||
### Getting an API Key
|
||||
### Get API Credentials
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [Google AI Studio](https://aistudio.google.com/). Sign in with your Google account.
|
||||
2. **Get API Key:** Navigate to [aistudio.google.com/apikey](https://aistudio.google.com/apikey).
|
||||
3. **Create a Key:** Click "Create API Key" and select or create a Google Cloud project.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following Google Gemini models:
|
||||
|
||||
#### Gemini 3 Series (Latest)
|
||||
- `gemini-3.1-pro-preview` (Default) - Latest pro model with 1M context, thinking support, and tiered pricing ($2.00-$4.00/M input)
|
||||
- `gemini-3-flash-preview` - Fast model with 1M context and thinking level support ($0.30-$0.50/M input)
|
||||
|
||||
#### Gemini 2.5 Series
|
||||
- `gemini-2.5-pro` - High-performance model with 1M context and thinking budget ($1.25-$2.50/M input)
|
||||
- `gemini-2.5-flash` - Fast and affordable with 1M context and thinking support ($0.30/M input)
|
||||
- `gemini-2.5-flash-lite-preview-06-17` - Ultra-affordable lite variant ($0.10/M input)
|
||||
|
||||
#### Gemini 2.0 Series
|
||||
- `gemini-2.0-flash-001` - Fast model with 1M context and prompt caching ($0.10/M input)
|
||||
- `gemini-2.0-flash-lite-preview-02-05` - Lite variant (free during preview)
|
||||
- `gemini-2.0-pro-exp-02-05` - Pro experimental with 2M context (free during preview)
|
||||
- `gemini-2.0-flash-thinking-exp-01-21` - Thinking experimental with 1M context (free)
|
||||
- `gemini-2.0-flash-thinking-exp-1219` - Earlier thinking experimental (free)
|
||||
- `gemini-2.0-flash-exp` - Flash experimental with 1M context (free)
|
||||
|
||||
#### Gemini 1.5 Series (Legacy)
|
||||
- `gemini-1.5-flash-002` - Fast model with tiered pricing and prompt caching
|
||||
- `gemini-1.5-flash-exp-0827` - Flash experimental (free)
|
||||
- `gemini-1.5-flash-8b-exp-0827` - Compact 8B flash (free)
|
||||
- `gemini-1.5-pro-002` - Pro model with 2M context
|
||||
- `gemini-1.5-pro-exp-0827` - Pro experimental (free)
|
||||
- `gemini-exp-1206` - Experimental with 2M context (free)
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
> See [Authorization & Model Selection](/getting-started/authorizing-with-cline#menu).
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Google Gemini" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Google AI API key into the "Gemini API Key" field.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Thinking / Reasoning Support
|
||||
|
||||
Gemini 3 and 2.5 models support thinking/reasoning capabilities:
|
||||
|
||||
- **Gemini 3 Pro/Flash:** Support thinking levels (`low`, `high`) that control reasoning depth
|
||||
- **Gemini 2.5 Pro/Flash:** Support thinking budgets that cap the number of thinking tokens
|
||||
|
||||
Enable extended thinking in Cline settings to leverage these capabilities for complex coding and reasoning tasks.
|
||||
4. **Select Provider Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Large Context Windows:** Gemini models offer up to 2M token context windows, making them excellent for large codebases and document analysis.
|
||||
- **Prompt Caching:** Gemini 2.5+ and select 2.0 models support prompt caching for reduced costs on repeated queries.
|
||||
- **Image Support:** All Gemini models support image inputs for multimodal tasks.
|
||||
- **Tiered Pricing:** Some models have tiered pricing based on context usage (e.g., lower prices under 200K tokens).
|
||||
- **Free Experimental Models:** Many experimental models are available at no cost during their preview period.
|
||||
- **Pricing:** Refer to the [Google AI pricing page](https://ai.google.dev/gemini-api/docs/models/gemini) for the latest information.
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
---
|
||||
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:
|
||||
|
||||
#### Featured Models
|
||||
- `moonshotai/kimi-k2-instruct-0905` (Default) - Kimi K2 September update with 262K context and prompt caching ($0.60/$2.50 per 1M tokens)
|
||||
- `moonshotai/kimi-k2-instruct` - Kimi K2 1T parameter model with prompt caching ($1.00/$3.00 per 1M tokens)
|
||||
- `openai/gpt-oss-120b` - OpenAI's 120B open-weight MoE model ($0.15/$0.75 per 1M tokens)
|
||||
- `openai/gpt-oss-20b` - OpenAI's compact 20B open-weight model ($0.10/$0.50 per 1M tokens)
|
||||
|
||||
#### Compound Models
|
||||
- `compound-beta` - Hybrid architecture using Llama 4 Scout + Llama 3.3 70B for routing and tool use (free)
|
||||
- `compound-beta-mini` - Lightweight compound model for faster inference (free)
|
||||
|
||||
#### Meta Llama Models
|
||||
- `meta-llama/llama-4-maverick-17b-128e-instruct` - Llama 4 Maverick with 128 experts and vision support ($0.20/$0.60 per 1M tokens)
|
||||
- `meta-llama/llama-4-scout-17b-16e-instruct` - Llama 4 Scout with 16 experts and vision support ($0.11/$0.34 per 1M tokens)
|
||||
- `llama-3.3-70b-versatile` - Balanced performance with 131K context ($0.59/$0.79 per 1M tokens)
|
||||
- `llama-3.1-8b-instant` - Fast inference with 131K context ($0.05/$0.08 per 1M tokens)
|
||||
|
||||
#### Reasoning Models
|
||||
- `deepseek-r1-distill-llama-70b` - DeepSeek R1 reasoning distilled into Llama 70B ($0.75/$0.99 per 1M tokens)
|
||||
|
||||
### 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.
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
title: "Hicap"
|
||||
description: "Learn how to configure and use Hicap with Cline. Access AI models through the Hicap platform."
|
||||
---
|
||||
|
||||
[Hicap](https://hicap.ai) provides AI model access through an OpenAI-compatible API with support for images and prompt caching.
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to the [Hicap platform](https://hicap.ai). Create an account or sign in.
|
||||
2. **Navigate to API Keys:** Access the API key section.
|
||||
3. **Create a Key:** Generate a new API key.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely.
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Hicap" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Hicap API key.
|
||||
4. **Enter Model ID:** Specify the model you want to use.
|
||||
5. **Configure Settings:** Optionally set context window size and max output tokens.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Image Support:** Hicap models support image inputs by default.
|
||||
- **Prompt Caching:** Built-in prompt caching support for reduced costs.
|
||||
- **128K Context:** Default 128K token context window.
|
||||
@@ -1,38 +0,0 @@
|
||||
---
|
||||
title: "Huawei Cloud MaaS"
|
||||
description: "Learn how to configure and use Huawei Cloud Model-as-a-Service with Cline. Access DeepSeek and Qwen models through Huawei's cloud infrastructure."
|
||||
---
|
||||
|
||||
Huawei Cloud MaaS (Model-as-a-Service) provides access to popular AI models including DeepSeek and Qwen through Huawei's cloud infrastructure.
|
||||
|
||||
**Website:** [https://www.huaweicloud.com/](https://www.huaweicloud.com/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [Huawei Cloud](https://www.huaweicloud.com/). Create an account or sign in.
|
||||
2. **Navigate to MaaS:** Access the Model-as-a-Service section.
|
||||
3. **Create Credentials:** Generate API credentials for your application.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following Huawei Cloud MaaS models:
|
||||
|
||||
- `DeepSeek-V3` (Default) - General-purpose model with 64K context ($0.27/$1.10 per 1M tokens)
|
||||
- `DeepSeek-R1` - Reasoning model with thinking support ($0.55/$2.20 per 1M tokens)
|
||||
- `deepseek-r1-250528` - Latest DeepSeek R1 version with thinking ($0.55/$2.20 per 1M tokens)
|
||||
- `qwen3-235b-a22b` - Qwen3 235B MoE with thinking support ($0.27/$1.10 per 1M tokens)
|
||||
- `qwen3-32b` - Qwen3 32B dense model with thinking ($0.27/$1.10 per 1M tokens)
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Huawei Cloud MaaS" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Huawei Cloud API key.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Thinking Support:** DeepSeek R1 and Qwen3 models support extended thinking for complex reasoning tasks.
|
||||
- **Regional Service:** Optimized for users in regions served by Huawei Cloud.
|
||||
- **Pricing:** Check the Huawei Cloud console for current pricing information.
|
||||
@@ -1,41 +0,0 @@
|
||||
---
|
||||
title: "Hugging Face"
|
||||
description: "Learn how to configure and use Hugging Face Inference Providers with Cline. Access open-source models with free inference through the Hugging Face ecosystem."
|
||||
---
|
||||
|
||||
Hugging Face provides inference access to popular open-source models through their Inference Providers ecosystem. Many models are available for free, making it an excellent option for experimentation and budget-conscious development.
|
||||
|
||||
**Website:** [https://huggingface.co/](https://huggingface.co/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [Hugging Face](https://huggingface.co/). Create an account or sign in.
|
||||
2. **Navigate to Settings:** Go to your [Access Tokens](https://huggingface.co/settings/tokens) page.
|
||||
3. **Create a Token:** Generate a new access token with appropriate permissions.
|
||||
4. **Copy the Token:** Copy the token immediately and store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following Hugging Face models (all currently free):
|
||||
|
||||
- `moonshotai/Kimi-K2-Instruct` (Default) - Advanced reasoning model with 131K context, superior coding and math capabilities
|
||||
- `openai/gpt-oss-120b` - Large 120B open-weight reasoning model for complex tasks (131K context)
|
||||
- `openai/gpt-oss-20b` - Medium 20B open-weight model balancing reasoning with accessibility (131K context)
|
||||
- `deepseek-ai/DeepSeek-V3-0324` - Advanced reasoning model (64K context)
|
||||
- `deepseek-ai/DeepSeek-R1` - DeepSeek's reasoning model with step-by-step thinking (64K context)
|
||||
- `deepseek-ai/DeepSeek-R1-0528` - Latest DeepSeek reasoning version (64K context)
|
||||
- `meta-llama/Llama-3.1-8B-Instruct` - Efficient 8B Llama model for general tasks (128K context)
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Hugging Face" from the "API Provider" dropdown.
|
||||
3. **Enter Token:** Paste your Hugging Face access token.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Free Inference:** All listed models are currently available at no cost through Hugging Face Inference Providers.
|
||||
- **Open Source:** All models are open-source and can also be self-hosted.
|
||||
- **Rate Limits:** Free tier has rate limits. Check Hugging Face documentation for current limits.
|
||||
- **Model Availability:** Model availability depends on inference provider capacity and may vary.
|
||||
@@ -1,65 +0,0 @@
|
||||
---
|
||||
title: "LiteLLM & Cline (using Codestral)"
|
||||
description: "Learn how to set up and run LiteLLM with Cline using the Codestral model. This guide covers Docker setup, configuration, and integration with Cline."
|
||||
---
|
||||
|
||||
### Using LiteLLM with Cline
|
||||
|
||||
This guide demonstrates how to run a demo for LiteLLM starting with the Codestral model for use with Cline.
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
- [Docker CLI or Docker Desktop](https://www.docker.com/get-started/) installed to run the LiteLLM image locally
|
||||
- For this example config: A Codestral API Key (different from the Mistral API Keys)
|
||||
|
||||
#### Setup
|
||||
|
||||
1. **Create a `.env` file and fill in the appropriate field**
|
||||
|
||||
```bash
|
||||
# Tip: Use the following command to generate a random alphanumeric key:
|
||||
# openssl rand -base64 32 | tr -dc 'A-Za-z0-9' | head -c 32
|
||||
LITELLM_MASTER_KEY=YOUR_LITELLM_MASTER_KEY
|
||||
CODESTRAL_API_KEY=YOUR_CODESTRAL_API_KEY
|
||||
```
|
||||
|
||||
_Note: Although this is limited to localhost, it's a good practice set LITELLM_MASTER_KEY to something secure_
|
||||
|
||||
2. **Configuration**
|
||||
|
||||
We'll need to create a `config.yaml` file to contain our LiteLLM configuration. In this case we'll just have one model, 'codestral-latest' and label it 'codestral'
|
||||
|
||||
```yaml
|
||||
model_list:
|
||||
- model_name: codestral
|
||||
litellm_params:
|
||||
model: codestral/codestral-latest
|
||||
api_key: os.environ/CODESTRAL_API_KEY
|
||||
```
|
||||
|
||||
#### Running the Demo
|
||||
|
||||
1. **Startup the LiteLLM docker container**
|
||||
|
||||
```bash
|
||||
docker run \
|
||||
--env-file .env \
|
||||
-v $(pwd)/config.yaml:/app/config.yaml \
|
||||
-p 127.0.0.1:4000:4000 \
|
||||
ghcr.io/berriai/litellm:main-latest \
|
||||
--config /app/config.yaml --detailed_debug
|
||||
```
|
||||
|
||||
2. **Setup Cline**
|
||||
|
||||
Once the LiteLLM server is up and running you can set it up in Cline:
|
||||
|
||||
- Base URL should be `http://0.0.0.0:4000/v1`
|
||||
- API Key should be the one you set in `.env` for LITELLM_MASTER_KEY
|
||||
- Model ID is `codestral` or whatever you named it under `config.yaml`
|
||||
|
||||
#### Getting Help
|
||||
|
||||
- [LiteLLM Documentation](https://docs.litellm.ai/)
|
||||
- [Mistral AI Console](https://console.mistral.ai/)
|
||||
- [Cline Discord Community](https://discord.gg/cline)
|
||||
@@ -1,41 +1,30 @@
|
||||
---
|
||||
title: "MiniMax"
|
||||
description: "Learn how to configure and use MiniMax models with Cline. Access MiniMax-M2 series models with large context windows, prompt caching, and reasoning support."
|
||||
description: "Learn how to configure and use MiniMax provider with Cline.."
|
||||
---
|
||||
|
||||
MiniMax provides AI models with large context windows and competitive pricing, featuring the MiniMax-M2 series.
|
||||
|
||||
**Website:** [https://www.minimax.io/](https://www.minimax.io/)
|
||||
|
||||
### Getting an API Key
|
||||
### Get API Credentials
|
||||
|
||||
1. **Sign Up/Sign In:** Go to the [MiniMax Platform](https://www.minimax.io/platform). Create an account or sign in.
|
||||
2. **Navigate to API Keys:** Access the API key section.
|
||||
3. **Create a Key:** Generate a new API key.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following MiniMax models:
|
||||
|
||||
- `MiniMax-M2.7` (Default) - Latest flagship model with enhanced reasoning and coding, 192K context, prompt caching, and reasoning/thinking support ($0.30/$1.20 per 1M tokens)
|
||||
- `MiniMax-M2.7-highspeed` - High-speed version of M2.7 for low-latency scenarios ($0.60/$2.40 per 1M tokens)
|
||||
- `MiniMax-M2.5` - Previous flagship with 192K context, prompt caching, and reasoning support ($0.30/$1.20 per 1M tokens)
|
||||
- `MiniMax-M2.5-highspeed` - High-speed version of M2.5 ($0.60/$2.40 per 1M tokens)
|
||||
- `MiniMax-M2.1` - Earlier generation with 192K context and prompt caching ($0.30/$1.20 per 1M tokens)
|
||||
- `MiniMax-M2.1-lightning` - Fast variant with higher output pricing ($0.60/$2.40 per 1M tokens)
|
||||
- `MiniMax-M2` - Earlier generation with 192K context ($0.30/$1.20 per 1M tokens)
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
> See [Authorization & Model Selection](/getting-started/authorizing-with-cline#menu).
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "MiniMax" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your MiniMax API key.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
4. **Select Provider Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Large Context:** All models support 192K token context windows.
|
||||
- **Reasoning Support:** M2.7 and M2.5 support extended thinking/reasoning for complex tasks.
|
||||
- **Prompt Caching:** M2.7 (including highspeed), M2.5 (including highspeed), and M2.1 models support prompt caching for reduced costs on repeated queries.
|
||||
- **Pricing:** Check the [MiniMax pricing page](https://www.minimax.io/platform/document/pricing) for current rates.
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
---
|
||||
title: "Mistral"
|
||||
description: "Learn how to configure and use Mistral AI models, including Codestral, with Cline. Covers API key setup and model selection."
|
||||
---
|
||||
|
||||
Cline supports accessing models through the Mistral AI API, including both standard Mistral models and the code-specialized Codestral model.
|
||||
|
||||
**Website:** [https://mistral.ai/](https://mistral.ai/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to the [Mistral Platform](https://console.mistral.ai/). Create an account or sign in. You may need to go through a verification process.
|
||||
2. **Create an API Key:**
|
||||
- [La Plateforme API Key](https://console.mistral.ai/api-keys/) and/or
|
||||
- [Codestral API Key](https://console.mistral.ai/codestral)
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following Mistral models:
|
||||
|
||||
#### Devstral (Code-Specialized)
|
||||
- `devstral-2512` (Default) - Latest Devstral with 256K context window, free tier
|
||||
- `labs-devstral-small-2512` - Small Devstral variant with 256K context, free tier
|
||||
- `devstral-small-2505` - Previous Devstral small release (131K context)
|
||||
- `devstral-medium-latest` - Medium Devstral for more complex tasks (131K context)
|
||||
|
||||
#### Mistral Large & Medium
|
||||
- `mistral-large-2512` - Latest large model with 256K context ($0.50/$1.50 per 1M tokens)
|
||||
- `mistral-large-2411` - Previous large model (128K context)
|
||||
- `mistral-medium-latest` - Medium model balancing performance and cost (128K context)
|
||||
|
||||
#### Mistral Small & Ministral
|
||||
- `mistral-small-latest` - Small model with image support (128K context)
|
||||
- `mistral-small-2501` - Dated small model release (32K context)
|
||||
- `ministral-14b-2512` - 14B parameter model with 256K context
|
||||
- `ministral-3b-2410` - Ultra-compact 3B model (128K context)
|
||||
- `ministral-8b-2410` - Compact 8B model (128K context)
|
||||
|
||||
#### Pixtral (Vision)
|
||||
- `pixtral-large-2411` - Large vision model with image support (131K context)
|
||||
- `pixtral-12b-2409` - Compact vision model (128K context)
|
||||
|
||||
#### Codestral & Open Models
|
||||
- `codestral-2501` - Code-specialized model with 256K context
|
||||
- `open-codestral-mamba` - Open-source Mamba architecture (256K context)
|
||||
- `open-mistral-nemo-2407` - Open-source Nemo model (128K context)
|
||||
|
||||
**Note:** Model availability and specifications may change.
|
||||
Refer to the [Mistral AI documentation](https://docs.mistral.ai/api/) and [Mistral Model Overview](https://docs.mistral.ai/getting-started/models/models_overview/) for the most current information.
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Mistral" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Mistral API key into the "Mistral API Key" field if you're using a standard `mistral` model. If you intend to use `codestral-latest`, see the "Using Codestral" section below.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Using Codestral
|
||||
|
||||
[Codestral](https://docs.mistral.ai/capabilities/code_generation/) is a model specifically designed for code generation and interaction.
|
||||
For Codestral, you can use different endpoints (Default: codestral.mistral.ai).
|
||||
If using the La Plateforme API Key for Codestral, change the **Codestral Base Url** to: `https://api.mistral.ai`
|
||||
|
||||
To use Codestral with Cline:
|
||||
|
||||
1. **Select "Mistral" as the API Provider in Cline Settings.**
|
||||
2. **Select a Codestral Model** (e.g., `codestral-latest`) from the "Model" dropdown.
|
||||
3. **Enter your Codestral API Key** (from `codestral.mistral.ai`) or your La Plateforme API Key (from `api.mistral.ai`) into the appropriate API key field in Cline.
|
||||
@@ -1,40 +0,0 @@
|
||||
---
|
||||
title: "Moonshot"
|
||||
description: "Learn how to configure and use Moonshot AI's Kimi K2 models with Cline. Access state-of-the-art MoE models with large context windows."
|
||||
---
|
||||
|
||||
Moonshot AI is the company behind the Kimi series of models, featuring the Kimi K2 with 1 trillion total parameters. These models excel at agentic coding, reasoning, and general-purpose tasks.
|
||||
|
||||
**Website:** [https://platform.moonshot.ai/](https://platform.moonshot.ai/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [Moonshot AI Platform](https://platform.moonshot.ai/). Create an account or sign in.
|
||||
2. **Navigate to API Keys:** Access the API key management section.
|
||||
3. **Create a Key:** Generate a new API key.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following Moonshot models:
|
||||
|
||||
- `kimi-k2.5` - Latest model with 262K context, vision support, and prompt caching ($0.60/$3.00 per 1M tokens)
|
||||
- `kimi-k2-0905-preview` (Default) - September update with 262K context ($0.60/$2.50 per 1M tokens)
|
||||
- `kimi-k2-0711-preview` - July update with 131K context ($0.60/$2.50 per 1M tokens)
|
||||
- `kimi-k2-turbo-preview` - High-performance turbo variant with 262K context ($2.40/$10.00 per 1M tokens)
|
||||
- `kimi-k2-thinking` - Reasoning model with step-by-step thinking (262K context, $0.60/$2.50 per 1M tokens)
|
||||
- `kimi-k2-thinking-turbo` - Fast reasoning variant (262K context, $2.40/$10.00 per 1M tokens)
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Moonshot" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Moonshot API key into the "Moonshot API Key" field.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Large Context:** Models support up to 262K token context windows for extensive codebases.
|
||||
- **Thinking Models:** The `kimi-k2-thinking` variants provide step-by-step reasoning for complex tasks.
|
||||
- **Prompt Caching:** Kimi K2.5 supports prompt caching with significant cost savings on cached reads.
|
||||
- **Pricing:** Refer to the [Moonshot pricing page](https://platform.moonshot.ai/docs/pricing/chat) for current rates.
|
||||
@@ -1,58 +0,0 @@
|
||||
---
|
||||
title: "Nebius AI Studio"
|
||||
description: "Learn how to configure and use Nebius AI Studio with Cline. Access DeepSeek, Qwen, Llama, and other open-source models with competitive pricing."
|
||||
---
|
||||
|
||||
Nebius AI Studio provides inference for a wide range of open-source models including DeepSeek, Qwen, Llama, and others, with competitive pricing and fast/standard speed tiers.
|
||||
|
||||
**Website:** [https://studio.nebius.com/](https://studio.nebius.com/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to [Nebius AI Studio](https://studio.nebius.com/). Create an account or sign in.
|
||||
2. **Navigate to API Keys:** Access the API key section in your dashboard.
|
||||
3. **Create a Key:** Generate a new API key.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following Nebius models:
|
||||
|
||||
#### DeepSeek Models
|
||||
- `deepseek-ai/DeepSeek-V3` - General-purpose model ($0.50/$1.50 per 1M tokens)
|
||||
- `deepseek-ai/DeepSeek-V3-0324-fast` - Fast variant ($2.00/$6.00 per 1M tokens)
|
||||
- `deepseek-ai/DeepSeek-R1` - Reasoning model ($0.80/$2.40 per 1M tokens)
|
||||
- `deepseek-ai/DeepSeek-R1-fast` - Fast reasoning ($2.00/$6.00 per 1M tokens)
|
||||
- `deepseek-ai/DeepSeek-R1-0528` - Latest reasoning version (163K context, $0.80/$2.40 per 1M tokens)
|
||||
- `deepseek-ai/DeepSeek-R1-0528-fast` - Fast latest reasoning ($2.00/$6.00 per 1M tokens)
|
||||
|
||||
#### Qwen Models
|
||||
- `Qwen/Qwen3-Coder-480B-A35B-Instruct` - 480B coding model (262K context, $0.40/$1.80 per 1M tokens)
|
||||
- `Qwen/Qwen3-235B-A22B` - 235B MoE model ($0.20/$0.60 per 1M tokens)
|
||||
- `Qwen/Qwen3-235B-A22B-Instruct-2507` - Latest instruct version (262K context, $0.20/$0.60 per 1M tokens)
|
||||
- `Qwen/Qwen3-32B` / `Qwen/Qwen3-32B-fast` - Dense 32B model
|
||||
- `Qwen/Qwen3-30B-A3B` / `Qwen/Qwen3-30B-A3B-fast` - Compact MoE model
|
||||
- `Qwen/Qwen3-4B-fast` - Small fast model ($0.08/$0.24 per 1M tokens)
|
||||
- `Qwen/Qwen2.5-Coder-32B-Instruct-fast` - Coding-optimized ($0.10/$0.30 per 1M tokens)
|
||||
- `Qwen/Qwen2.5-32B-Instruct-fast` (Default) - General-purpose ($0.13/$0.40 per 1M tokens)
|
||||
|
||||
#### Other Models
|
||||
- `moonshotai/Kimi-K2-Instruct` - Kimi K2 with prompt caching (131K context, $0.50/$2.40 per 1M tokens)
|
||||
- `openai/gpt-oss-120b` - OpenAI's 120B open-weight model ($0.15/$0.60 per 1M tokens)
|
||||
- `openai/gpt-oss-20b` - OpenAI's 20B open-weight model ($0.05/$0.20 per 1M tokens)
|
||||
- `zai-org/GLM-4.5` / `zai-org/GLM-4.5-Air` - Z AI models with prompt caching
|
||||
- `meta-llama/Llama-3.3-70B-Instruct-fast` - Fast Llama 3.3 ($0.25/$0.75 per 1M tokens)
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Nebius AI Studio" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your Nebius API key.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Speed Tiers:** Models with `-fast` suffix offer faster inference at higher prices.
|
||||
- **Wide Selection:** Access models from DeepSeek, Qwen, Meta, Moonshot, OpenAI, and Z AI.
|
||||
- **Competitive Pricing:** Generally lower prices than direct provider APIs.
|
||||
- **Pricing:** Check the [Nebius documentation](https://docs.nebius.com/studio/inference/models) for current rates.
|
||||
@@ -1,35 +0,0 @@
|
||||
---
|
||||
title: "NousResearch"
|
||||
description: "Learn how to configure and use NousResearch's Hermes 4 models with Cline. Access advanced reasoning models optimized for creative depth and complex tasks."
|
||||
---
|
||||
|
||||
NousResearch provides the Hermes 4 family of models, focused on advanced reasoning and creative depth rather than optimizing purely for inference speed.
|
||||
|
||||
**Website:** [https://nousresearch.com/](https://nousresearch.com/)
|
||||
|
||||
### Getting an API Key
|
||||
|
||||
1. **Sign Up/Sign In:** Go to the NousResearch inference platform. Create an account or sign in.
|
||||
2. **Navigate to API Keys:** Access the API key section.
|
||||
3. **Create a Key:** Generate a new API key.
|
||||
4. **Copy the Key:** Copy the API key immediately and store it securely.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline supports the following NousResearch models:
|
||||
|
||||
- `Hermes-4-405B` (Default) - Largest Hermes 4 model focused on advanced reasoning and creative depth (128K context, $0.09/$0.37 per 1M tokens)
|
||||
- `Hermes-4-70B` - Balanced model for complex reasoning while staying fast and cost-effective (128K context, $0.05/$0.20 per 1M tokens)
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "NousResearch" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your NousResearch API key.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Reasoning Focus:** Hermes 4 models are designed for advanced reasoning and creative depth.
|
||||
- **Competitive Pricing:** Very affordable pricing for large parameter models.
|
||||
- **128K Context:** Both models support 128K token context windows.
|
||||
@@ -1,105 +0,0 @@
|
||||
---
|
||||
title: "OpenAI Codex"
|
||||
sidebarTitle: "OpenAI Codex"
|
||||
description: "Connect your OpenAI account to Cline via OAuth for seamless access to OpenAI models."
|
||||
---
|
||||
|
||||
OpenAI Codex lets you connect your OpenAI account directly to Cline using OAuth, meaning you don't need to manage API keys. Simply sign in with your OpenAI account through a one-click browser authentication, and you'll automatically have access to all the models available on your OpenAI plan. No additional configuration required.
|
||||
|
||||
<Tip>
|
||||
If you prefer to use API keys instead, see the [OpenAI (API Key)](/provider-config/openai) provider configuration.
|
||||
</Tip>
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- An [OpenAI account](https://platform.openai.com/signup)
|
||||
- An active OpenAI subscription or API access plan
|
||||
|
||||
<Note>
|
||||
The models available to you depend on your OpenAI account's subscription tier. See [OpenAI's pricing page](https://openai.com/pricing) for details on what's included in each plan.
|
||||
</Note>
|
||||
|
||||
## Connecting Your OpenAI Account
|
||||
|
||||
<Steps>
|
||||
<Step title="Open Cline Settings">
|
||||
Click the settings gear icon in the top-right corner of the Cline extension.
|
||||
</Step>
|
||||
<Step title="Select OpenAI Codex Provider">
|
||||
Choose **"OpenAI Codex"** from the "API Provider" dropdown menu.
|
||||
</Step>
|
||||
<Step title="Sign In with OpenAI">
|
||||
Click the **"Sign in with OpenAI"** button. This will open a browser window for authentication.
|
||||
</Step>
|
||||
<Step title="Authorize Cline">
|
||||
In the browser window that opens:
|
||||
1. Sign in to your OpenAI account (if not already signed in)
|
||||
2. Review the permissions Cline is requesting
|
||||
3. Click **"Authorize"** to grant access
|
||||
</Step>
|
||||
<Step title="Select Your Model">
|
||||
Once authorized, you'll be returned to Cline. Choose your desired model from the **"Model"** dropdown.
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
<Note>
|
||||
If a model doesn't appear in your dropdown, it may not be available on your OpenAI subscription tier.
|
||||
</Note>
|
||||
|
||||
For the most current list of available models and their capabilities, see the official [OpenAI Models documentation](https://platform.openai.com/docs/models).
|
||||
|
||||
## Managing Your Connection
|
||||
|
||||
### Disconnecting Your Account
|
||||
|
||||
To disconnect your OpenAI account from Cline:
|
||||
|
||||
1. Open Cline Settings
|
||||
2. With OpenAI Codex selected as the provider, click **"Sign out"**
|
||||
3. Confirm the disconnection
|
||||
|
||||
This removes the OAuth connection. You can reconnect at any time by signing in again.
|
||||
|
||||
### Token Refresh
|
||||
|
||||
OAuth tokens are automatically refreshed by Cline. If you encounter authentication errors:
|
||||
|
||||
1. Try disconnecting and reconnecting your account
|
||||
2. Ensure your OpenAI account is in good standing
|
||||
3. Check that your subscription is active
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### "Authentication failed" error
|
||||
|
||||
- Ensure you're signing in with the correct OpenAI account
|
||||
- Check that your OpenAI subscription is active
|
||||
- Try clearing your browser cache and signing in again
|
||||
|
||||
### Models not appearing
|
||||
|
||||
- The available models depend on your OpenAI subscription tier
|
||||
- Some models may require specific plan upgrades
|
||||
- Check [OpenAI's pricing page](https://openai.com/pricing) for model availability by plan
|
||||
|
||||
### OAuth window doesn't open
|
||||
|
||||
- Check if pop-ups are blocked in your browser
|
||||
- Try using a different browser
|
||||
- Ensure you have a stable internet connection
|
||||
|
||||
### Connection keeps expiring
|
||||
|
||||
- This is rare but can happen if your OpenAI account session expired
|
||||
- Disconnect and reconnect to refresh your authentication
|
||||
|
||||
## Good to Know
|
||||
|
||||
Cline only requests the permissions necessary to make API calls on your behalf. Your OpenAI credentials are never stored by Cline.
|
||||
|
||||
When using OpenAI Codex, Cline accesses models through your OpenAI/ChatGPT subscription. There is no separate per-token API billing or consumption of OpenAI API credits for this provider; usage and limits are governed by your ChatGPT (or OpenAI account) subscription plan, not by Cline.
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [OpenAI (API Key)](/provider-config/openai): Alternative configuration using API keys
|
||||
- [Model Selection Guide](/core-features/model-selection-guide): Help choosing the right model
|
||||
@@ -34,19 +34,6 @@ You'll find these settings in the Cline settings panel (click the ⚙️ icon):
|
||||
- Input Price (per token/million tokens)
|
||||
- Output Price (per token/million tokens)
|
||||
|
||||
### Supported Models (for OpenAI Native Endpoint)
|
||||
|
||||
While the "OpenAI Compatible" provider type allows connecting to various endpoints, if you are connecting directly to the official OpenAI API (or an endpoint that mirrors it exactly), Cline recognizes the following model IDs based on the `openAiNativeModels` definition in its source code:
|
||||
|
||||
- `o3-mini`
|
||||
- `o3-mini-high`
|
||||
- `o3-mini-low`
|
||||
- `o1`
|
||||
- `o1-preview`
|
||||
- `o1-mini`
|
||||
- `gpt-4o`
|
||||
- `gpt-4o-mini`
|
||||
|
||||
**Note:** If you are using a different OpenAI-compatible provider (such as Together AI, Anyscale, etc.), the available model IDs will differ. Always refer to your specific provider's documentation for their supported model names and any unique configuration details.
|
||||
|
||||
### v0 (Vercel SDK) in Cline:
|
||||
|
||||
@@ -1,63 +1,48 @@
|
||||
---
|
||||
title: "OpenAI"
|
||||
description: "Learn how to configure and use official OpenAI models with Cline."
|
||||
title: "OpenAI (Codex)"
|
||||
description: "Configure OpenAI with API key or OpenAI Codex OAuth in Cline."
|
||||
---
|
||||
|
||||
Cline supports accessing models directly through the official OpenAI API.
|
||||
|
||||
## Choose an OpenAI Path
|
||||
|
||||
- **[OpenAI API (key-based)](#get-api-credentials):** Use your OpenAI API key.
|
||||
- **[OpenAI Codex (Subscription OAuth)](#openai-codex-oauth):** Sign in with OpenAI account, using OAI subscriptions (no key management).
|
||||
|
||||
**Website:** [https://openai.com/](https://openai.com/)
|
||||
|
||||
### Getting an API Key
|
||||
## OpenAI API (key-based)
|
||||
|
||||
### Get API Credentials
|
||||
|
||||
1. **Sign Up/Sign In:** Visit the [OpenAI Platform](https://platform.openai.com/). You'll need to create an account or sign in if you already have one.
|
||||
2. **Navigate to API Keys:** Once logged in, go to the [API keys section](https://platform.openai.com/api-keys) of your account.
|
||||
3. **Create a Key:** Click on "Create new secret key". It's good practice to give your key a descriptive name (e.g., "Cline API Key").
|
||||
4. **Copy the Key:** **Crucial:** Copy the generated API key immediately. For security reasons, OpenAI will not show it to you again. Store this key in a safe and secure location.
|
||||
|
||||
### Supported Models
|
||||
|
||||
Cline is compatible with a variety of OpenAI models, including the latest frontier and reasoning models:
|
||||
|
||||
#### GPT-5 Series
|
||||
- `gpt-5.2` (Default) - Latest flagship model with reasoning support
|
||||
- `gpt-5.2-codex` - Codex variant using Responses API (400K context)
|
||||
- `gpt-5.1` - Previous GPT-5 generation
|
||||
- `gpt-5.1-2025-11-13` - Dated snapshot of GPT-5.1
|
||||
- `gpt-5.1-codex` - Codex variant using Responses API
|
||||
- `gpt-5.1-chat-latest` - Chat-optimized variant (400K context)
|
||||
- `gpt-5-2025-08-07` - Original GPT-5 release
|
||||
- `gpt-5-codex` - GPT-5 Codex variant
|
||||
- `gpt-5-mini-2025-08-07` - Compact, cost-effective GPT-5
|
||||
- `gpt-5-nano-2025-08-07` - Ultra-compact GPT-5 for budget use
|
||||
- `gpt-5-chat-latest` - Chat-optimized GPT-5
|
||||
|
||||
#### Reasoning Models
|
||||
- `o3` - Advanced reasoning with 200K context
|
||||
- `o4-mini` - Fast reasoning model
|
||||
- `o3-mini` - Compact reasoning model
|
||||
- `o1` - Original reasoning model
|
||||
- `o1-preview` - Preview reasoning model
|
||||
- `o1-mini` - Compact original reasoning model
|
||||
|
||||
#### GPT-4 Series
|
||||
- `gpt-4.1` - 1M+ context window model
|
||||
- `gpt-4.1-mini` - Compact 1M context model
|
||||
- `gpt-4.1-nano` - Ultra-compact 1M context model
|
||||
- `gpt-4o` - Multimodal model with 128K context
|
||||
- `gpt-4o-mini` - Fast, affordable multimodal model
|
||||
- `chatgpt-4o-latest` - Latest ChatGPT-optimized variant
|
||||
|
||||
For the most current list of available models and their capabilities, please refer to the official [OpenAI Models documentation](https://platform.openai.com/docs/models).
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
> See [Authorization & Model Selection](/getting-started/authorizing-with-cline#menu).
|
||||
|
||||
1. **Open Cline Settings:** Click the settings gear icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "OpenAI" from the "API Provider" dropdown menu.
|
||||
3. **Enter API Key:** Paste your OpenAI API key into the "OpenAI API Key" field.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown list.
|
||||
4. **Select Provider Model:** Choose your desired model from the "Model" dropdown list.
|
||||
5. **(Optional) Base URL:** If you need to use a proxy or a custom base URL for the OpenAI API, you can enter it here. Most users will not need to change this from the default.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Pricing:** Be sure to review the [OpenAI Pricing page](https://openai.com/pricing) for detailed information on the costs associated with different models.
|
||||
- **Azure OpenAI Service:** If you are looking to use the Azure OpenAI service, please note that specific documentation for Azure OpenAI with Cline may be found separately, or you might need to configure it as an OpenAI-compatible endpoint if such functionality is supported by Cline for custom configurations.
|
||||
|
||||
## OpenAI Codex (OAuth)
|
||||
|
||||
1. Open Cline settings.
|
||||
2. Select **OpenAI Codex** from **API Provider**.
|
||||
3. Click **Sign in with OpenAI** and complete browser OAuth.
|
||||
4. Return to Cline and choose a model.
|
||||
|
||||
Notes:
|
||||
- No API key entry required.
|
||||
- Available models depend on your OpenAI plan.
|
||||
|
||||
@@ -1,39 +1,31 @@
|
||||
---
|
||||
title: "OpenRouter"
|
||||
description: "Learn how to use OpenRouter with Cline to access a wide variety of language models through a single API."
|
||||
description: "Learn how to use OpenRouter with Cline to access a wide variety of language provider through a single API."
|
||||
---
|
||||
|
||||
OpenRouter is an AI platform that provides access to a wide variety of language models from different providers, all through a single API. This can simplify setup and allow you to easily experiment with different models.
|
||||
|
||||
**Website:** [https://openrouter.ai/](https://openrouter.ai/)
|
||||
|
||||
### Getting an API Key
|
||||
### Get API Credentials
|
||||
|
||||
1. **Sign Up/Sign In:** Go to the [OpenRouter website](https://openrouter.ai/). Sign in with your Google or GitHub account.
|
||||
2. **Get an API Key:** Go to the [keys page](https://openrouter.ai/keys). You should see an API key listed. If not, create a new key.
|
||||
3. **Copy the Key:** Copy the API key.
|
||||
|
||||
### Supported Models
|
||||
|
||||
OpenRouter supports a large and growing number of models. Cline automatically fetches the list of available models. Refer to the [OpenRouter Models page](https://openrouter.ai/models) for the complete and up-to-date list.
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
> See [Authorization & Model Selection](/getting-started/authorizing-with-cline#menu).
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "OpenRouter" from the "API Provider" dropdown.
|
||||
3. **Enter API Key:** Paste your OpenRouter API key into the "OpenRouter API Key" field.
|
||||
4. **Select Model:** Choose your desired model from the "Model" dropdown.
|
||||
4. **Select Provider Model:** Choose your desired model from the "Model" dropdown.
|
||||
5. **(Optional) Custom Base URL:** If you need to use a custom base URL for the OpenRouter API, check "Use custom base URL" and enter the URL. Leave this blank for most users.
|
||||
|
||||
### Supported Transforms
|
||||
|
||||
OpenRouter provides an [optional "middle-out" message transform](https://openrouter.ai/docs/features/message-transforms) to help with prompts that exceed the maximum context size of a model. You can enable it by checking the "Compress prompts and message chains to the context size" box.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Model Selection:** OpenRouter offers a wide range of models. Experiment to find the best one for your needs.
|
||||
- **Pricing:** OpenRouter charges based on the underlying model's pricing. See the [OpenRouter Models page](https://openrouter.ai/models) for details.
|
||||
- **Prompt Caching:**
|
||||
- OpenRouter passes caching requests to underlying models that support it. Check the [OpenRouter Models page](https://openrouter.ai/models) to see which models offer caching.
|
||||
- For most models, caching should activate automatically if supported by the model itself (similar to how Requesty works).
|
||||
- **Exception for Gemini Models via OpenRouter:** Due to potential response delays sometimes observed with Google's caching mechanism when accessed via OpenRouter, a manual activation step is required _specifically for Gemini models_.
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
---
|
||||
title: "Oracle Code Assist"
|
||||
description: "Learn how to configure and use Oracle Code Assist with Cline. Access Oracle's AI coding assistant through OCI Generative AI."
|
||||
---
|
||||
|
||||
Oracle Code Assist provides AI-powered coding assistance through Oracle Cloud Infrastructure (OCI) Generative AI service.
|
||||
|
||||
**Website:** [https://www.oracle.com/application-development/code-assist/](https://www.oracle.com/application-development/code-assist/)
|
||||
|
||||
### Getting Started
|
||||
|
||||
1. **OCI Account:** You need an Oracle Cloud Infrastructure account.
|
||||
2. **Enable Generative AI:** Enable the OCI Generative AI service in your tenancy.
|
||||
3. **Get Credentials:** Configure OCI authentication (API key, config file, or instance principal).
|
||||
|
||||
### Configuration in Cline
|
||||
|
||||
1. **Open Cline Settings:** Click the settings icon (⚙️) in the Cline panel.
|
||||
2. **Select Provider:** Choose "Oracle Code Assist" from the "API Provider" dropdown.
|
||||
3. **Configure Authentication:** Set up your OCI credentials.
|
||||
4. **Select Model:** Choose your desired model.
|
||||
|
||||
### Tips and Notes
|
||||
|
||||
- **Enterprise Integration:** Designed for enterprise environments with OCI infrastructure.
|
||||
- **OCI Authentication:** Supports standard OCI authentication methods.
|
||||
- **Documentation:** Refer to [Oracle Code Assist docs](https://docs.oracle.com/en-us/iaas/Content/generative-ai/home.htm) for detailed setup.
|
||||
@@ -0,0 +1,322 @@
|
||||
---
|
||||
title: "Other 30+ Providers"
|
||||
description: "Reference list for additional supported providers with shared configuration flow."
|
||||
---
|
||||
|
||||
Use this page for providers that follow the same setup pattern.
|
||||
|
||||
## Menu
|
||||
|
||||
- [Shared Configuration in Cline](#shared-configuration-in-cline)
|
||||
- [Providers](#providers)
|
||||
- [AIHubMix](#aihubmix)
|
||||
- [AskSage](#asksage)
|
||||
- [Baseten](#baseten)
|
||||
- [Cerebras](#cerebras)
|
||||
- [Dify.ai](#difyai)
|
||||
- [Doubao](#doubao)
|
||||
- [Fireworks AI](#fireworks-ai)
|
||||
- [GCP Vertex AI](#gcp-vertex-ai)
|
||||
- [Groq](#groq)
|
||||
- [Hicap](#hicap)
|
||||
- [Huawei Cloud MaaS](#huawei-cloud-maas)
|
||||
- [Hugging Face](#hugging-face)
|
||||
- [Mistral](#mistral)
|
||||
- [Moonshot](#moonshot)
|
||||
- [Nebius AI Studio](#nebius-ai-studio)
|
||||
- [Nous Research](#nous-research)
|
||||
- [Oracle Code Assist](#oracle-code-assist)
|
||||
- [Qwen Code](#qwen-code)
|
||||
- [Requesty](#requesty)
|
||||
- [SambaNova](#sambanova)
|
||||
- [SAP AI Core](#sap-ai-core)
|
||||
- [Together](#together)
|
||||
- [Vercel AI Gateway](#vercel-ai-gateway)
|
||||
- [VS Code Language Model API](#vs-code-language-model-api)
|
||||
- [xAI (Grok)](#xai-grok)
|
||||
|
||||
## Shared Configuration in Cline
|
||||
|
||||
1. Open Cline settings (⚙️).
|
||||
2. Select your provider from **API Provider**.
|
||||
3. Paste your API key/token in the matching credential field.
|
||||
4. Choose a model from **Model**.
|
||||
|
||||
For the full auth flow (IDE + CLI), see [Authorization & Model Selection](/getting-started/authorizing-with-cline#menu).
|
||||
|
||||
## Providers
|
||||
|
||||
### AIHubMix
|
||||
AIHubMix is an OpenAI-compatible model aggregator that gives you one API surface for multiple model backends.
|
||||
|
||||
**Website:** [https://aihubmix.com/](https://aihubmix.com/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Create/sign in to your AIHubMix account.
|
||||
2. Generate an API key from the dashboard.
|
||||
3. In Cline, choose **AIHubMix** and paste the key.
|
||||
|
||||
### AskSage
|
||||
AskSage is focused on enterprise and government AI access with compliance-oriented controls.
|
||||
|
||||
**Website:** [https://www.asksage.ai/](https://www.asksage.ai/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Sign in to AskSage and create API credentials.
|
||||
2. Confirm your workspace/organization has model access enabled.
|
||||
3. In Cline, select **AskSage** and enter the key.
|
||||
|
||||
### Baseten
|
||||
Baseten provides hosted model APIs and deployment infrastructure for production inference.
|
||||
|
||||
**Website:** [https://www.baseten.co/products/model-apis/](https://www.baseten.co/products/model-apis/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Create a Baseten account and open the API keys section.
|
||||
2. Generate an API key with the required permissions.
|
||||
3. In Cline, choose **Baseten** and paste the key.
|
||||
|
||||
### Cerebras
|
||||
Cerebras offers very fast hosted inference for supported model families.
|
||||
|
||||
**Website:** [https://cloud.cerebras.ai/](https://cloud.cerebras.ai/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Sign in to Cerebras Cloud.
|
||||
2. Create or retrieve your API key.
|
||||
3. In Cline, select **Cerebras** and enter the key.
|
||||
|
||||
### Dify.ai
|
||||
Dify.ai is a workflow-centric AI platform with app and pipeline capabilities.
|
||||
|
||||
**Website:** [https://dify.ai/](https://dify.ai/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Create a Dify workspace and API credential.
|
||||
2. Confirm your Dify endpoint/provider settings are active.
|
||||
3. In Cline, select **Dify.ai** and paste your key.
|
||||
|
||||
### Doubao
|
||||
Doubao is ByteDance’s model family, typically accessed through Volcengine services.
|
||||
|
||||
**Website:** [https://www.volcengine.com/](https://www.volcengine.com/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Sign in to Volcengine and enable model access.
|
||||
2. Generate API credentials for Doubao endpoints.
|
||||
3. In Cline, select **Doubao** and paste credentials.
|
||||
|
||||
### Fireworks AI
|
||||
Fireworks AI provides hosted inference for open models and performance-focused deployment.
|
||||
|
||||
**Website:** [https://fireworks.ai/](https://fireworks.ai/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Create a Fireworks account.
|
||||
2. Generate an API key in your project/account settings.
|
||||
3. In Cline, choose **Fireworks AI** and enter the key.
|
||||
|
||||
### GCP Vertex AI
|
||||
Vertex AI is Google Cloud’s enterprise model platform with IAM and project-level governance.
|
||||
|
||||
**Website:** [https://cloud.google.com/vertex-ai](https://cloud.google.com/vertex-ai)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Set up a GCP project with Vertex AI enabled.
|
||||
2. Configure authentication (service account or application default credentials).
|
||||
3. In Cline, select **GCP Vertex AI** and provide required config values.
|
||||
|
||||
### Groq
|
||||
Groq is a low-latency inference provider for supported model families.
|
||||
|
||||
**Website:** [https://groq.com/](https://groq.com/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Sign in to Groq Console.
|
||||
2. Create an API key.
|
||||
3. In Cline, select **Groq** and paste the key.
|
||||
|
||||
### Hicap
|
||||
Hicap provides OpenAI-compatible access with multimodal support.
|
||||
|
||||
**Website:** [https://hicap.ai](https://hicap.ai)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Create your Hicap account.
|
||||
2. Generate an API key/token.
|
||||
3. In Cline, choose **Hicap** and enter the credential.
|
||||
|
||||
### Huawei Cloud MaaS
|
||||
Huawei Cloud MaaS provides model-as-a-service access within Huawei Cloud.
|
||||
|
||||
**Website:** [https://www.huaweicloud.com/](https://www.huaweicloud.com/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Sign in to Huawei Cloud and open MaaS services.
|
||||
2. Create API credentials for model access.
|
||||
3. In Cline, select **Huawei Cloud MaaS** and add credentials.
|
||||
|
||||
### Hugging Face
|
||||
Hugging Face provides hosted inference access for open-source models.
|
||||
|
||||
**Website:** [https://huggingface.co/](https://huggingface.co/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Sign in to Hugging Face.
|
||||
2. Create an access token with inference permissions.
|
||||
3. In Cline, select **Hugging Face** and paste the token.
|
||||
|
||||
### Mistral
|
||||
Mistral provides direct API access to its model lineup.
|
||||
|
||||
**Website:** [https://mistral.ai/](https://mistral.ai/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Create/sign in to Mistral platform account.
|
||||
2. Generate an API key.
|
||||
3. In Cline, choose **Mistral** and paste the key.
|
||||
|
||||
### Moonshot
|
||||
Moonshot provides API access to Kimi model families.
|
||||
|
||||
**Website:** [https://platform.moonshot.ai/](https://platform.moonshot.ai/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Sign in to Moonshot platform.
|
||||
2. Create an API key in account settings.
|
||||
3. In Cline, select **Moonshot** and enter the key.
|
||||
|
||||
### Nebius AI Studio
|
||||
Nebius AI Studio offers managed hosted model APIs.
|
||||
|
||||
**Website:** [https://studio.nebius.com/](https://studio.nebius.com/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Create/sign in to Nebius AI Studio.
|
||||
2. Generate API credentials.
|
||||
3. In Cline, choose **Nebius AI Studio** and provide the credential.
|
||||
|
||||
### Nous Research
|
||||
Nous Research provides access to Hermes-family model offerings.
|
||||
|
||||
**Website:** [https://nousresearch.com/](https://nousresearch.com/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Get provider access/credentials for Nous-hosted endpoints.
|
||||
2. Confirm available model IDs for your account.
|
||||
3. In Cline, select **NousResearch** and add credentials.
|
||||
|
||||
### Oracle Code Assist
|
||||
Oracle Code Assist provides AI-powered coding assistance through Oracle Cloud Infrastructure (OCI) Generative AI service.
|
||||
|
||||
**Website:** [https://www.oracle.com/application-development/code-assist/](https://www.oracle.com/application-development/code-assist/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. **OCI Account:** You need an Oracle Cloud Infrastructure account.
|
||||
2. **Enable Generative AI:** Enable the OCI Generative AI service in your tenancy.
|
||||
3. **Get Credentials:** Configure OCI authentication (API key, config file, or instance principal).
|
||||
|
||||
### Qwen Code
|
||||
Qwen Code provides coding-oriented access to Qwen models.
|
||||
|
||||
**Website:** [https://chat.qwen.ai/](https://chat.qwen.ai/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Sign in to Qwen platform.
|
||||
2. Obtain API access credentials.
|
||||
3. In Cline, select **Qwen Code** and enter the credential.
|
||||
|
||||
### Requesty
|
||||
Requesty provides multi-provider routing behind a single API surface.
|
||||
|
||||
**Website:** [https://www.requesty.ai/](https://www.requesty.ai/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Create/sign in to Requesty.
|
||||
2. Generate an API key.
|
||||
3. In Cline, select **Requesty** and paste the key.
|
||||
|
||||
### SambaNova
|
||||
SambaNova offers hosted inference and enterprise AI platform capabilities.
|
||||
|
||||
**Website:** [https://sambanova.ai/](https://sambanova.ai/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Create/sign in to SambaNova account.
|
||||
2. Create an API key/token.
|
||||
3. In Cline, choose **SambaNova** and enter credentials.
|
||||
|
||||
### SAP AI Core
|
||||
SAP AI Core is SAP’s enterprise AI platform for model integration and governance.
|
||||
|
||||
**Website:** [https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/what-is-sap-ai-core](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/what-is-sap-ai-core)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Set up SAP AI Core / generative AI hub access.
|
||||
2. Configure your service key/endpoint credentials.
|
||||
3. In Cline, select **SAP AI Core** and provide required values.
|
||||
|
||||
### Together
|
||||
Together provides hosted inference for many popular open models.
|
||||
|
||||
**Website:** [https://together.ai/](https://together.ai/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Create/sign in to Together account.
|
||||
2. Generate an API key.
|
||||
3. In Cline, choose **Together** and paste the key.
|
||||
|
||||
### Vercel AI Gateway
|
||||
Vercel AI Gateway gives one API for multiple upstream model providers.
|
||||
|
||||
**Website:** [https://vercel.com/](https://vercel.com/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Sign in to Vercel and open AI Gateway.
|
||||
2. Create a Gateway API key.
|
||||
3. In Cline, select **Vercel AI Gateway** and add the key.
|
||||
|
||||
### VS Code Language Model API
|
||||
VS Code Language Model API support lets Cline use models exposed by the VS Code host environment.
|
||||
|
||||
**Website:** [https://code.visualstudio.com/api/extension-guides/language-model](https://code.visualstudio.com/api/extension-guides/language-model)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Use VS Code with LM API-compatible model access configured.
|
||||
2. Ensure the language model integration is available in your environment.
|
||||
3. In Cline, select **VS Code Language Model API**.
|
||||
|
||||
### xAI (Grok)
|
||||
xAI provides Grok models through its API platform.
|
||||
|
||||
**Website:** [https://x.ai/](https://x.ai/)
|
||||
|
||||
#### Basic Setup
|
||||
|
||||
1. Sign in to xAI platform.
|
||||
2. Generate an API key.
|
||||
3. In Cline, choose **xAI (Grok)** and paste the key.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user