# Authentication Source: https://docs.cline.bot/api/authentication How to authenticate with the Cline API using API keys or account tokens. Every request to the Cline API requires authentication via a Bearer token in the `Authorization` header. ## Authentication Methods There are two ways to authenticate: | Method | Use case | How to get it | | ---------------------- | -------------------------------- | -------------------------------------------------------------------- | | **API key** | Direct API calls, scripts, CI/CD | Create at [app.cline.bot](https://app.cline.bot) Settings > API Keys | | **Account auth token** | Cline extension and CLI | Generated automatically when you sign in | Both methods use the same header format: ```bash theme={"system"} Authorization: Bearer YOUR_TOKEN ``` ## API Keys API keys are the recommended authentication method for programmatic access. ### Creating a Key Go to [app.cline.bot](https://app.cline.bot) and sign in. Navigate to **Settings** > **API Keys**. Create a new key. Copy it immediately as you will not be able to see it again. ### Deleting a Key You can revoke an API key at any time from the same Settings > API Keys page. Deleted keys stop working immediately. You can also manage keys programmatically through the [Enterprise API](/enterprise-solutions/api-reference#api-keys): ```bash theme={"system"} # List your keys curl https://api.cline.bot/api/v1/api-keys \ -H "Authorization: Bearer YOUR_TOKEN" # Delete a key curl -X DELETE https://api.cline.bot/api/v1/api-keys/KEY_ID \ -H "Authorization: Bearer YOUR_TOKEN" ``` ## Account Auth Tokens When you sign in to the Cline extension (VS Code, JetBrains) or CLI, an account auth token is generated and managed automatically. You do not need to handle these tokens manually. The Cline CLI uses these tokens when you authenticate via: ```bash theme={"system"} # Interactive sign-in cline auth # Or quick setup with an API key cline auth -p cline -k "YOUR_API_KEY" -m anthropic/claude-sonnet-4-6 ``` See the [CLI Reference](/cli/cli-reference#cline-auth) for all auth options. ## Security Best Practices **Do:** * Store API keys in environment variables or a secrets manager * Use different keys for development and production * Rotate keys periodically * Delete keys you no longer use **Do not:** * Commit keys to version control * Share keys in chat or email * Embed keys in client-side code (browsers, mobile apps) * Log keys in application output ### Using Environment Variables ```bash theme={"system"} # Set the key export CLINE_API_KEY="your_api_key_here" # Use it in requests curl -X POST https://api.cline.bot/api/v1/chat/completions \ -H "Authorization: Bearer $CLINE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "anthropic/claude-sonnet-4-6", "messages": [{"role": "user", "content": "Hello"}]}' ``` ### Using a .env File ```bash theme={"system"} # .env (add to .gitignore) CLINE_API_KEY=your_api_key_here ``` ```python theme={"system"} import os from openai import OpenAI client = OpenAI( base_url="https://api.cline.bot/api/v1", api_key=os.environ["CLINE_API_KEY"], ) ``` ## Custom Headers The Cline API accepts optional headers for tracking and identification: | Header | Description | | -------------- | ----------------------------------------------------------------- | | `HTTP-Referer` | Your application's URL. Helps with usage tracking. | | `X-Title` | Your application's name. Appears in usage logs. | | `X-Task-ID` | A unique task identifier. Used internally by the Cline extension. | ## Related Create your first API key and make a request. Manage API keys programmatically. # Chat Completions Source: https://docs.cline.bot/api/chat-completions Full reference for the POST /chat/completions endpoint including all parameters, streaming, and tool calling. The Chat Completions endpoint generates model responses from a conversation. It follows the [OpenAI Chat Completions](https://platform.openai.com/docs/api-reference/chat/create) format. ## Endpoint ``` POST https://api.cline.bot/api/v1/chat/completions ``` ## Request Headers | Header | Required | Description | | --------------- | -------- | ----------------------------------------- | | `Authorization` | Yes | `Bearer YOUR_API_KEY` | | `Content-Type` | Yes | `application/json` | | `HTTP-Referer` | No | Your application URL (for usage tracking) | | `X-Title` | No | Your application name (for usage logs) | ## Request Body | Parameter | Type | Required | Default | Description | | ------------- | ------- | -------- | ------------- | ------------------------------------------------------------------------------------- | | `model` | string | Yes | | Model ID in `provider/model` format. See [Models](/api/models). | | `messages` | array | Yes | | Conversation messages. Each has `role` (`system`, `user`, `assistant`) and `content`. | | `stream` | boolean | No | `true` | Return the response as a stream of Server-Sent Events. | | `tools` | array | No | | Tool/function definitions in OpenAI format. | | `temperature` | number | No | Model default | Sampling temperature (0.0 to 2.0). Lower values are more deterministic. | ### Message Format Each message in the `messages` array has this structure: ```json theme={"system"} { "role": "user", "content": "Your message here" } ``` **Roles:** | Role | Purpose | | ----------- | ---------------------------------------------------------------- | | `system` | Sets the model's behavior and persona. Place first in the array. | | `user` | The human's input. | | `assistant` | Previous model responses (for multi-turn conversations). | ### Multi-Turn Conversation Include previous messages to maintain context: ```json theme={"system"} { "model": "anthropic/claude-sonnet-4-6", "messages": [ {"role": "system", "content": "You are a helpful coding assistant."}, {"role": "user", "content": "What is a closure in JavaScript?"}, {"role": "assistant", "content": "A closure is a function that..."}, {"role": "user", "content": "Can you show me an example?"} ] } ``` ## Streaming Response When `stream: true` (the default), the response is a series of [Server-Sent Events](https://developer.mozilla.org/en-US/docs/Web/API/Server-Sent_Events): ``` data: {"id":"gen-abc123","choices":[{"delta":{"role":"assistant"},"index":0}],"model":"anthropic/claude-sonnet-4-6"} data: {"id":"gen-abc123","choices":[{"delta":{"content":"The capital"},"index":0}],"model":"anthropic/claude-sonnet-4-6"} data: {"id":"gen-abc123","choices":[{"delta":{"content":" of France"},"index":0}],"model":"anthropic/claude-sonnet-4-6"} data: {"id":"gen-abc123","choices":[{"delta":{"content":" is Paris."},"index":0,"finish_reason":"stop"}],"model":"anthropic/claude-sonnet-4-6","usage":{"prompt_tokens":14,"completion_tokens":8,"cost":0.000066}} data: [DONE] ``` Each `data:` line contains a JSON chunk. Key fields: | Field | Description | | ---------------------------- | --------------------------------------------------- | | `id` | Generation ID, consistent across all chunks | | `choices[0].delta.content` | The new text in this chunk | | `choices[0].delta.reasoning` | Reasoning/thinking content (for reasoning models) | | `choices[0].finish_reason` | `stop` when complete, `error` on failure | | `usage` | Token counts and cost (included in the final chunk) | ### Usage Object The final chunk includes token usage and cost: ```json theme={"system"} { "usage": { "prompt_tokens": 25, "completion_tokens": 42, "prompt_tokens_details": { "cached_tokens": 0 }, "cost": 0.000315 } } ``` | Field | Description | | ------------------------------------- | --------------------------------------- | | `prompt_tokens` | Total input tokens | | `completion_tokens` | Total output tokens | | `prompt_tokens_details.cached_tokens` | Tokens served from cache (reduces cost) | | `cost` | Total cost in USD for this request | ## Non-Streaming Response When `stream: false`, the response is a single JSON object: ```json theme={"system"} { "id": "gen-abc123", "model": "anthropic/claude-sonnet-4-6", "choices": [ { "message": { "role": "assistant", "content": "The capital of France is Paris." }, "finish_reason": "stop", "index": 0 } ], "usage": { "prompt_tokens": 14, "completion_tokens": 8 } } ``` ## Tool Calling You can define tools that the model can call using the OpenAI function calling format: ```json theme={"system"} { "model": "anthropic/claude-sonnet-4-6", "messages": [ {"role": "user", "content": "What's the weather in San Francisco?"} ], "tools": [ { "type": "function", "function": { "name": "get_weather", "description": "Get the current weather for a location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "City and state, e.g. San Francisco, CA" } }, "required": ["location"] } } } ] } ``` When the model decides to call a tool, the response includes a `tool_calls` array: ```json theme={"system"} { "choices": [ { "message": { "role": "assistant", "tool_calls": [ { "id": "call_abc123", "type": "function", "function": { "name": "get_weather", "arguments": "{\"location\": \"San Francisco, CA\"}" } } ] }, "finish_reason": "tool_calls" } ] } ``` To continue the conversation after a tool call, include the tool result: ```json theme={"system"} { "messages": [ {"role": "user", "content": "What's the weather in San Francisco?"}, {"role": "assistant", "tool_calls": [{"id": "call_abc123", "type": "function", "function": {"name": "get_weather", "arguments": "{\"location\": \"San Francisco, CA\"}"}}]}, {"role": "tool", "tool_call_id": "call_abc123", "content": "{\"temperature\": 62, \"condition\": \"foggy\"}"}, ] } ``` ## Reasoning Models Some models support extended thinking (reasoning). When using these models, the response may include reasoning content in the streaming delta: ```json theme={"system"} {"choices":[{"delta":{"reasoning":"Let me think about this step by step..."}}]} ``` Reasoning tokens are separate from the main content and appear in the `delta.reasoning` field. Some providers return encrypted reasoning blocks via `delta.reasoning_details` that can be passed back in subsequent requests to preserve the reasoning trace. Not all models support reasoning. See [Models](/api/models) for which models have reasoning capabilities. ## Complete Example ```bash theme={"system"} 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 concise assistant. Answer in one sentence."}, {"role": "user", "content": "Explain what an API is."} ], "stream": true }' ``` ## Related Browse available models and their capabilities. Handle errors and implement retry logic. Use this endpoint from Python, Node.js, and more. API key management and security practices. # Errors Source: https://docs.cline.bot/api/errors Error codes, error formats, mid-stream errors, and retry strategies for the Cline API. The Cline API returns errors in a consistent JSON format. Understanding these errors helps you build reliable integrations. ## Error Format All errors follow the OpenAI error format: ```json theme={"system"} { "error": { "code": 401, "message": "Invalid API key", "metadata": {} } } ``` | Field | Type | Description | | ---------- | ------------- | -------------------------------------------------- | | `code` | number/string | HTTP status code or error identifier | | `message` | string | Human-readable description of the error | | `metadata` | object | Additional context (provider details, request IDs) | ## Error Codes ### HTTP Errors These are returned as the HTTP response status code and in the error body: | Code | Name | Cause | What to do | | ----- | --------------------- | ----------------------------------------------- | ----------------------------------------------------- | | `400` | Bad Request | Malformed request body, missing required fields | Check your JSON syntax and required parameters | | `401` | Unauthorized | Invalid or missing API key | Verify your API key in the `Authorization` header | | `402` | Payment Required | Insufficient credits | Add credits at [app.cline.bot](https://app.cline.bot) | | `403` | Forbidden | Key does not have access to this resource | Check key permissions | | `404` | Not Found | Invalid endpoint or model ID | Verify the URL and model ID format | | `429` | Too Many Requests | Rate limit exceeded | Wait and retry with exponential backoff | | `500` | Internal Server Error | Server-side issue | Retry after a short delay | | `502` | Bad Gateway | Upstream provider error | Retry after a short delay | | `503` | Service Unavailable | Service temporarily down | Retry after a short delay | ### Mid-Stream Errors When streaming, errors can occur after the response has started. These appear as a chunk with `finish_reason: "error"`: ```json theme={"system"} { "choices": [ { "finish_reason": "error", "error": { "code": "context_length_exceeded", "message": "The input exceeds the model's maximum context length." } } ] } ``` Common mid-stream error codes: | Code | Meaning | | ------------------------- | ---------------------------------------------- | | `context_length_exceeded` | Input tokens exceed the model's context window | | `content_filter` | Content was blocked by a safety filter | | `rate_limit` | Rate limit hit during generation | | `server_error` | Upstream provider failed during generation | Mid-stream errors do not produce an HTTP error code (the connection was already 200 OK). Always check `finish_reason` in your streaming handler. ## Retry Strategies ### Exponential Backoff For transient errors (429, 500, 502, 503), retry with exponential backoff: ```python theme={"system"} import time import requests def call_api_with_retry(payload, max_retries=3): for attempt in range(max_retries): response = requests.post( "https://api.cline.bot/api/v1/chat/completions", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json=payload, ) if response.status_code == 200: return response.json() if response.status_code in (429, 500, 502, 503): delay = (2 ** attempt) + 1 print(f"Retrying in {delay}s (attempt {attempt + 1}/{max_retries})") time.sleep(delay) continue # Non-retryable error response.raise_for_status() raise Exception("Max retries exceeded") ``` ### When to Retry | Error | Retry? | Strategy | | --------------------------- | ------- | ------------------------------------------- | | `401 Unauthorized` | No | Fix your API key | | `402 Payment Required` | No | Add credits | | `429 Too Many Requests` | Yes | Exponential backoff (start at 1s) | | `500 Internal Server Error` | Yes | Retry once after 1s | | `502 Bad Gateway` | Yes | Retry up to 3 times with backoff | | `503 Service Unavailable` | Yes | Retry up to 3 times with backoff | | Mid-stream `error` | Depends | Retry the full request for transient errors | ### Rate Limits If you hit rate limits frequently: * Add delays between requests * Reduce the number of concurrent requests * Contact support if you need higher limits ## Debugging When reporting issues, include: 1. The **error code and message** from the response 2. The **model ID** you were using 3. The **request ID** (from the `x-request-id` response header, if available) 4. Whether the error was **immediate** (HTTP error) or **mid-stream** (finish\_reason error) ## Related Endpoint reference with request and response schemas. Verify your API key is configured correctly. # Getting Started Source: https://docs.cline.bot/api/getting-started Create an API key and make your first request to the Cline API in under a minute. This guide walks you through creating an API key and making your first Chat Completions request. ## Prerequisites * A Cline account at [app.cline.bot](https://app.cline.bot) * `curl` or any HTTP client (Python, Node.js, etc.) ## Create an API Key Go to [app.cline.bot](https://app.cline.bot) and sign in with your account. Open **Settings** and select **API Keys**. Click **Create API Key**. Copy the key immediately. You will not be able to see it again after leaving this page. Treat your API key like a password. Do not commit it to version control or share it publicly. ## Make Your First Request Replace `YOUR_API_KEY` with the key you just created: ```bash theme={"system"} 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": "user", "content": "What is the capital of France?"} ], "stream": false }' ``` ## Verify the Response You should get a JSON response like this: ```json theme={"system"} { "id": "gen-abc123", "model": "anthropic/claude-sonnet-4-6", "choices": [ { "message": { "role": "assistant", "content": "The capital of France is Paris." }, "finish_reason": "stop", "index": 0 } ], "usage": { "prompt_tokens": 14, "completion_tokens": 8 } } ``` The `choices[0].message.content` field contains the model's reply. The `usage` field shows how many tokens were consumed. ## Try Streaming For real-time output, set `stream: true`. The response arrives as Server-Sent Events: ```bash theme={"system"} 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": "user", "content": "Write a haiku about programming."} ], "stream": true }' ``` Each chunk arrives as a `data:` line. The stream ends with `data: [DONE]`. ## Try a Free Model To test without spending credits, use one of the [free models](/api/models#free-models): ```bash theme={"system"} curl -X POST https://api.cline.bot/api/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "minimax/minimax-m2.5", "messages": [ {"role": "user", "content": "Hello! What can you help me with?"} ], "stream": false }' ``` ## Troubleshooting | Problem | Solution | | ---------------------- | --------------------------------------------------------------------------------------------- | | `401 Unauthorized` | Check that your API key is correct and included in the `Authorization` header | | `402 Payment Required` | Your account has insufficient credits. Add credits at [app.cline.bot](https://app.cline.bot) | | Empty response | Make sure `messages` is a non-empty array with at least one user message | | Connection timeout | Verify your network can reach `api.cline.bot`. Check proxy settings if on a corporate network | ## Next Steps Learn about API keys, token scoping, and security practices. Full endpoint reference with all parameters and options. Browse available models and find the right one for your use case. Use the API from Python, Node.js, or the Cline CLI. # Models Source: https://docs.cline.bot/api/models Available models, pricing tiers, free models, and how model IDs work in the Cline API. The Cline API gives you access to models from multiple providers through a single endpoint. Model IDs follow the `provider/model-name` format, the same convention used by [OpenRouter](https://openrouter.ai). ## Model ID Format Every model is identified by a string in the format: ``` provider/model-name ``` For example: * `anthropic/claude-sonnet-4-6` - Claude Sonnet 4.6 from Anthropic * `openai/gpt-4o` - GPT-4o from OpenAI * `google/gemini-2.5-pro` - Gemini 2.5 Pro from Google Pass this string as the `model` parameter in your [Chat Completions](/api/chat-completions) request. Example: ```bash theme={"system"} curl -X POST https://api.cline.bot/api/v1/chat/completions \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "minimax/minimax-m2.5", "messages": [{"role": "user", "content": "Hello!"}] }' ``` ## Reasoning Models Some models support extended thinking, where the model reasons through a problem before responding. When using these models: * Reasoning content appears in `delta.reasoning` during streaming * Some providers return encrypted reasoning blocks in `delta.reasoning_details` * Reasoning tokens are counted separately from output tokens Models with reasoning support include most Claude, Gemini 2.5, and Grok 3 models. Check the model's `supportsReasoning` capability in the model catalog. ## Choosing a Model | If you need... | Consider | | --------------------------- | ------------------------------------------------ | | Best coding performance | `anthropic/claude-sonnet-4-6` | | Long document analysis | `google/gemini-2.5-pro` (1M context) | | Fast, cheap responses | `deepseek/deepseek-chat` | | Free experimentation | `minimax/minimax-m2.5` | | Multi-modal (text + images) | `openai/gpt-4o` or `anthropic/claude-sonnet-4-6` | | Complex reasoning | Any model with reasoning support | For setup and account flow details, see the [Cline Provider guide](/getting-started/cline-provider). ## Image Support Models that support images accept base64-encoded image content in the `messages` array: ```json theme={"system"} { "model": "anthropic/claude-sonnet-4-6", "messages": [ { "role": "user", "content": [ {"type": "text", "text": "What's in this image?"}, {"type": "image_url", "image_url": {"url": "data:image/png;base64,..."}} ] } ] } ``` Not all models support images. Check the model's `supportsImages` capability before sending image content. ## Related Use these models in your API requests. Fastest setup path with built-in authentication and billing. # Cline API Source: https://docs.cline.bot/api/overview Programmatic access to AI models through an OpenAI-compatible Chat Completions API. Welcome to the Cline API documentation. Use the same models that power the Cline extension and CLI from any language, framework, or tool that speaks the OpenAI format. ## What is the Cline API? The Cline API is an OpenAI-compatible Chat Completions endpoint. You authenticate once with a Cline API key and get access to models from Anthropic, OpenAI, Google, and more through a single base URL. No need to manage separate keys for each provider. ``` Your App → Cline API (api.cline.bot) → Anthropic / OpenAI / Google / etc. ``` Create an API key and make your first request in under a minute. API keys, account tokens, key rotation, and security best practices. Full endpoint reference with request schemas, streaming, and tool calling. Ready-to-copy examples for Python, Node.js, curl, and the Cline CLI. ## Explore the Reference Browse available models, free tier options, reasoning support, and selection guidance. Error codes, mid-stream errors, retry strategies, and debugging tips. Admin endpoints for managing users, organizations, billing, and API keys. ## Quick Start ```bash theme={"system"} 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": "user", "content": "Hello!"}] }' ``` Get your API key at [app.cline.bot](https://app.cline.bot) (Settings > API Keys), then follow the [Getting Started](/api/getting-started) guide. # Code Examples Source: https://docs.cline.bot/api/sdk-examples Use the Cline API from Python, Node.js, curl, the Cline CLI, and the VS Code extension. The Cline API is OpenAI-compatible, so any library or tool that works with OpenAI also works with the Cline API. Just change the base URL and API key. ## curl ### Non-Streaming ```bash theme={"system"} curl -X POST https://api.cline.bot/api/v1/chat/completions \ -H "Authorization: Bearer $CLINE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic/claude-sonnet-4-6", "messages": [{"role": "user", "content": "What is 2+2?"}], "stream": false }' ``` ### Streaming ```bash theme={"system"} curl -X POST https://api.cline.bot/api/v1/chat/completions \ -H "Authorization: Bearer $CLINE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "anthropic/claude-sonnet-4-6", "messages": [{"role": "user", "content": "Write a short poem about code."}], "stream": true }' ``` ## Python ### OpenAI SDK The [OpenAI Python SDK](https://github.com/openai/openai-python) works with the Cline API by setting `base_url`: ```python theme={"system"} from openai import OpenAI client = OpenAI( base_url="https://api.cline.bot/api/v1", api_key="YOUR_API_KEY", ) # Non-streaming response = client.chat.completions.create( model="anthropic/claude-sonnet-4-6", messages=[{"role": "user", "content": "Explain recursion in one sentence."}], ) print(response.choices[0].message.content) ``` ### Streaming in Python ```python theme={"system"} from openai import OpenAI client = OpenAI( base_url="https://api.cline.bot/api/v1", api_key="YOUR_API_KEY", ) stream = client.chat.completions.create( model="anthropic/claude-sonnet-4-6", messages=[{"role": "user", "content": "Write a function to reverse a string in Python."}], stream=True, ) for chunk in stream: content = chunk.choices[0].delta.content if content: print(content, end="", flush=True) print() ``` ### Tool Calling in Python ```python theme={"system"} from openai import OpenAI import json client = OpenAI( base_url="https://api.cline.bot/api/v1", api_key="YOUR_API_KEY", ) tools = [ { "type": "function", "function": { "name": "get_weather", "description": "Get weather for a location", "parameters": { "type": "object", "properties": { "location": {"type": "string", "description": "City name"} }, "required": ["location"], }, }, } ] response = client.chat.completions.create( model="anthropic/claude-sonnet-4-6", messages=[{"role": "user", "content": "What's the weather in Tokyo?"}], tools=tools, ) # Check if the model wants to call a tool choice = response.choices[0] if choice.message.tool_calls: tool_call = choice.message.tool_calls[0] print(f"Tool: {tool_call.function.name}") print(f"Args: {tool_call.function.arguments}") ``` ### Using requests If you prefer not to use the OpenAI SDK: ```python theme={"system"} import requests response = requests.post( "https://api.cline.bot/api/v1/chat/completions", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, json={ "model": "anthropic/claude-sonnet-4-6", "messages": [{"role": "user", "content": "Hello!"}], "stream": False, }, ) data = response.json() print(data["choices"][0]["message"]["content"]) ``` ## Node.js / TypeScript ### OpenAI SDK The [OpenAI Node.js SDK](https://github.com/openai/openai-node) works with the Cline API by setting `baseURL`: ```typescript theme={"system"} import OpenAI from "openai" const client = new OpenAI({ baseURL: "https://api.cline.bot/api/v1", apiKey: "YOUR_API_KEY", }) // Non-streaming const response = await client.chat.completions.create({ model: "anthropic/claude-sonnet-4-6", messages: [{ role: "user", content: "Explain async/await in one sentence." }], }) console.log(response.choices[0].message.content) ``` ### Streaming in Node.js ```typescript theme={"system"} import OpenAI from "openai" const client = new OpenAI({ baseURL: "https://api.cline.bot/api/v1", apiKey: "YOUR_API_KEY", }) const stream = await client.chat.completions.create({ model: "anthropic/claude-sonnet-4-6", messages: [{ role: "user", content: "Write a haiku about TypeScript." }], stream: true, }) for await (const chunk of stream) { const content = chunk.choices[0]?.delta?.content if (content) { process.stdout.write(content) } } console.log() ``` ### Using fetch ```typescript theme={"system"} const response = await fetch("https://api.cline.bot/api/v1/chat/completions", { method: "POST", headers: { Authorization: "Bearer YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ model: "anthropic/claude-sonnet-4-6", messages: [{ role: "user", content: "Hello!" }], stream: false, }), }) const data = await response.json() console.log(data.choices[0].message.content) ``` ## Cline CLI 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 ```bash theme={"system"} # Install npm install -g @anthropic-ai/cline # Authenticate with a Cline API key cline auth -p cline -k "YOUR_API_KEY" -m anthropic/claude-sonnet-4-6 ``` ### Run Tasks ```bash theme={"system"} # Simple prompt cline "Explain what a REST API is." # Pipe input cat README.md | cline "Summarize this document." # Use a specific model cline -m google/gemini-2.5-pro "Analyze this codebase." # YOLO mode for automation cline -y "Run tests and fix failures." ``` See the [CLI Reference](/cli/cli-reference) for all commands and options. ## VS Code / JetBrains The Cline extension handles the API integration for you: 1. Open the Cline panel in your editor 2. Select **Cline** as the provider in the model picker 3. Sign in with your Cline account 4. Start chatting or give Cline a task Your API key is managed automatically. No manual configuration needed. For setup instructions, see [Installing Cline](/getting-started/installing-cline) and [Authorizing with Cline](/getting-started/authorizing-with-cline). ## Related Full endpoint reference with all parameters. API key management and security practices. Browse available models. Complete Cline CLI command reference. # Memory Bank Source: https://docs.cline.bot/best-practices/memory-bank 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 them to a [Cline Rules file](/customization/cline-rules), such as `.clinerules/memory-bank.md` 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 theme={"system"} 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 ``` Memory Bank file hierarchy showing projectbrief.md at the top flowing into productContext, systemPatterns, and techContext, which feed into activeContext and progress ## 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. ## 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. ## 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 *** ## Memory Bank Custom Instructions Copy this into a Cline Rules file (for example, `.clinerules/memory-bank.md`) or your global custom instructions: ```markdown theme={"system"} # 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 Cline Rules?** Either works. Custom instructions apply globally across all projects. A [Cline Rules 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. **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. # Agent Teams Source: https://docs.cline.bot/cli/agent-teams Coordinate multiple agents working together on complex tasks from the CLI. This feature currently only applies to Cline SDK, CLI, and Kanban. This feature is not applicable on VSCode and JetBrains Extension for now. 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 theme={"system"} 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 theme={"system"} 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 theme={"system"} 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. # CLI Reference Source: https://docs.cline.bot/cli/cli-reference Complete command reference for Cline CLI including all commands, flags, and configuration options. ```bash theme={"system"} cline --help # Show all commands cline --help # Show help for a specific command ``` ## Synopsis ```bash theme={"system"} cline [options] [command] [prompt] ``` ## Help Menu (Source of Truth) ```text theme={"system"} 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 Set tool auto-approval for all tools (default: true) -t, --timeout Optional timeout in seconds (default: 0 for no timeout) -m, --model Model to use for the session with the selected provider -v, --verbose Show verbose output -c, --cwd Working directory --config Configuration directory (default: ~/.cline/data/settings) --data-dir Use isolated local state at this directory path (default: ~/.cline) --thinking Set reasoning effort level between none|low|medium|high|xhigh (default: medium) --retries Maximum consecutive mistakes (retries) before halting --hooks-dir 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 Resume an existing session by ID -k, --key API key override for this run -P, --provider Provider id (default: cline) -s, --system 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 ` | Set tool auto-approval for all tools (default: `true`; in [ACP mode](/usage/acp#auto-approving-tools) the default is `false`) | | `-t, --timeout ` | Optional timeout in seconds (default: `0` for no timeout) | | `-m, --model ` | Model to use for the session with the selected provider | | `-v, --verbose` | Show verbose output | | `-c, --cwd ` | Working directory | | `--config ` | Configuration directory (default: `~/.cline/data/settings`) | | `--data-dir ` | Use isolated local state at this directory path (default: `~/.cline`) | | `--thinking ` | Set reasoning effort: `none\|low\|medium\|high\|xhigh` (default `medium`) | | `--retries ` | Maximum consecutive mistakes (retries) before halting | | `--hooks-dir ` | Directory path to additional hooks for runtime hook injection (default: `~/.cline/hooks`) | | `--acp` | Run in Agent Client Protocol (ACP) mode for [editor integration](/usage/acp) | | `-i, --tui` | Open the terminal user interface (TUI) for interactive sessions | | `--id ` | Resume an existing session by ID | | `-k, --key ` | API key override for this run | | `-P, --provider ` | Provider id (default: `cline`) | | `-s, --system ` | 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 theme={"system"} cline cline "your prompt here" cline "Run tests and fix failures" echo "prompt" | cline ``` ### `auth [options] [provider]` Configure authentication with an AI provider. ```bash theme={"system"} cline auth ``` ### `config [options]` Show current configuration. ```bash theme={"system"} cline config ``` ### `connect [options] [adapter]` Connect to messaging platforms. See [Connectors](/cli/connectors). ```bash theme={"system"} cline connect cline connect [adapter] ``` ### `mcp` Manage MCP servers. See [MCP](/mcp/mcp-overview). ```bash theme={"system"} cline mcp ``` ### `dev` Developer tools and utilities. ```bash theme={"system"} cline dev ``` ### `doctor` Diagnose and fix configuration issues. ```bash theme={"system"} cline doctor ``` ### `history|h [options]` List session history or manage saved sessions. ```bash theme={"system"} cline history cline h ``` ### `hook` Handle a hook payload from stdin. ```bash theme={"system"} cat payload.json | cline hook ``` ### `plugin` Manage Cline plugins. Install plugins from file URLs, npm, git repositories, or local paths. See [Plugins](/customization/plugins) for full details and the plugin manifest format. ```bash theme={"system"} cline plugin install # Install a plugin cline plugin i # 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 ` | Install to `/.cline/plugins` instead of the global directory | Try it with the [TypeScript Navigation Plugin](https://github.com/cline/typescript-lsp-plugin): ```bash theme={"system"} cline plugin install https://github.com/cline/typescript-lsp-plugin.git ``` ### `schedule` Manage scheduled agents. See [Scheduling](/cli/scheduling). ```bash theme={"system"} cline schedule ``` ### `hub` Manage the local hub daemon. ```bash theme={"system"} cline hub ``` ### `update [options]` Check for updates and install if available. ```bash theme={"system"} cline update ``` ### `version` Show Cline CLI version number. ```bash theme={"system"} cline version cline -V ``` ### `kanban` Launch the kanban app and exit. ```bash theme={"system"} 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 theme={"system"} 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 theme={"system"} {"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 ``` # Connectors Source: https://docs.cline.bot/cli/connectors Connect the CLI to Telegram, Slack, Discord, Google Chat, WhatsApp, etc. This feature currently only applies to Cline CLI. 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 theme={"system"} cline connect ``` ## Supported Platforms | Platform | Direct Command | Required Credentials | | ----------- | ------------------------ | ------------------------------------------------------------------ | | Telegram | `cline connect telegram` | Bot token | | Slack | `cline connect slack` | Bot token plus webhook signing secret/base URL or socket app token | | 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 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...`) ```bash theme={"system"} cline connect telegram -k ``` The connector discovers the bot username from the token. Use `--bot-username` only if you need to override it. Open Telegram, search for your bot's username, and send a message. The agent processes it and replies in the chat. ### Security By default, anyone who finds your bot can message it and it will execute tasks on your machine. The `cline connect` wizard asks whether to restrict Telegram access and can configure this for you. Message [@userinfobot](https://t.me/userinfobot) on Telegram. It replies with your numeric user ID immediately. ```bash theme={"system"} cline connect ``` Choose Telegram, enter the bot token, answer yes to access restriction, then enter your user ID. Replace `12345` with your Telegram user ID: ```bash theme={"system"} cline connect telegram -k \ --allowed-user-id 12345 ``` Use `--hook-command` only when you need custom access logic. The hook receives each incoming message with sender info via stdin. Your script returns `{"action": "allow"}` or `{"action": "deny", "message": "reason"}`. Without `--allowed-user-id` or `--hook-command`, everything is auto-approved, so restrict Telegram bots that can reach a running Cline instance. ## Slack Slack supports webhook mode and socket mode. Each Slack thread maps to an agent session, so the agent maintains conversation context within a thread. Webhook mode requires a bot token, signing secret, and public base URL: ```bash theme={"system"} cline connect slack \ --bot-token \ --signing-secret \ --base-url ``` Configure the Slack app's event subscription and interactivity request URLs to `/api/webhooks/slack`. Socket mode requires a bot token and an app-level token with the `connections:write` scope: ```bash theme={"system"} cline connect slack \ --bot-token \ --app-token ``` Enable Socket Mode in the Slack app. Socket mode does not need a public request URL and is single-workspace only. ## Discord Requires a Discord application ID, bot token, public key, and public base URL. The connector listens for Discord interactions at `/api/webhooks/discord` and also starts a Discord gateway listener for mentions, replies, reactions, and DMs. Open [Discord Developer Portal](https://discord.com/developers/applications) and create an application. 1. In **General Information**, copy the **Application ID** and **Public Key**. 2. In **Bot**, create a bot if one does not exist, then reset and copy the bot token. 3. Enable **Message Content Intent** if you want normal messages, replies, and DMs to include text content. For local development, use a tunnel such as ngrok: ```bash theme={"system"} ngrok http 8788 ``` Copy the HTTPS forwarding URL. This is your connector base URL, for example `https://1234-5678.ngrok-free.app`. ```bash theme={"system"} cline connect discord \ --application-id \ --bot-token \ --public-key \ --base-url \ --port 8788 \ --cwd /path/to/repo \ --enable-tools ``` `--app-id` is an alias for `--application-id`, and `--token` is an alias for `--bot-token`. `--enable-tools` allows the agent to inspect files, run commands, edit code, and prepare PRs from Discord. Omit it if the bot should only chat. In the Discord Developer Portal, set **Interactions Endpoint URL** to: ```text theme={"system"} /api/webhooks/discord ``` For example: ```text theme={"system"} https://1234-5678.ngrok-free.app/api/webhooks/discord ``` You can verify the connector is reachable with: ```bash theme={"system"} curl /health ``` In **OAuth2 > URL Generator**, select the `bot` and `applications.commands` scopes, then give the bot permission to send messages and read message history. Open the generated URL and install the bot into your test server. Mention the bot in a server channel, reply in a bot-created thread, or DM the bot. Each Discord conversation keeps its own agent session and context. ### Discord Command Reference Send these commands in Discord: | Command | Description | | -------------------------------------- | ----------------------------------------------------------------------------- | | `/help` or `/start` | Show connector help | | `/new` or `/clear` | Start a fresh session for this Discord conversation | | `/whereami` | Show thread, channel, DM state, `cwd`, `workspaceRoot`, tools, and yolo state | | `/tools [on\|off\|toggle]` | View or change whether repo/file/shell tools are allowed | | `/yolo [on\|off\|toggle]` | View or change automatic tool approval | | `/cwd [path]` | View or change the working directory for this conversation | | `/schedule create/list/trigger/delete` | Manage scheduled workflows targeting this conversation | | `/abort` | Stop the current task | | `/exit` | Stop the connector | Normal messages are treated as agent tasks. If a task is already running, normal messages steer the active task. ### Discord Security By default, anyone who can reach the bot can ask it to run tasks. Restrict access with `--hook-command`. The hook receives the Discord user as a participant key such as `discord:user:123456789`. ```bash theme={"system"} cline connect discord \ --application-id \ --bot-token \ --public-key \ --base-url \ --hook-command 'jq -r ".payload.actor.participantKey" | grep -q "discord:user:123456789" && echo "{\"action\":\"allow\"}" || echo "{\"action\":\"deny\",\"message\":\"unauthorized\"}"' ``` ## Google Chat Requires a service account credentials JSON file and public base URL. ```bash theme={"system"} cline connect gchat --credentials --base-url ``` ## WhatsApp Requires a phone number ID, access token, app secret, webhook verify token, and public base URL. ```bash theme={"system"} cline connect whatsapp --phone-id --token --app-secret --base-url ``` ## Linear Requires an API key, webhook signing secret, and public base URL. ```bash theme={"system"} cline connect linear --api-key --signing-secret --base-url ``` ## Managing Connectors ```bash theme={"system"} # 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 theme={"system"} { "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 theme={"system"} # Terminal 1 cline connect telegram -k $TELEGRAM_TOKEN # Terminal 2 cline connect slack --bot-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. # GitHub Actions Integration Source: https://docs.cline.bot/cli/samples/github-integration Automatically respond to GitHub issues by mentioning @cline in comments using Cline CLI in GitHub Actions. Automate GitHub issue analysis with AI. Mention `@cline` in any issue comment to trigger an autonomous investigation that reads files, analyzes code, and provides actionable insights - all running automatically in 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. ## The Workflow Trigger Cline by mentioning `@cline` in any issue comment: Issue comment with @cline mention Cline's automated analysis appears as a new comment, with insights drawn from your actual codebase: Automated analysis response from Cline The entire investigation runs autonomously in GitHub Actions - from file exploration to posting results. Let's configure your repository. ## Prerequisites Before you begin, you'll need: * **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 ## Setup ### 1. Copy the Workflow File Copy the workflow file from this sample to your repository. The workflow file must be placed in the `.github/workflows/` directory in your repository root for GitHub Actions to detect and run it. In this case, we'll name it `cline-responder.yml`. ```bash theme={"system"} # In your repository root mkdir -p .github/workflows curl -o .github/workflows/cline-responder.yml https://raw.githubusercontent.com/cline/cline/main/src/samples/cli/github-integration/cline-responder.yml ``` Alternatively, you can copy the full workflow file directly into `.github/workflows/cline-responder.yml`: ```yaml theme={"system"} name: Cline Issue Assistant on: issue_comment: types: [created, edited] permissions: issues: write jobs: respond: runs-on: ubuntu-latest environment: cline-actions steps: - name: Check for @cline mention id: detect uses: actions/github-script@v7 with: script: | const body = context.payload.comment?.body || ""; const isPR = !!context.payload.issue?.pull_request; const hit = body.toLowerCase().includes("@cline"); core.setOutput("hit", (!isPR && hit) ? "true" : "false"); core.setOutput("issue_number", String(context.payload.issue?.number || "")); core.setOutput("issue_url", context.payload.issue?.html_url || ""); core.setOutput("comment_body", body); - name: Checkout repository if: steps.detect.outputs.hit == 'true' uses: actions/checkout@v4 # Node v20+ is needed for Cline CLI on GitHub Actions Linux - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22' cache: 'npm' - name: Install Cline CLI if: steps.detect.outputs.hit == 'true' run: npm install -g cline - name: Configure Cline Authentication if: steps.detect.outputs.hit == 'true' env: CLINE_DIR: ${{ runner.temp }}/cline run: | # Configure API key using the auth command cline auth --provider openrouter --apikey "${{ secrets.OPENROUTER_API_KEY }}" - name: Download analyze script if: steps.detect.outputs.hit == 'true' run: | export GITORG="YOUR-GITHUB-ORG" export GITREPO="YOUR-GITHUB-REPO" curl -L https://raw.githubusercontent.com/${GITORG}/${GITREPO}/refs/heads/main/git-scripts/analyze-issue.sh -o analyze-issue.sh chmod +x analyze-issue.sh - name: Run analysis if: steps.detect.outputs.hit == 'true' id: analyze env: ISSUE_URL: ${{ steps.detect.outputs.issue_url }} COMMENT: ${{ steps.detect.outputs.comment_body }} run: | set -euo pipefail RESULT=$(./analyze-issue.sh "${ISSUE_URL}" "Analyze this issue. The user asked: ${COMMENT}") { echo 'result<> "$GITHUB_OUTPUT" - name: Post response if: steps.detect.outputs.hit == 'true' uses: actions/github-script@v7 env: ISSUE_NUMBER: ${{ steps.detect.outputs.issue_number }} RESULT: ${{ steps.analyze.outputs.result }} with: script: | await github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: Number(process.env.ISSUE_NUMBER), body: process.env.RESULT || "(no output)" }); ``` **You MUST edit the workflow file before committing!** Open `.github/workflows/cline-responder.yml` and update the "Download analyze script" step within the workflow to specify your GitHub organization and repository where the analysis script is stored: ```yaml theme={"system"} export GITORG="YOUR-GITHUB-ORG" # Change this! export GITREPO="YOUR-GITHUB-REPO" # Change this! ``` **Example:** If your repository is `github.com/acme/myproject`, set: ```yaml theme={"system"} export GITORG="acme" export GITREPO="myproject" ``` This tells the workflow where to download the analysis script from your repository after you commit it in step 3. The workflow will look for new or updated issues, check for `@cline` mentions, and then start up the Cline CLI to dig into the issue, providing feedback as a reply to the issue. ### 2. Configure API Keys Add your AI provider API keys as repository secrets: 1. Go to your GitHub repository 2. Navigate to **Settings** → **Environment** and Add a new environment. Navigate to Actions secrets Make sure to name it "cline-actions" so that it matches the `environment` value at the top of the `cline-responder.yml` file. 3. Click **New repository secret** 4. Add a secret for the `OPENROUTER_API_KEY` with a value of an API key from [openrouter.com](https://openrouter.com). Add API key secret 5. Verify your secret is configured: API key configured Now you're ready to supply Cline with the credentials it needs in a GitHub Action. ### 3. Add Analysis Script Add the analysis script from the `github-issue-rca` sample to your repository. **First, you'll need to create a `git-scripts` directory in your repository root where the script will be located.** Choose one of these options: **Option A: Download directly (Recommended)** ```bash theme={"system"} # In your repository root, create the directory and download the script mkdir -p git-scripts curl -o git-scripts/analyze-issue.sh https://raw.githubusercontent.com/cline/cline/main/src/samples/cli/github-issue-rca/analyze-issue.sh chmod +x git-scripts/analyze-issue.sh ``` **Option B: Manual copy-paste** Create the directory and file manually, then paste the script content: ```bash theme={"system"} # In your repository root mkdir -p git-scripts # Create and edit the file with your preferred editor nano git-scripts/analyze-issue.sh # or use vim, code, etc. ``` ```bash theme={"system"} #!/bin/bash # Analyze a GitHub issue using Cline CLI if [ -z "$1" ]; then echo "Usage: $0 [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?'" exit 1 fi # Gather the args ISSUE_URL="$1" PROMPT="${2:-What is the root cause of this issue?}" # Ask Cline for its analysis, showing only the summary 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' ``` After pasting the script content, make it executable: ```bash theme={"system"} chmod +x git-scripts/analyze-issue.sh ``` This analysis script calls Cline to execute a prompt on a GitHub issue, summarizing the output to populate the reply to the issue. ### 4. Commit and Push ```bash theme={"system"} git add .github/workflows/cline-responder.yml git add git-scripts/analyze-issue.sh git commit -m "Add Cline issue assistant workflow" git push ``` ## Usage Once set up, simply mention `@cline` in any issue comment: ```text theme={"system"} @cline what's causing this error? @cline analyze the root cause @cline what are the security implications? ``` 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 auto-approval enabled 5. Post Cline's analysis as a new comment **Note**: The workflow only triggers on issue comments, not pull request comments. ## How It Works 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 auth --provider openrouter --apikey ...` 5. **Downloads** the reusable `analyze-issue.sh` script from the `github-issue-rca` sample 6. **Runs** analysis in Cline CLI 7. **Posts** the analysis result as a comment ## Related Samples * **[github-issue-rca](./github-issue-rca)**: The reusable script that powers this integration # GitHub Issue RCA Sample Source: https://docs.cline.bot/cli/samples/github-issue-rca Automated GitHub issue analysis using Cline CLI to identify root causes. 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. **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. CLI Root Cause Analysis Demo ## Prerequisites This sample assumes you have already: * **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 Additionally, you'll need: * **GitHub CLI** (`gh`) installed and authenticated * **jq** installed for JSON parsing * **bash** shell (or compatible shell) ### Installation Instructions #### macOS These instructions require [Homebrew](https://brew.sh/) to be installed. If you don't have Homebrew, install it first by running: ```bash theme={"system"} /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ```bash theme={"system"} # Install GitHub CLI brew install gh # Install jq brew install jq # Authenticate with GitHub gh auth login ``` #### Linux ```bash theme={"system"} # Install GitHub CLI (Debian/Ubuntu) sudo apt install gh # Or for other Linux distributions, see: https://cli.github.com/manual/installation # Install jq (Debian/Ubuntu) sudo apt install jq # Authenticate with GitHub gh auth login ``` ## Getting the Script **Option 1: Download directly with curl** ```bash theme={"system"} curl -O https://raw.githubusercontent.com/cline/cline/main/src/samples/cli/github-issue-rca/analyze-issue.sh ``` **Option 2: Copy the full script** ```bash theme={"system"} #!/bin/bash # Analyze a GitHub issue using Cline CLI if [ -z "$1" ]; then echo "Usage: $0 [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?'" exit 1 fi # Gather the args ISSUE_URL="$1" PROMPT="${2:-What is the root cause of this issue?}" # Ask Cline for its analysis, showing only the summary 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' ``` **After downloading or creating the script**, make it executable by running: ```bash theme={"system"} chmod +x analyze-issue.sh ``` ## Quick Usage Examples ### Basic Usage Run this command in your terminal from the directory where you saved the script to analyze an issue with the default root cause prompt: ```bash theme={"system"} ./analyze-issue.sh https://github.com/owner/repo/issues/123 ``` This will: * Fetch issue #123 from the repository * Analyze the issue to identify root causes * Provide detailed analysis with recommendations ### Custom Analysis Prompt Ask specific questions about the issue: ```bash theme={"system"} ./analyze-issue.sh https://github.com/owner/repo/issues/456 "What is the security impact?" ``` 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. ## How It Works Let's analyze each component of the script to understand how it works. ### Argument Validation The script validates input and provides usage instructions: ```bash theme={"system"} if [ -z "$1" ]; then echo "Usage: $0 [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?'" exit 1 fi ``` **Key Points:** * Validates required GitHub issue URL * Shows clear usage examples * Supports optional custom prompt ### Argument Parsing The script extracts and sets up the arguments: ```bash theme={"system"} # Gather the args ISSUE_URL="$1" PROMPT="${2:-What is the root cause of this issue?}" ``` **Explanation:** * `ISSUE_URL="$1"` - First argument is always the issue URL * `PROMPT="${2:-...}"` - Second argument is optional, defaults to root cause analysis * The SDK CLI runs the task directly, so no address flag is required. ### The Core Analysis Pipeline This is where the magic happens: ```bash theme={"system"} # Ask Cline for its analysis, showing only the summary 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' ``` **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. `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) **3. `sed 's/\\n/\n/g'`** * Converts escaped newlines to actual newlines * Makes output readable ## Sample Output Here's an example analyzing a real Flutter issue: ```bash theme={"system"} $ ./analyze-issue.sh https://github.com/csells/flutter_counter/issues/2 ``` **Output:** ```markdown theme={"system"} **Root Cause Analysis of Issue #2: "setState isn't cutting it"** After examining the GitHub issue and analyzing the Flutter counter codebase, I've identified the root cause of why setState() is insufficient for this project's needs: ## Current Implementation Problems The current Flutter counter app uses setState() for state management, which has several limitations: 1. **Local State Only**: setState() only works within a single widget, making it difficult to share state across the app 2. **Rebuild Overhead**: Every setState() call rebuilds the entire widget tree, causing performance issues with complex UIs 3. **No State Persistence**: State is lost when the widget is disposed 4. **Testing Challenges**: setState-based logic is tightly coupled to the UI, making unit testing difficult ## Why This Matters As the app grows beyond a simple counter, these limitations become critical: - Multiple screens need to access the count - State needs to persist across navigation - Business logic should be testable independently - UI should only rebuild when necessary ## Recommended Solutions The issue mentions "Provider or Bloc" - both are excellent alternatives: 1. **Provider**: Simple, lightweight state management using InheritedWidget - Easy migration path from setState - Good for small to medium apps - Official Flutter recommendation 2. **Bloc**: More structured approach with clear separation between events, states, and business logic - Better for complex apps - Excellent testability - Clear architectural patterns 3. **Riverpod**: Modern alternative to Provider with better performance and developer experience - Compile-time safety - Better testing support - More flexible than Provider 4. **GetX**: Full-featured solution with state management, routing, and dependency injection - Minimal boilerplate - Fast and lightweight - All-in-one solution ## Next Steps The current codebase needs refactoring to implement proper state management architecture to handle more complex state scenarios effectively. Provider would be the easiest migration path while Bloc provides better long-term scalability. ``` ## When to Use This Pattern This script pattern is ideal for various development scenarios where automated GitHub issue analysis can accelerate your workflow. ### Bug Investigation Quickly analyze bug reports and identify root causes without manual code exploration: ```bash theme={"system"} ./analyze-issue.sh https://github.com/project/repo/issues/123 \ "What is the root cause of this bug?" ``` ### Feature Request Analysis Understand context and implications of feature requests: ```bash theme={"system"} ./analyze-issue.sh https://github.com/project/repo/issues/456 \ "What are the implementation challenges?" ``` ### Security Audits Assess security implications of reported issues: ```bash theme={"system"} ./analyze-issue.sh https://github.com/project/repo/issues/789 \ "What are the security implications?" ``` ### Documentation Generation Generate detailed technical documentation from issues: ```bash theme={"system"} ./analyze-issue.sh https://github.com/project/repo/issues/654 \ "Provide detailed technical documentation for this issue" ``` ### Code Review Assistance Get second opinions on proposed changes: ```bash theme={"system"} ./analyze-issue.sh https://github.com/project/repo/issues/987 \ "Review the proposed solution approach" ``` ## Conclusion This sample demonstrates how to build an autonomous GitHub issue analysis tool using Cline CLI: 1. **Building autonomous CLI tools** using Cline's capabilities 2. **Parsing structured JSON output** from Cline CLI 3. **Creating flexible automation scripts** with custom prompting 4. **Integrating with GitHub** for issue analysis 5. **Handling command-line arguments** effectively This pattern can be adapted for many other automation scenarios, from pull request reviews to documentation generation to code quality analysis. ## Related Resources * [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) # GitHub PR Review Source: https://docs.cline.bot/cli/samples/github-pr-review Automatically review Pull Requests with AI using Cline CLI in GitHub Actions. Automate code review for every Pull Request. Detailed analysis, security checks, and code suggestions provided by Cline running autonomously in GitHub Actions. ## The Workflow When a PR is opened or marked ready for review, this workflow: 1. **Checks out** the code. 2. **Installs** Node.js and Cline CLI. 3. **Configures** authentication (e.g., Anthropic, OpenAI). 4. **Runs Cline** with a comprehensive system prompt to analyze the diff, context, and related issues using GitHub CLI (`gh`). 5. **Posts** a detailed review comment with inline code suggestions. ## Prerequisites * **GitHub repository** with Actions enabled. * **AI Provider API Key** (e.g., Anthropic, OpenRouter) added as a repository secret (e.g., `ANTHROPIC_API_KEY`). * **GitHub Token** (automatically provided by Actions as `GITHUB_TOKEN`). ## Setup ### 1. Create the Workflow File Create a file named `.github/workflows/cline-pr-review.yml` in your repository: ````yaml theme={"system"} name: Cline PR Code Review on: pull_request: types: [opened, ready_for_review] workflow_dispatch: inputs: pr_number: description: "PR number to review" required: true type: string concurrency: group: pr-review-${{ github.event.pull_request.number || inputs.pr_number }} cancel-in-progress: true jobs: cline-pr-review: if: | (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest timeout-minutes: 60 permissions: contents: read pull-requests: write issues: read steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 22 cache: "npm" - name: Install Cline CLI run: npm install -g cline - name: Configure Cline Authentication # Replace 'anthropic' with your provider of choice (openai, openrouter, etc.) # and ensure the corresponding secret is set in your repo settings. run: | cline auth --provider anthropic \ --apikey "${{ secrets.ANTHROPIC_API_KEY }}" \ --modelid claude-opus-4-5-20251101 - name: Get PR number id: pr run: | if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then echo "number=${{ inputs.pr_number }}" >> $GITHUB_OUTPUT else echo "number=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT fi - name: Review PR with Cline env: PR_NUMBER: ${{ steps.pr.outputs.number }} GITHUB_REPO: ${{ github.repository }} GH_TOKEN: ${{ github.token }} # Restrict Cline to only safe, read-only GitHub CLI commands CLINE_COMMAND_PERMISSIONS: | { "allow": [ "gh pr diff *", "gh pr view *", "gh pr checks *", "gh pr list *", "gh issue list *", "gh issue view *", "git log *", "gh pr comment ${{ steps.pr.outputs.number }} *", "gh api repos/${{ github.repository }}/pulls/${{ steps.pr.outputs.number }}/comments *", "gh api repos/${{ github.repository }}/pulls/${{ steps.pr.outputs.number }}/reviews *" ] } run: | 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}"' ## Gather context Use `gh` commands to fetch the PR diff, details, and checks. ```bash # Get full PR details gh pr view '"${PR_NUMBER}"' --json number,title,body,author,createdAt,updatedAt,isDraft,labels,commits,files,additions,deletions,changedFiles,baseRefName,headRefName,mergeable,reviewDecision # Get the diff gh pr diff '"${PR_NUMBER}"' # Check CI status gh pr checks '"${PR_NUMBER}"' ```` ## Deep code review Analyze the code changes. Look for: * Logic errors and edge cases * Security vulnerabilities * Performance issues * adherence to patterns in the codebase ## Submit Review Post a single comprehensive comment summarizing your review. If you have specific code suggestions, use the GitHub API to post inline comments: ```bash theme={"system"} gh api repos/'"${GITHUB_REPO}"'/pulls/'"${PR_NUMBER}"'/reviews \ -X POST \ -f event="COMMENT" \ -f body="" \ -F comments='[{"path": "src/file.ts", "line": 10, "body": "Suggestion: ..."}]' ``` Start your main comment with "Reviewed by Cline".' ```` ### 2. Configure Secrets 1. Go to your repository settings -> **Secrets and variables** -> **Actions**. 2. Add a **New repository secret**. 3. Name: `ANTHROPIC_API_KEY` (or match the key used in your workflow). 4. Value: Your actual API key. ## Key Components Explained ### Permissions ```yaml permissions: contents: read pull-requests: write issues: read ```` We grant `pull-requests: write` so Cline can post comments and inline reviews. `contents: read` ensures it can analyze the code but **cannot push changes directly**, providing a security boundary. ### Authentication ```bash theme={"system"} 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 (`--auto-approve true`) ```bash theme={"system"} cline --auto-approve true '...' ``` 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. ## Customizing the Reviewer The "System Prompt" passed to Cline in the final step is fully customizable. You can modify it to: * Enforce specific style guides. * Focus on security vs. performance. * Ask for specific types of feedback (e.g., "Roast my code" vs. "Be gentle"). # Model Orchestration Source: https://docs.cline.bot/cli/samples/model-orchestration Use multiple AI models strategically: optimize costs, reduce bias, and leverage model-specific strengths in your workflows Cline CLI's `--config` and `--thinking` flags enable sophisticated multi-model workflows. Instead of using a single model for all tasks, you can route different work to different models based on cost, capability, and specialization. ## Why Orchestrate Multiple Models? **Cost Optimization** By routing work to the right model for the job, you can dramatically reduce API costs. Fast, inexpensive models like Haiku and Gemini Flash handle simple tasks such as summarization, while expensive models like Opus and O1 are reserved for complex reasoning and planning. This approach can reduce costs by 10-100x on routine operations. **Bias Reduction** Different models catch different issues, so cross-validating solutions with multiple AI perspectives helps reduce blind spots that come from relying on a single model. In code reviews especially, combining viewpoints surfaces problems that any one model might miss. **Specialization** Certain models excel in specific domains: Codex and DeepSeek are strong at code generation, while GPT-4 and Claude shine at documentation and prose. Security analysis in particular benefits from combining multiple model viewpoints, since each brings different training data and heuristics to the table. ## Pattern 1: CI/CD Code Review See our production GitHub Actions workflow that uses Cline CLI for automated PR reviews: [cline-pr-review.yml](https://github.com/cline/cline/blob/main/.github/workflows/cline-pr-review.yml) **Key capabilities demonstrated:** * **Automated inline suggestions**: Creates GitHub suggestion blocks that authors can commit with one click * **SME identification**: Analyzes git history to find subject matter experts for each file * **Related issue discovery**: Searches for context from past issues and PRs * **Security-first permissions**: Read-only codebase access, can only post reviews * **Deep code analysis**: Understands intent, compares approaches, identifies edge cases The workflow runs on every PR and provides maintainers with comprehensive context to make faster, more informed decisions. ## Pattern 2: Task Phase Optimization Use different models for different phases of work. Route simple tasks to cheap models, complex reasoning to premium models. ### Example: Issue Analysis Pipeline ```bash theme={"system"} # Get latest issue content 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 --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 --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 --auto-approve true --config ~/.cline-sonnet \ "implement the plan from above" ``` 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. **Cost impact:** * Haiku: \$0.80 per million input tokens * Opus: \$15 per million input tokens * Sonnet: \$3 per million input tokens This pattern uses Opus only when needed for complex reasoning, saving \~10x on API costs compared to using Opus for everything. ### Setting Up Model Configs Create separate configuration directories for each model: ```bash theme={"system"} # Create config directories mkdir -p ~/.cline-haiku ~/.cline-sonnet ~/.cline-opus # Configure each with different models cline --config ~/.cline-haiku auth anthropic --modelid claude-haiku-4-20250514 cline --config ~/.cline-sonnet auth anthropic --modelid claude-sonnet-4-20250514 cline --config ~/.cline-opus auth anthropic --modelid claude-opus-4-5-20251101 # Or use different providers entirely cline --config ~/.cline-gemini auth gemini --modelid gemini-2.0-flash-exp cline --config ~/.cline-codex auth openai-codex --modelid gpt-5-latest ``` Now you can switch models per-task with `--config`: ```bash theme={"system"} cline --config ~/.cline-haiku "quick task" cline --config ~/.cline-opus "complex reasoning task" ``` ## Pattern 3: Multi-Model Review & Consensus Get multiple AI perspectives on the same change, then synthesize their feedback. ### Example: Diff Review Pipeline ```bash theme={"system"} # Get the latest commit DIFF=$(git show) # Review 1: Gemini's perspective 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 --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 --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 --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" ``` **Why this works:** * **Redundancy**: Issues caught by all 3 models are high-confidence * **Coverage**: Each model has blind spots; together they cover more ground * **Prioritization**: Consensus issues should be fixed first * **Learning**: See which model types catch which issue types ### Advanced: Parallel Reviews Run reviews in parallel for faster feedback: ```bash theme={"system"} # Run all reviews simultaneously 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 --auto-approve true "create consensus review" ``` Parallel execution requires managing multiple Cline instances. See [Multi-instance workflows](/usage/cli-overview#automation-patterns) for details. ## Extended Thinking for Complex Tasks Use the `--thinking` flag when Cline needs to analyze multiple approaches: ```bash theme={"system"} # Without thinking: Fast but may miss nuances cline --auto-approve true "refactor this codebase" # With thinking: Slower but more thorough cline --auto-approve true --thinking high \ "refactor this codebase - consider: performance, maintainability, backward compatibility" ``` The `--thinking ` 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 * Multi-step planning ## Best Practices 1. **Profile your workload**: Track which tasks are simple vs. complex 2. **Match models to tasks**: Use fast models for summaries, powerful models for reasoning 3. **Automate switching**: Script model selection based on task type 4. **Monitor costs**: Different models have 10-100x price differences 5. **Validate important decisions**: Use multi-model consensus for critical changes ## Production Examples ### Cost-Optimized PR Review ```bash theme={"system"} # Haiku: Quick summary and issue identification 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 --auto-approve true --thinking high --config ~/.cline-opus \ "analyze these issues and recommend fixes" fi ``` ### Security-Focused Multi-Model Scan ```bash theme={"system"} # Different models have different security perspectives 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 --auto-approve true "find security issues all 3 reviews mentioned" ``` ## Related Documentation Complete documentation for --config and --thinking flags Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows. Fastest built-in model access setup and account workflow Automate GitHub workflows with Cline CLI # Supply-Chain Scan Alerts Source: https://docs.cline.bot/cli/samples/supply-chain-alerts Schedule the Cline CLI to scan your machine for compromised packages with Bumblebee and text you on Telegram when it finds one. npm worms like Shai-Hulud spread through install scripts: the moment you run `npm install`, a `preinstall` hook executes and steals your npm, GitHub, AWS, and SSH credentials. New campaigns are reported almost every week. This guide wires three pieces together so your machine checks itself automatically and pings your phone only when it matters: * [Bumblebee](https://github.com/perplexityai/bumblebee), Perplexity's open-source, read-only supply-chain scanner. It maintains catalogs of recent campaigns and checks whether any compromised package or version is present on disk. * The Cline CLI scheduler, which runs an agent on a cron schedule. * The Cline CLI Telegram connector, which delivers the result to a chat. The end result: every morning, a Cline agent pulls the latest threat intelligence, runs a read-only scan, and texts you a green check if you are clean or a red alert with details if you are exposed. ```mermaid theme={"system"} flowchart TD cron["cline schedule (daily)"] --> agent["Cline agent"] agent --> pull["git pull (latest catalogs)"] agent --> scan["bumblebee scan (read-only)"] scan --> q{"any findings?"} q -- "no" --> clean["✅ Clean"] q -- "yes" --> alert["🚨 Compromise detected"] clean --> tg["Telegram on your phone"] alert --> tg ``` ## How Bumblebee works Bumblebee answers one narrow question fast: when an advisory names a package and version, is it present on this machine right now? The important design choice is that it is read-only. A scanner that runs `npm`, `pnpm`, or `pip` to enumerate your dependencies would trigger the very install-script payload it is looking for. Bumblebee never does that. It only reads metadata files directly: | Surface | What it reads | | ----------------------- | ------------------------------------------------------------- | | npm / pnpm / yarn / bun | lockfiles and installed `package.json` metadata | | PyPI | `*.dist-info/METADATA`, `*.egg-info/PKG-INFO` | | Go modules | `go.sum`, `go.mod` | | RubyGems | `Gemfile.lock`, installed gemspecs | | Composer | `composer.lock`, `vendor/composer/installed.json` | | MCP servers | `mcp.json`, `claude_desktop_config.json`, and similar configs | | Editor extensions | VS Code-family extension manifests | | Browser extensions | Chromium-family and Firefox extension manifests | It never runs package managers, never executes install scripts or lifecycle hooks, and never reads your application source. It ships no bundled threat intelligence either: you point it at an exposure catalog, and it reports exact `(ecosystem, name, version)` matches. The catalogs live in the repo under `threat_intel/`, maintained by Perplexity and updated via pull requests as new campaigns are reported. That is why this automation simply pulls the latest before each scan: a `git pull` is all it takes to stay current. Read the announcement: [Perplexity is open-sourcing Bumblebee](https://www.perplexity.ai/hub/blog/perplexity-is-open-sourcing-bumblebee). ## Prerequisites * Node.js 22 or newer (for the Cline CLI). * Go 1.22 or newer (to build Bumblebee). * A Telegram account. * An AI provider key, or a Cline account. ## 1. Install the Cline CLI ```bash theme={"system"} npm install -g cline cline # run once to configure inference provider and model ``` ## 2. Clone and build Bumblebee Clone the repository somewhere stable. The clone is both the scanner and the catalog source, so the scheduled job will run from inside it. ```bash theme={"system"} mkdir -p ~/tools git clone https://github.com/perplexityai/bumblebee.git ~/tools/bumblebee cd ~/tools/bumblebee go build -o bumblebee ./cmd/bumblebee ``` Confirm it works with the built-in self test, which runs embedded fixtures and makes no network calls: ```bash theme={"system"} ./bumblebee selftest # selftest OK (2 findings in 1ms) ``` ## 3. Run a scan manually Point `--exposure-catalog` at the whole `threat_intel/` directory to use every maintained catalog at once. The `--findings-only` flag suppresses the full inventory so you only get matches. ```bash theme={"system"} cd ~/tools/bumblebee ./bumblebee scan --profile deep --root "$HOME" \ --exposure-catalog ./threat_intel/ \ --findings-only ``` Output is NDJSON, one JSON object per line. A match looks like this: ```json theme={"system"} { "record_type": "finding", "severity": "critical", "ecosystem": "npm", "package_name": "example-pkg", "version": "1.2.3", "source_file": "/Users/you/code/app/pnpm-lock.yaml", "evidence": "exact name+version match (version=1.2.3)" } ``` If you are clean, you get no `finding` records. Exit code is `0` on a successful run, `1` if the scan hit errors, `2` for bad arguments. Scan profiles control where Bumblebee looks. `baseline` checks standard global tool, editor, and browser locations. `project` scans your development directories (pass `--root ~/code`). `deep` walks whatever roots you give it, typically your whole home directory. Use `deep` for the most thorough "am I exposed anywhere" check, or `project` for a faster daily scan of your repos. ## 4. Create a Telegram bot and start the connector Open Telegram, start a chat with [@BotFather](https://t.me/BotFather), send `/newbot`, and follow the prompts. Copy the bot token it gives you (it looks like `7123456789:AAH...`). Treat it like a password. Run the connector and point its working directory at your Bumblebee clone, so the scheduled agent runs there: ```bash theme={"system"} cline connect telegram -k "" --cwd ~/tools/bumblebee ``` Leave this process running. It polls Telegram and delivers scheduled results, so it must stay alive. In Telegram, search for your bot's username and send it any message (for example `/whereami`). This creates the thread binding that delivery needs. By default, anyone who finds your bot can message it and it will run tasks on your machine. Lock it down before leaving the connector running. The `cline connect` wizard can guide you through Telegram user ID setup, or you can message [@userinfobot](https://t.me/userinfobot) and restart the connector with your allowed user ID: ```bash theme={"system"} cline connect telegram -k "" --cwd ~/tools/bumblebee \ --allowed-user-id 12345 ``` Replace `12345` with your Telegram user ID. ## 5. Schedule the scan There are two ways to create the scheduled scan. Both run the same agent and deliver the result to Telegram, so pick whichever you prefer. ### Option A: From the Telegram chat Creating the schedule from the chat automatically targets that thread for delivery, so results come straight back to you. Send this to your bot as a single message: ```text theme={"system"} /schedule create "supply-chain-watch" --cron "0 8 * * *" --prompt "Pull the latest Bumblebee catalogs and scan this machine for compromised packages. Run: git pull --quiet && go build -o bumblebee ./cmd/bumblebee && ./bumblebee scan --profile deep --root $HOME --exposure-catalog ./threat_intel/ --findings-only. Read the NDJSON output. If any line has record_type set to finding, reply starting with '🚨 COMPROMISE DETECTED' and list each package name, version, ecosystem, and source_file. If there are no findings, reply with exactly '✅ Clean: no compromised packages found.'" ``` The bot replies with the new schedule, including its id. ### Option B: From your terminal Create the schedule with the Cline CLI on the same machine and pass the delivery method explicitly. The running Telegram connector delivers the result to its chat: ```bash theme={"system"} cline schedule create "supply-chain-watch" \ --cron "0 8 * * *" \ --workspace ~/tools/bumblebee \ --delivery-adapter telegram \ --delivery-bot \ --prompt "Pull the latest Bumblebee catalogs and scan this machine for compromised packages. Run: git pull --quiet && go build -o bumblebee ./cmd/bumblebee && ./bumblebee scan --profile deep --root \$HOME --exposure-catalog ./threat_intel/ --findings-only. Read the NDJSON output. If any line has record_type set to finding, reply starting with '🚨 COMPROMISE DETECTED' and list each package name, version, ecosystem, and source_file. If there are no findings, reply with exactly '✅ Clean: no compromised packages found.'" ``` Either way, this schedules a daily scan at 8am. ## Why the green check matters Scheduled delivery always sends the run's final reply, so the prompt is written to make that reply meaningful either way: * Clean run: one line, `✅ Clean: no compromised packages found.` You get a daily heartbeat confirming the scan actually ran. * Exposure: `🚨 COMPROMISE DETECTED` followed by the package, version, and the file where it was found, so you can act immediately (rotate credentials, remove the package, pin a safe version). ## Test it Trigger the scan now instead of waiting for 8am. First find your schedule id. The create step returns it (the Telegram bot's reply shows `id=...`), or list your schedules at any time: ```bash theme={"system"} cline schedule list ``` Then trigger it with that id. From the terminal: ```bash theme={"system"} cline schedule trigger ``` Or from Telegram: `/schedule trigger `. Within a few seconds you should get the result in your chat. To see a real alert, add a package and version that matches a catalog entry to a throwaway project's lockfile and run the scan against it. Bumblebee reports the match, and the agent texts you the red alert. ## Keep it running * The connector process (`cline connect telegram`) must stay running for delivery to work. Run it under a process manager (systemd, launchd, `pm2`, or a `tmux`/`screen` session) so it survives reboots. * The hub runs the schedule and starts automatically when you create one. If it is not running, start it with `cline hub start`. * Manage schedules anytime with `cline schedule list`, `cline schedule pause `, `cline schedule resume `, and `cline schedule delete `. ## Customize * Cadence: change the cron expression. `0 */6 * * *` scans every six hours; `0 8 * * MON-FRI` runs on weekdays only. * Scope: swap `--profile deep --root $HOME` for `--profile project --root ~/code` for a faster scan of just your repos, or `--profile baseline` for global tools, editors, and browser extensions. * Channels: the same delivery pattern works for Slack, Discord, WhatsApp, and Google Chat. See [Connectors](/cli/connectors). * Fleet use: Bumblebee can `POST` NDJSON to an ingest endpoint with `--output http --http-url ` if you want to centralize findings across many machines. ## Credits Bumblebee is built and open-sourced by Perplexity. See the [announcement](https://www.perplexity.ai/hub/blog/perplexity-is-open-sourcing-bumblebee) and the [repository](https://github.com/perplexityai/bumblebee). # Scheduling Source: https://docs.cline.bot/cli/scheduling Run agents on cron schedules for recurring automations like daily summaries and code reviews. This feature currently only applies to Cline SDK, CLI, and Kanban. This feature is not applicable on VSCode and JetBrains Extension for now. 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 theme={"system"} 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 theme={"system"} 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 theme={"system"} cline schedule list cline schedule trigger cline schedule pause cline schedule resume cline schedule delete cline schedule executions ``` ## 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 theme={"system"} 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 theme={"system"} 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 theme={"system"} 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 theme={"system"} cline connect telegram -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. # Cline Overview Source: https://docs.cline.bot/cline-overview 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. ## Model access Choose the model access path that fits your workflow: Fastest setup path with one sign-in, built-in billing, and free model options. Flat \$9.99/month subscription that offers 2-5x the usage on popular open coding models compared to standard API rate. Use your own provider credentials for cloud providers or local runtimes. ## Applications These are end-user applications built on top of Cline's agent core: Run Cline in your terminal with interactive chat or fully headless automation for CI/CD and scripting. `npm i -g cline` Run many agents in parallel from a web-based task board with per-card worktrees, auto-commit, and dependency chains. `npx kanban` AI coding assistant in your editor. Create files, run commands, browse the web, and use tools with human-in-the-loop approval. The same Cline experience in IntelliJ IDEA, PyCharm, WebStorm, GoLand, and the rest of the JetBrains family. ## 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. 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` ## Other IDE Supports Cline works across all major editors: **VS Code**, **Cursor**, **Windsurf**, **JetBrains** (IntelliJ, PyCharm, WebStorm), **Antigravity**, and **Zed**, **Neovim** via [ACP mode](/usage/acp). ## Enterprise Solutions SSO, role-based access control, model and tool controls per team, and remote configuration. OpenTelemetry, Datadog, Grafana, Splunk integrations with real-time analytics. Manage members, roles, and permissions across your organization. Programmatic access to Cline's enterprise features. # Checkpoints Source: https://docs.cline.bot/core-workflows/checkpoints Roll back code changes while keeping your conversation. Experiment freely. Checkpoints let you undo code changes without losing your conversation. Every time Cline modifies a file or runs a command, it saves a snapshot of your project files. You can restore to any checkpoint, keeping the context you've built while reverting the code. This changes how you work with Cline. Instead of carefully reviewing every change before approving, you can let Cline move fast and roll back if something goes wrong. The cost of a mistake drops to nearly zero. Checkpoints are enabled by default. See [Enable or Disable Checkpoints](#enable-or-disable-checkpoints) if you need to turn them off. ## How It Works Cline maintains a shadow Git repository separate from your project's actual Git history. After each tool use (file edits, commands, etc.), Cline commits the current state of your files to this shadow repo. Your main Git repository stays untouched. This means: * Your Git history remains clean and under your control * Checkpoints capture everything, including files not tracked by Git * You can restore to any point in a task without affecting commits you've made * Checkpoints persist across editor sessions Each checkpoint captures the complete file state at that moment. If Cline edits three files in sequence, you get three checkpoints and can restore to any of them independently. ## Enable or Disable Checkpoints Checkpoints are enabled by default. To toggle them: 1. Open Cline settings (gear icon in the Cline sidebar) 2. Scroll to the "Feature Settings" section 3. Toggle "Enable Checkpoints" For very large repositories, checkpoints may use significant storage and slow down Cline as it commits file snapshots after each tool use. Consider disabling them if you notice performance issues. ## Viewing and Comparing Changes After each tool use, a checkpoint indicator appears in your conversation. Look for a bookmark icon labeled "Checkpoint" with a dotted line connecting to **Compare** and **Restore** buttons. Click **Compare** to open a diff view showing exactly what changed at that checkpoint. This opens in your editor's diff viewer, letting you see additions, deletions, and modifications across all affected files. This is useful when Cline makes changes you want to understand before deciding whether to keep them. You can review the diff, then either continue or restore to undo. ## Restoring Checkpoints Click **Restore** next to any step to open the restore menu. You have three options: | Option | What It Does | When to Use It | | ------------------------ | --------------------------------------------------------------- | ---------------------------------------------------- | | **Restore Files** | Reverts your project's files to the snapshot at this checkpoint | Undoing code changes while keeping the conversation | | **Restore Task Only** | Deletes messages after this point, does not affect files | Trying a different prompt while keeping current code | | **Restore Files & Task** | Reverts files and deletes messages after this point | Starting over completely from a known good state | The right choice depends on what went wrong: * If the conversation is productive but the code changes broke something, use **Restore Files**. Cline keeps all the context you've discussed and can try a different implementation. * If Cline's code changes are good but the conversation went off track, use **Restore Task Only**. You keep the files and can guide the conversation differently. * If you want to start over from a clean slate, use **Restore Files & Task**. This resets both your files and the conversation to that checkpoint. ## When to Use Checkpoints | Scenario | Recommended Action | | ------------------------------------------ | ------------------------------------------------ | | Cline refactored code and broke something | Restore Files, ask for a different approach | | Experimenting with multiple solutions | Compare each checkpoint, restore to the best one | | Cline misunderstood your intent | Restore Files & Task, rephrase your request | | Want to try a different prompt | Restore Task Only, keep the files, resubmit | | Reviewing changes before committing to Git | Use Compare to inspect, then commit manually | | Testing risky changes | Let Cline proceed, restore if it fails | ## Working with Auto-Approve Checkpoints make [auto-approve](/features/auto-approve) practical. Without checkpoints, auto-approve feels risky because Cline can make many changes before you notice a problem. With checkpoints, you can let Cline work autonomously and roll back if needed. A typical workflow: 1. Enable auto-approve for file edits and commands 2. Let Cline work through your task quickly 3. Review the final result 4. If something is wrong, restore to the last good checkpoint 5. Give Cline more specific guidance This approach is faster than reviewing every change individually, and checkpoints provide the safety net. ## Checkpoints and Message Editing The message editing feature integrates with checkpoints. When you edit a previous message and select "Restore All," Cline restores your files to the checkpoint at that point before resubmitting your edited message. This lets you fix a poorly worded prompt and undo all the changes that resulted from it in one action. # Plan & Act Mode Source: https://docs.cline.bot/core-workflows/plan-and-act Think first, then build. Cline's dual-mode system for structured development. Plan & Act modes separate thinking from doing. Plan mode lets you explore and strategize without changing files. Act mode executes against your plan. **New to Plan & Act?** Watch [Plan & Act Deep Dive](https://youtu.be/b7o6URFPp64) to see it in action. ## Plan Mode Plan mode is where you and Cline figure out what you're building and how. In this mode, Cline can read your codebase, run searches, and discuss strategy, but cannot modify any files or execute commands. This constraint is intentional. It keeps the conversation focused on understanding and planning, without the distraction of implementation details. You can explore freely, ask questions, and iterate on the approach before committing to changes. Use Plan mode to: * Explore unfamiliar codebases before making changes * Discuss architecture decisions and tradeoffs * Identify edge cases and potential issues upfront * Create a clear implementation strategy * Review code and understand complex workflows ## Act Mode Once you have a plan, switch to Act mode. Cline retains the full context from your planning session and can now modify files, run commands, and execute your strategy. The conversation history carries over when you switch modes. Cline remembers everything you discussed in Plan mode, so you don't need to repeat yourself. This makes the transition seamless. While you can start directly in Act mode, planning first is highly recommended. The planning phase intentionally builds context that Cline needs to implement changes effectively. Without it, Cline may lack the understanding required to make the right decisions. ## Typical Workflow 1. Start in Plan mode and describe what you want to build 2. Let Cline explore relevant files and understand the codebase 3. Discuss the approach, considering edge cases and potential issues 4. When confident in the plan, switch to Act mode 5. Cline implements the solution based on your planning session For complex projects, you may cycle between modes multiple times. Return to Plan mode when you hit unexpected complexity or need to rethink the approach, then switch back to Act mode to continue implementation. ## When to Use Each Mode | Scenario | Recommended Mode | | -------------------------------------------------------- | ---------------- | | Starting new features where the approach isn't obvious | Plan | | Debugging tricky issues where you're unsure what's wrong | Plan | | Making architectural decisions affecting multiple files | Plan | | Understanding complex workflows before modifying them | Plan | | Code review and security analysis | Plan | | Learning a new codebase | Plan | | Implementing a solution you've already planned | Act | | Making routine changes with a clear approach | Act | | Following established patterns in the codebase | Act | | Running tests and making adjustments | Act | | Quick fixes where the solution is obvious | Act | ## Using Different Models for Each Mode You can configure separate models for Plan and Act modes. This is useful when you want to use a stronger reasoning model for planning and a faster model for implementation. To enable this: 1. Open Cline Settings 2. Enable "Use different models for Plan and Act" 3. Select your preferred model for each mode When enabled, switching between Plan and Act mode automatically switches to the configured model for that mode. Your model selection is preserved when you switch back. **Example configurations:** | Use Case | Plan Mode | Act Mode | | ----------------- | -------------- | -------------- | | Cost optimization | GLM 4.6 | Grok Code Fast | | Maximum quality | Claude Opus | Claude Sonnet | | Speed-focused | Gemini 3 Flash | Cerebras | ## Using `/deep-planning` For complex tasks that need thorough analysis, use the `/deep-planning` slash command. This triggers an extended planning session where Cline: 1. Explores the codebase systematically 2. Identifies all affected files and dependencies 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 [/deep-planning](/core-workflows/using-commands#deep-planning) for more details. ## Choosing the Right Approach by Task Size ### Small tasks: Act mode only For quick fixes like typos, simple bug fixes, or following established patterns, start directly in Act mode. Planning adds overhead when the solution is obvious. **Examples:** Fix a typo, add a missing import, update a config value, rename a variable. ### Medium tasks: Plan → Act For most development work, start in Plan mode to understand the scope and approach, then switch to Act mode to implement. This is the sweet spot for features that touch a few files and have some complexity. **Examples:** Add a new API endpoint, implement a UI component, fix a bug that requires investigation, refactor a single module. ### Large tasks: Use `/deep-planning` For complex features that span multiple files, require architectural decisions, or will take multiple sessions to complete, use the `/deep-planning` slash command. This creates a detailed implementation plan that Cline can reference throughout the work. **Examples:** Add a new feature across frontend and backend, major refactoring across the codebase, implementing a new system or integration, multi-step migrations. ## Tips * Have Cline write a markdown file summarizing the plan for future reference * Use [file mentions](/core-workflows/working-with-files) to point Cline at relevant files during planning * Switch back to Plan mode when encountering unexpected complexity rather than pushing through * Enable [Checkpoints](/core-workflows/checkpoints) before Act mode so you can roll back if needed * For large tasks, ask Cline to create a todo list during planning that you can track in Act mode # Using Commands Source: https://docs.cline.bot/core-workflows/using-commands 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. **New to slash commands?** Watch our [quick video walkthrough](https://youtu.be/MxS5Jerpf-o) to see these commands in action. ## Slash Commands Type `/` in the chat input to see available slash commands: | Command | What It Does | | ---------------- | ---------------------------------------------------------------------- | | `/newtask` | Start fresh task with distilled context from current conversation | | `/smol` | Compress conversation history while preserving essential context | | `/newrule` | Create a rule file to teach Cline your preferences | | `/deep-planning` | Investigate codebase, plan thoroughly, then create implementation task | | `/reportbug` | Report a bug with diagnostic info | ### /newtask `/newtask` works like a developer handoff. It packages what matters (overall plan, work accomplished, relevant files, next steps) into a fresh task with a clean context window, leaving behind the noise of tool calls and implementation details. I use `/newtask` when working through complex implementations. If I've completed 3 steps of a 10-step process and my context is already 75% full, I use `/newtask` to extract key decisions, file changes, and progress without all the noise. ### /smol `/smol` (or its alias `/compact`) compresses your conversation history while preserving essential context. Unlike `/newtask` which creates a new task, `/smol` condenses your current conversation into a comprehensive summary, freeing up context window space while allowing you to continue working in the same task. Use `/smol` when you're deep into a debugging session or brainstorming and need to continue in the same task without losing the insights you've gained. For more details, see [Smol Command](#smol). ### /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 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). ### /deep-planning Transform Cline into a meticulous architect who investigates your codebase, asks clarifying questions, and creates a comprehensive implementation plan before writing any code. Deep planning follows a four-step process: 1. **Silent Investigation** - Cline explores your codebase structure and patterns 2. **Discussion** - Targeted questions about requirements and approach 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. ### /reportbug `/reportbug` collects diagnostic information and helps you report issues with Cline. It gathers relevant context like your configuration, recent errors, and system details to make bug reports more useful for the development team. Use `/reportbug` when you encounter unexpected behavior, crashes, or bugs you want to report. ## Skills via Slash Commands In addition to built-in commands, you can trigger enabled skills directly from chat using slash commands. * 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). # Adding Context Source: https://docs.cline.bot/core-workflows/working-with-files 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 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 a file or folder * Click the **+** button in the bottom left to browse files or images ## Quick Reference | What you want | Syntax | Example | | --------------- | ------------------- | ------------------- | | File content | `@/path/to/file` | `@/src/index.ts` | | Folder contents | `@/path/to/folder/` | `@/src/components/` | 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 Reference any file with `@/path/to/file`. Cline sees the complete file content, including imports, related functions, and surrounding context. ```text theme={"system"} Can you refactor the error handling in @/src/api/users.ts? ``` ## Folder Mentions Reference entire directories with `@/path/to/folder/` (note the trailing slash). Cline sees the folder structure and all file contents. ```text theme={"system"} 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` ## Drag & Drop Drag files directly into the chat input to add them to your conversation. In VS Code, hold **Shift** while dragging files into the chat input. Dragging workspace files automatically creates file mentions. You can also drag files from Finder or File Explorer directly into Cline. ### Supported File Types Cline supports text files from your workspace, plus images, PDFs, CSVs, and Excel files from your file system. Images require a multimodal model. Check the model selector to see which models support image inputs. ## Context Menu Commands Right-click on selected code to access Cline without typing. This is the fastest way to get help with specific code since it automatically includes the selected text and its file location as context. ### Code Editor Commands | Command | When to Use | | ---------------------- | ------------------------------------------------------------------------------------------------ | | **Add to Cline** | Ask questions about code, get suggestions, or start a conversation with specific code as context | | **Fix with Cline** | Quick fixes for errors, bugs, or issues in the selected code | | **Explain with Cline** | Understand unfamiliar code, complex logic, or code you're reviewing | | **Improve with Cline** | Get refactoring suggestions, performance improvements, or cleaner implementations | **Fix with Cline** also appears in the lightbulb menu (Quick Fix) when your cursor is on an error or warning, making it easy to fix issues inline. ### Terminal Commands Right-click in the terminal to "Add to Cline" and get help with: * Build errors and failed commands * Test failures and stack traces * Configuration issues * Any terminal output you need help interpreting ### Source Control Commands In the Source Control panel, use "Generate Commit Message" to create AI-powered commit messages from your staged changes. Cline analyzes the diff and writes a descriptive commit message following conventional commit patterns. # Rules Source: https://docs.cline.bot/customization/cline-rules Define specific instructions and coding standards for Cline. Rules are markdown files that provide persistent instructions across all conversations. Instead of repeating the same preferences every time you start a new task, rules let you define them once and have Cline follow them automatically. Use rules when you want Cline to: * Follow your team's coding standards (naming conventions, file organization, error handling patterns) * Understand project-specific context (tech stack, architecture decisions, dependencies) * Apply consistent documentation or testing requirements * Remember constraints like "don't modify files in /legacy" or "always use TypeScript" **New to Rules?** Watch [Cline Rules Explained](https://youtu.be/xQwsy2vkK5M) to see them in action. ## Supported Rule Types Cline recognizes rules from multiple sources, so you can use existing rule files from other tools: | Rule Type | Location | Description | | -------------- | ---------------------------------- | ------------------------------------------------------------------ | | Cline Rules | `.clinerules/` | Primary rule format | | Cursor Rules | `.cursorrules` | Automatically detected | | Windsurf Rules | `.windsurfrules` | Automatically detected | | AGENTS.md | `AGENTS.md`, `~/.agents/AGENTS.md` | [Standard format](https://agents.md/) for cross-tool compatibility | All detected rule types appear in the Rules panel, where you can toggle them individually. ## Where Rules Live Rules can be stored in two locations: your project workspace or globally on your system. **Workspace rules** go in `.clinerules/` at your project root. Use these for team standards, project-specific constraints, and anything you want to share with collaborators via version control. **Global rules** go in your system's Cline Rules directory. Use these for personal preferences that apply across all projects. Cline also reads cross-tool global AGENTS instructions from `~/.agents/AGENTS.md`. ```text theme={"system"} your-project/ ├── .clinerules/ # Workspace rules │ ├── coding.md # Coding standards │ ├── testing.md # Test requirements │ └── architecture.md # Structural decisions ├── src/ └── ... ``` 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](/getting-started/config#storage-locations) for more guidance. ### Global Rules Directory | Operating System | Default Location | | ---------------- | ------------------------- | | Windows | `Documents\Cline\Rules` | | macOS | `~/Documents/Cline/Rules` | | Linux/WSL | `~/Documents/Cline/Rules` | Linux/WSL users: If you don't find global rules in `~/Documents/Cline/Rules`, check `~/Cline/Rules`. ## Creating Rules Click the scale icon at the bottom of the Cline panel, to the left of the model selector. Click "New rule file..." and enter a filename (e.g., `coding-standards`). The file will be created with a `.md` extension. Add your instructions in markdown format. Keep each rule file focused on a single concern. You can also use the [`/newrule` slash command](/core-workflows/using-commands#newrule) to have Cline create a rule interactively. ### Toggling Rules Every rule has a toggle to enable or disable it. This gives you fine-grained control over which rules apply to your current task without deleting the rule file. For example, you might have a strict testing rule that you want to disable when prototyping, or a client-specific rule you only need when working on that client's features. ## Writing Effective Rules ### Structure Rules work best when they're scannable and specific. Use markdown structure to organize instructions: ```markdown theme={"system"} # Rule Title Brief context about why this rule exists (optional but helpful). ## Category 1 - Specific instruction - Another instruction with example: `like this` - Reference to file: see /src/utils/example.ts ## Category 2 - More instructions - Include the "why" when it's not obvious ``` Cline reads rules as context, so formatting matters. Headers help Cline understand the scope of each instruction. Bullet points make individual requirements clear. Code examples show exactly what you want. ### Best Practices **Be specific, not vague.** "Use descriptive variable names" is too broad. "Use camelCase for variables, PascalCase for classes, UPPER\_SNAKE for constants" gives Cline something concrete to follow. **Include the why.** When a rule might seem arbitrary, explain the reason. "Don't modify files in /legacy (this code is scheduled for removal in Q2)" helps Cline make better decisions in edge cases. **Point to examples.** If your codebase already demonstrates the pattern you want, reference it. "Follow the error handling pattern in /src/utils/errors.ts" is more effective than describing the pattern from scratch. **Keep rules current.** Outdated rules confuse Cline and waste context. If a constraint no longer applies, remove it. If your tech stack changes, update the rules. **One concern per file.** Split rules by topic: `coding.md` for style, `testing.md` for test requirements, `architecture.md` for structural decisions. This makes it easy to toggle specific rules on or off. Rules consume context tokens. Avoid lengthy explanations or pasting entire style guides. Keep rules concise and link to external documentation when detailed reference is needed. ## Example ```markdown theme={"system"} # Project Guidelines ## Code Style - Use TypeScript for all new files - Prefer composition over inheritance - Use repository pattern for data access - Follow error handling pattern in /src/utils/errors.ts ## Documentation - Update relevant docs when modifying features - Keep README.md in sync with new capabilities ## Testing - Unit tests required for business logic - Integration tests for API endpoints - E2E tests for critical user flows ``` ## Conditional Rules Conditional rules let you scope rules to specific parts of your codebase. Rules activate only when you're working with matching files, keeping your context focused and relevant. * **Without conditionals**: every rule loads for every request. * **With conditionals**, rules activate only when your current files match their defined scope. For example, documentation style rules should only appear when you're editing docs, not when you're writing application code or tests. As your rule library grows, loading every rule for every request wastes context tokens and can dilute Cline's focus. Conditional rules solve this by giving Cline only the instructions that matter for the files you're actually touching. This means faster, more accurate responses. Your frontend rules won't compete for attention when you're deep in backend code, and your testing standards appear exactly when you're writing tests. It's the difference between handing someone an entire policy manual versus the one page they need right now. ### How It Works Conditional rules use YAML frontmatter at the top of your rule files. When Cline processes a request, it gathers context from your current work (open files, visible tabs, mentioned paths, edited files), evaluates each rule's conditions, and activates matching rules. When a conditional rule activates, you'll see a notification: **"Conditional rules applied: workspace:frontend-rules.md"** ### Writing Conditional Rules Add YAML frontmatter to the top of any rule file in your `.clinerules/` directory: ```yaml theme={"system"} --- paths: - "src/components/**" - "src/hooks/**" --- # React Component Guidelines When creating or modifying React components: - Use functional components with React hooks - Extract reusable logic into custom React hooks - Keep components focused on a single responsibility ``` The `---` markers delimit the frontmatter. Everything after the closing `---` is your rule content. #### The `paths` Conditional Currently, `paths` is the supported conditional. It takes an array of glob patterns: ```yaml theme={"system"} --- paths: - "src/**" # All files under src/ - "*.config.js" # Config files in root - "packages/*/src/" # Monorepo package sources --- ``` **Glob pattern syntax:** * `*` matches any characters except `/` * `**` matches any characters including `/` (recursive) * `?` matches a single character * `[abc]` matches any character in the brackets * `{a,b}` matches either pattern | Pattern | Matches | | ----------------------- | --------------------------------------------- | | `src/**/*.ts` | All TypeScript files under `src/` | | `*.md` | Markdown files in root only | | `**/*.test.ts` | Test files anywhere in the project | | `packages/{web,api}/**` | Files in web or api packages | | `src/components/*.tsx` | TSX files directly in components (not nested) | #### Behavior Details **Multiple patterns**: A rule activates if any pattern matches any file in your context. ```yaml theme={"system"} --- paths: - "frontend/**" - "mobile/**" --- # Activates when working in frontend OR mobile ``` **No frontmatter**: Rules without frontmatter are always active. **Empty paths array**: `paths: []` means the rule never activates. Use this to temporarily disable a rule. **Invalid YAML**: If frontmatter can't be parsed, Cline fails open. The rule activates with raw content visible to help debugging. ### What Counts as "Current Context" Cline evaluates rules based on: 1. **Your message**: File paths mentioned in your prompt (e.g., "update `src/App.tsx`") 2. **Open tabs**: Files currently open in your editor 3. **Visible files**: Files visible in your active editor panes 4. **Edited files**: Files Cline has created, modified, or deleted during the task 5. **Pending operations**: Files Cline is about to edit Conditional rules can activate on your first message, when relevant files are open, or mid-task when Cline starts working with matching files. Be explicit about file paths in your prompts. "Update `src/services/user.ts`" reliably triggers path-based rules; "update the user service" may not. ### Practical Examples Copy these patterns and adapt them to your project structure. #### Frontend vs Backend Rules Keep frontend and backend rules separate to avoid noise. Frontend rules only load when working with UI code, backend rules only load when working with API or service code. ```yaml theme={"system"} # .clinerules/frontend.md --- paths: - "src/components/**" - "src/pages/**" - "src/hooks/**" --- # Frontend Guidelines - Use Tailwind CSS for styling - Prefer server components where possible - Keep client components small and focused ``` ```yaml theme={"system"} # .clinerules/backend.md --- paths: - "src/api/**" - "src/services/**" - "src/db/**" --- # Backend Guidelines - Use dependency injection for services - All database queries go through repositories - Return typed errors, not thrown exceptions ``` #### Test File Rules Enforce testing standards automatically. This rule activates only when you're writing or modifying tests, so testing guidance appears exactly when you need it. ```yaml theme={"system"} # .clinerules/testing.md --- paths: - "**/*.test.ts" - "**/*.spec.ts" - "**/__tests__/**" --- # Testing Standards - Use descriptive test names: "should [expected behavior] when [condition]" - One assertion per test when possible - Mock external dependencies, not internal modules - Use factories for test data, not fixtures ``` #### Documentation Rules Apply documentation standards only when editing docs. Prevents style rules from cluttering your context when you're writing code. ```yaml theme={"system"} # .clinerules/docs.md --- paths: - "docs/**" - "**/*.md" - "**/*.mdx" --- # Documentation Guidelines - Use sentence case for headings - Include code examples for all features - Keep paragraphs short (3-4 sentences max) - Link to related documentation ``` ### Combining with Rule Toggles Conditional rules work alongside the rule toggle UI. Toggle off a conditional rule to disable it entirely (it won't activate even if paths match). Toggle on to let it activate when conditions are met. This provides two levels of control: manual toggles and automatic condition-based activation. ### Tips for Effective Conditional Rules **Start Broad, Then Narrow.** Begin with broader patterns and refine as you learn what works: ```yaml theme={"system"} # Start here paths: - "src/**" # Then narrow down paths: - "src/features/auth/**" ``` **Use Descriptive Filenames.** Name your rule files to indicate their scope: ```text theme={"system"} .clinerules/ ├── api-endpoints.md # Rules for API code ├── database-models.md # Rules for DB layer ├── react-components.md # Rules for React └── universal.md # No frontmatter = always active ``` **Keep Universal Rules Separate.** Put always-on rules (coding standards, project conventions) in files without frontmatter. Reserve conditional rules for context-specific guidance. **Test Your Patterns.** Not sure if a pattern matches? Create a simple test rule: ```yaml theme={"system"} --- paths: - "your/pattern/here/**" --- TEST: This rule should activate for your/pattern/here files. ``` Then work with a file in that path and check if you see the activation notification. ### Troubleshooting Conditional Rules **Rule not activating:** * Check that file paths in your context match the glob pattern * Verify the rule is toggled on in the rules panel * Ensure YAML frontmatter has proper `---` delimiters **Rule activating unexpectedly:** * Review glob patterns. `**` is recursive and may match more than intended * Check for open files that match the pattern * File paths mentioned in your message also count as context **Frontmatter showing in output:** * YAML couldn't be parsed * Check for syntax errors (unquoted special characters, improper indentation) # .clineignore (deprecate soon) Source: https://docs.cline.bot/customization/clineignore Control which files and directories Cline can access in your project. This feature will be deprecated soon. **`.clineignore` will be deprecated soon.** `.clineignore` filters what Cline loads automatically, but it is not a security or access-control boundary — ignored files can still be read via explicit `@` mentions or shell commands. We're moving away from it as a supported feature. ## Restricting File Access with a Plugin While `.clineignore` is being phased out, you can get a stronger, enforced restriction on **file reads and edits** with the [Block Ignored File Access](https://docs.cline.bot/sdk/plugin-examples#block-ignored-file-access) Cline plugin example. Unlike `.clineignore`, it uses a `beforeTool` runtime hook to actively **block** tool calls: when `read_files`, `editor`, or `apply_patch` targets a file ignored by your workspace's `.gitignore` file. Install it into your project with: ```bash theme={"system"} cline plugin install https://github.com/cline/cline/blob/main/sdk/examples/plugins/gitignore-read-files-guard.ts --cwd . ``` This plugin covers only part of what `.clineignore` did: * It **guards file reads/edits** (`read_files`, `editor`, `apply_patch`) — it does **not** filter `search_files`/`list_files` results or guard shell commands, so it is not a full context-reduction tool. * It reads your **`.gitignore`** (not a separate `.clineignore`) and requires a Git repository. * Plugins run on the Cline **SDK, CLI, and Kanban**. Support in the VS Code and JetBrains extensions arrives as they migrate onto the SDK. See [Plugins](/customization/plugins) for installation details and scopes. *** The rest of this page is the original `.clineignore` reference, retained for existing users while the feature is phased out. The `.clineignore` file tells Cline which files and directories to skip when analyzing your codebase. It works like `.gitignore`: create a file named `.clineignore` in your project root, add patterns for files you want excluded, and Cline will ignore them. ## Why It Matters Without a `.clineignore`, Cline may load your entire project into context, including dependencies, build artifacts, and generated files. This wastes tokens, increases costs, and can push useful context out of the window. Adding a `.clineignore` can cut your starting context from 200k+ tokens to under 50k. That means faster responses, lower costs, and the ability to use smaller, cheaper models effectively. ## Creating a .clineignore Create a file named `.clineignore` in your project root: ```text theme={"system"} # Dependencies node_modules/ **/node_modules/ # Build outputs /build/ /dist/ /.next/ /out/ # Testing artifacts /coverage/ # Environment variables .env .env.* # Large data files *.csv *.xlsx *.sqlite # Generated/minified code *.min.js *.map ``` ## Pattern Syntax `.clineignore` uses the same pattern syntax as `.gitignore`: | Pattern | Matches | | ------------------ | ---------------------------------------------- | | `node_modules/` | The `node_modules` directory | | `**/node_modules/` | `node_modules` at any depth | | `*.csv` | All CSV files | | `/build/` | The `build` directory at the project root only | | `*.env.*` | Files like `.env.local`, `.env.production` | | `!important.csv` | Exception: do not ignore this file | Lines starting with `#` are comments. Blank lines are ignored. ## What to Exclude Start with these categories and adjust for your project: **Almost always exclude:** * Package manager directories (`node_modules/`, `vendor/`, `.venv/`) * Build outputs (`dist/`, `build/`, `.next/`, `out/`) * Coverage reports (`coverage/`) * Lock files if large (`package-lock.json`, `yarn.lock`) **Exclude if present:** * Large data files (`.csv`, `.xlsx`, `.sqlite`, `.parquet`) * Binary assets (images, fonts, videos) * Generated code (API clients, protobuf outputs, minified bundles) * Environment files with secrets (`.env`, `.env.local`) **Keep accessible:** * Source code you actively work on * Configuration files Cline needs to understand (`tsconfig.json`, `package.json`) * Documentation and READMEs * Test files (Cline often needs these for context) ## How It Works When Cline scans your project to build context, it checks each file path against your `.clineignore` patterns. Matching files are excluded from: * The file listing Cline sees when starting a task * Automatic context gathering during conversations * Search results when Cline looks for relevant code As noted above, explicit [@ mentions](/core-workflows/working-with-files) still bypass these rules — for example, `@/node_modules/some-package/index.js` reads that file even though `node_modules/` is ignored. Ignore rules control automatic loading, not explicit access. `.clineignore` is separate from `.gitignore`. Files tracked by Git but irrelevant to Cline (like large test fixtures or data files) should go in `.clineignore` even if they're not in `.gitignore`. ## Tips * Check your token usage in the task header after adding a `.clineignore`. The difference is often dramatic. * If Cline seems to be missing context about a file, check whether it's being excluded by your ignore patterns. * For monorepos or multi-root workspaces, each workspace root can have its own `.clineignore`. See [Multi-Root Workspaces](/features/multiroot-workspace) for details. ## Related * [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 # Hooks Source: https://docs.cline.bot/customization/hooks See details under SDK Plugins page. See details under [SDK Plugins](/sdk/plugins). # Plugins Source: https://docs.cline.bot/customization/plugins Install and manage plugins that extend Cline with custom tools, hooks, and capabilities. This feature currently only applies to Cline SDK, CLI, and Kanban. This feature is not applicable on VSCode and JetBrains Extension for now. 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 four source types: ```bash theme={"system"} cline plugin install https://github.com/owner/repo/blob/main/plugins/my-plugin.ts cline plugin install https://raw.githubusercontent.com/owner/repo/main/plugins/my-plugin.ts ``` File URLs install a single `.ts` or `.js` plugin file directly. GitHub `blob` and raw URLs are supported, and remote plugin file URLs must use `https://`. ```bash theme={"system"} 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 theme={"system"} cline plugin install https://github.com/owner/repo.git@v1.2.0 cline plugin install https://github.com/owner/repo.git@main ``` ```bash theme={"system"} cline plugin install npm:@scope/my-plugin cline plugin install --npm my-plugin ``` ```bash theme={"system"} 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. Additional flags: | Flag | Description | | -------------- | ------------------------------------------------------------------ | | `--force` | Replace an existing install for the same source | | `--json` | Output the result as JSON (useful for scripting) | | `--cwd ` | Install to `/.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 theme={"system"} 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 theme={"system"} { "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 `AgentPlugin` (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 are provided by the host runtime. The installer automatically strips these from the plugin's dependency list before running `npm install`, so declare any `@cline/*` package your plugin imports as an optional peer dependency. The host currently provides `@cline/sdk`, `@cline/core`, `@cline/agents`, `@cline/llms`, and `@cline/shared`. ```json theme={"system"} { "peerDependencies": { "@cline/sdk": "*" }, "peerDependenciesMeta": { "@cline/sdk": { "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 remote/ # file URL-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). # Skills Source: https://docs.cline.bot/customization/skills 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, 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. Manage skills from the Skills menu: click the scale icon at the bottom of the Cline panel, to the left of the model selector, then switch to the **Skills** tab. ## How Skills Work Skills use progressive loading to maximize efficiency: | Level | When Loaded | Token Cost | Content | | ------------ | ----------------------- | ---------------------- | ---------------------------------------------------------- | | Metadata | Always (at startup) | \~100 tokens per skill | `name` and `description` from YAML frontmatter | | Instructions | When skill is triggered | Under 5k tokens | SKILL.md body with instructions and guidance | | Resources | As needed | Effectively unlimited | Bundled files accessed via `read_file` or executed scripts | 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. ```text title="Skill directory structure" theme={"system"} my-skill/ ├── SKILL.md # Required: main instructions ├── docs/ # Optional: additional documentation │ └── advanced.md └── scripts/ # Optional: utility scripts └── helper.sh ``` The `SKILL.md` file has two parts: metadata and instructions. ```markdown title="SKILL.md" theme={"system"} --- name: my-skill description: Brief description of what this skill does and when to use it. --- # My Skill Detailed instructions for Cline to follow when this skill is activated. ## Steps 1. First, do this 2. Then do that 3. For advanced usage, see [advanced.md](docs/advanced.md) ``` Required fields: * `name` must exactly match the directory name * `description` tells Cline when to use this skill (max 1024 characters) ## Creating a Skill Click the scale icon at the bottom of the Cline panel, to the left of the model selector. Switch to the Skills tab. Click "New skill..." and enter a name for your skill (e.g., `aws-deploy`). Cline creates a skill directory with a template `SKILL.md` file. Edit the `SKILL.md` file: * Update the `description` field to specify when this skill should trigger * Add detailed instructions in the body * Optionally add supporting files in `docs/`, `templates/`, or `scripts/` subdirectories You can also create skills manually by creating the directory structure in your file system. Place skill directories in `.cline/skills/` (workspace) or `~/.cline/skills/` (global) and Cline will detect them automatically. Put the important information first in your SKILL.md. Cline reads the file sequentially, so front-load the common cases. Use clear section headers like "## Error Handling" or "## Configuration" so Cline can scan for relevant sections. ### Toggling Skills Every skill has a toggle to enable or disable it. This lets you control which skills are active without deleting the skill directory. Skills are enabled by default when discovered. For example, you might disable a CI/CD skill when working on local development, or enable a client-specific skill only when working on that client's project. ## Writing Your SKILL.md ### Naming Conventions The skill name appears in the `name` field and must match the directory name exactly. Use lowercase with hyphens (kebab-case) and be descriptive about what the skill does. Good names: * `aws-cdk-deploy` * `pr-review-checklist` * `database-migration` * `api-client-generator` Avoid: * `aws` (too vague) * `my_skill` (underscores, not descriptive) * `DeployToAWS` (use kebab-case, not PascalCase) * `misc-helpers` (too generic) ### Writing Effective Descriptions The description determines when Cline activates the skill. A vague description means the skill won't trigger when you expect it to. Good descriptions are specific and actionable: ```yaml theme={"system"} description: Deploy applications to AWS using CDK. Use when deploying, updating infrastructure, or managing AWS resources. description: Generate release notes from git commits. Use when preparing releases, writing changelogs, or summarizing recent changes. description: Analyze CSV and Excel data files. Use when exploring datasets, generating statistics, or creating visualizations from tabular data. ``` Weak descriptions leave too much ambiguity: ```yaml theme={"system"} description: Helps with AWS stuff. description: Data analysis helper. description: Useful for releases. ``` Start with what the skill does (action verbs), include trigger phrases users might say, and mention specific file types, tools, or domains. Test your descriptions by trying different phrasings of requests to see if the skill triggers. ### Keeping Skills Focused Keep SKILL.md under 5k tokens. If your skill needs more content, split it into separate files in a `docs/` directory and reference them from the main instructions. Cline loads referenced files only when needed. Include real examples. Show what commands to run, what output to expect, and what the result should look like. Abstract instructions are harder to follow than concrete examples. ## Where Skills Live 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) * `.clinerules/skills/` * `.claude/skills/` Global skills: * `~/.cline/skills/` (macOS/Linux) * `C:\Users\USERNAME\.cline\skills\` (Windows) When a global skill and project skill have the same name, the global skill takes precedence. This lets you keep general-purpose skills globally while using project-specific skills in `.cline/skills/` so the whole team can use them. Version control your project skills by committing `.cline/skills/`. Your team can share, review, and improve them together. ## Bundling Supporting Files Skills can include additional files that Cline accesses only when needed. ```text title="Directory structure" theme={"system"} complex-skill/ ├── SKILL.md ├── docs/ │ ├── setup.md │ └── troubleshooting.md ├── templates/ │ └── config.yaml └── scripts/ └── validate.py ``` ### docs/ Use docs for information that's too detailed for SKILL.md or only relevant in specific situations: * Advanced configuration options * Troubleshooting guides for edge cases * Reference material (API schemas, database schemas) * Platform-specific instructions A deployment skill might have `docs/aws.md`, `docs/gcp.md`, and `docs/azure.md`. Cline loads only the relevant platform guide based on your request. ### templates/ Use templates when your skill creates configuration files, boilerplate code, or structured documents: * Config files (Terraform, Docker Compose, CI/CD pipelines) * Code scaffolding (component templates, test fixtures) * Documentation templates (README, API docs) A project setup skill could include `templates/dockerfile`, `templates/docker-compose.yml`, and `templates/.env.example` that Cline customizes for each new project. ### scripts/ Use scripts for deterministic operations where you want consistent behavior: * Validation (linting configs, checking prerequisites) * Data processing (parsing, formatting, transforming) * Complex calculations (cost estimation, resource sizing) * API interactions (fetching data, running health checks) Scripts are token-efficient because only their output enters context, not the code itself. A 500-line validation script produces a simple "Passed" or detailed error messages without consuming any context for the script logic. ### Referencing Bundled Files Reference these files in your SKILL.md instructions: ```markdown title="SKILL.md (referencing bundled files)" theme={"system"} For initial setup, follow [setup.md](docs/setup.md). Use the config template at `templates/config.yaml` as a starting point. Run the validation script to check your configuration: python scripts/validate.py ``` Cline reads documentation files using `read_file` when the instructions reference them. Scripts can be executed directly, and only the script's output enters the context window. | Use Scripts For | Use Instructions For | | --------------------------------------------------- | ---------------------------------------- | | Deterministic operations (validation, formatting) | Flexible guidance that adapts to context | | 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 | ## Example: Data Analysis Skill Here's a practical skill for data analysis tasks. Create a directory called `data-analysis/` with this `SKILL.md`: ```markdown title="data-analysis/SKILL.md" theme={"system"} --- name: data-analysis description: Analyze data files and generate insights. Use when working with CSV, Excel, or JSON data files that need exploration, cleaning, or visualization. --- # Data Analysis When analyzing data files, follow this process: ## 1. Understand the Data - Read a sample of the file to understand its structure - Identify column types and data quality issues - Note any missing values or anomalies ## 2. Ask Clarifying Questions Before diving in, ask the user: - What specific insights are they looking for? - Are there any known data quality issues? - What format do they want for the output? ## 3. Perform Analysis Use pandas for data manipulation: import pandas as pd # Load and explore df = pd.read_csv("data.csv") print(df.head()) print(df.describe()) print(df.info()) For visualization, prefer matplotlib or seaborn depending on complexity. ``` Skills transform Cline from a general-purpose assistant into a specialist that knows your domain. Start with one skill for a task you repeat often, test it, and iterate on the description until it triggers reliably. # Enterprise API Reference Source: https://docs.cline.bot/enterprise-solutions/api-reference 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/overview), which handles model inference. ## Base URL ``` https://api.cline.bot ``` ## Authentication All endpoints require a Bearer token in the `Authorization` header: ```bash theme={"system"} Authorization: Bearer YOUR_AUTH_TOKEN ``` Use the same API key or account auth token described in the [public API reference](/api/overview#authentication). ## Quick Example ```bash theme={"system"} # Get your user profile curl https://api.cline.bot/api/v1/users/me \ -H "Authorization: Bearer YOUR_AUTH_TOKEN" ``` ```json theme={"system"} { "id": "user_abc123", "email": "you@company.com", "name": "Your Name", "active_account_id": "org_xyz789" } ``` *** ## Users Manage user accounts, accept terms, check balances, view usage, and configure payment methods. | Method | Endpoint | Description | | -------- | -------------------------------- | ------------------------------------------------ | | `GET` | `/api/v1/users/me` | Get current user profile | | `PATCH` | `/api/v1/users/me` | Update current user profile | | `DELETE` | `/api/v1/users/me` | Delete current user account | | `POST` | `/api/v1/users/me/accept-terms` | Accept terms of service | | `GET` | `/api/v1/users/me/remote-config` | Get remote configuration for the current user | | `PUT` | `/api/v1/users/active-account` | Switch active account (personal or organization) | | `GET` | `/api/v1/users/{id}/balance` | Get credit balance | | `GET` | `/api/v1/users/{id}/usages` | Get usage history | ### Payments and Credits | Method | Endpoint | Description | | ------ | -------------------------------------------------- | --------------------------------- | | `GET` | `/api/v1/users/{id}/payments` | List payment history | | `GET` | `/api/v1/users/{id}/payments/{paymentId}` | Get payment details | | `GET` | `/api/v1/users/{id}/payments/{paymentId}/status` | Check payment status | | `GET` | `/api/v1/users/{id}/payments/provider/{paymentId}` | Get provider-side payment details | | `POST` | `/api/v1/users/credits/checkout` | Start a credit purchase checkout | | `POST` | `/api/v1/users/{id}/credits/purchase` | Purchase credits directly | ### Billing Configuration | Method | Endpoint | Description | | ------ | ------------------------------------------------- | -------------------------- | | `GET` | `/api/v1/users/{id}/auto-top-up` | Get auto top-up settings | | `PUT` | `/api/v1/users/{id}/auto-top-up` | Configure auto top-up | | `GET` | `/api/v1/users/{id}/payment-method/default` | Get default payment method | | `POST` | `/api/v1/users/{id}/payment-method/setup-session` | Start payment method setup | | `GET` | `/api/v1/users/{id}/promotions` | List active promotions | *** ## Organizations Create and manage organizations. Organization admins can configure remote settings, manage members, and control billing. | Method | Endpoint | Description | | -------- | ------------------------------------------ | ------------------------------ | | `POST` | `/api/v1/organizations` | Create a new organization | | `GET` | `/api/v1/organizations/{id}` | Get organization details | | `PUT` | `/api/v1/organizations/{id}` | Update organization settings | | `DELETE` | `/api/v1/organizations/{id}` | Delete an organization | | `GET` | `/api/v1/organizations/{id}/api-keys` | List organization API keys | | `GET` | `/api/v1/organizations/{id}/remote-config` | Get remote config for the org | | `GET` | `/api/v1/organizations/{orgId}/metrics` | Get organization usage metrics | *** ## Organization Members Manage who has access to the organization and what role they hold. | Method | Endpoint | Description | | -------- | --------------------------------------------------------- | ---------------------- | | `GET` | `/api/v1/organizations/{orgId}/members` | List all members | | `DELETE` | `/api/v1/organizations/{orgId}/members` | Remove members | | `GET` | `/api/v1/organizations/{orgId}/members/available-roles` | List assignable roles | | `PUT` | `/api/v1/organizations/{orgId}/members/{memberId}/role` | Change a member's role | | `GET` | `/api/v1/organizations/{orgId}/members/{memberId}/usages` | Get a member's usage | For a walkthrough of member management in the UI, see [Managing Members](/enterprise-solutions/team-management/managing-members). *** ## Organization Invites Invite new members to join your organization. | Method | Endpoint | Description | | -------- | -------------------------------------------------- | ---------------------------------------- | | `GET` | `/api/v1/organizations/{orgId}/invites` | List pending invites | | `POST` | `/api/v1/organizations/{orgId}/invites` | Send new invites | | `GET` | `/api/v1/organizations/{orgId}/invites/count` | Get invite count | | `DELETE` | `/api/v1/organizations/{orgId}/invites/{inviteId}` | Revoke an invite | | `POST` | `/api/v1/invites/accept` | Accept an invite (called by the invitee) | *** ## Organization Balance and Payments Manage credits and payments at the organization level. These mirror the user-level payment endpoints but operate on the organization's account. | Method | Endpoint | Description | | ------ | ------------------------------------------------------------- | ----------------------------- | | `GET` | `/api/v1/organizations/{orgId}/balance` | Get org credit balance | | `GET` | `/api/v1/organizations/{orgId}/payments` | List payment history | | `GET` | `/api/v1/organizations/{orgId}/payments/{paymentId}` | Get payment details | | `GET` | `/api/v1/organizations/{orgId}/payments/{paymentId}/status` | Check payment status | | `GET` | `/api/v1/organizations/{orgId}/payments/provider/{paymentId}` | Provider-side payment details | | `POST` | `/api/v1/organizations/{orgId}/credits/checkout` | Start credit checkout | | `POST` | `/api/v1/organizations/{orgId}/credits/purchase` | Purchase credits | | `GET` | `/api/v1/organizations/{orgId}/auto-top-up` | Get auto top-up config | | `PUT` | `/api/v1/organizations/{orgId}/auto-top-up` | Configure auto top-up | | `GET` | `/api/v1/organizations/{orgId}/payment-method/default` | Get default payment method | | `POST` | `/api/v1/organizations/{orgId}/payment-method/setup-session` | Start payment method setup | | `GET` | `/api/v1/organizations/{id}/promotions` | List active promotions | *** ## Organization Plans Subscribe to, upgrade, or cancel plans. Manage seat counts for your team. | Method | Endpoint | Description | | -------- | --------------------------------------------- | ------------------------- | | `GET` | `/api/v1/plans` | List all available plans | | `GET` | `/api/v1/organizations/{orgId}/plan` | Get current plan | | `GET` | `/api/v1/organizations/{orgId}/plan/history` | View plan change history | | `GET` | `/api/v1/organizations/{orgId}/plan/{planId}` | Get specific plan details | | `POST` | `/api/v1/organizations/{orgId}/plan` | Subscribe to a plan | | `PUT` | `/api/v1/organizations/{orgId}/plan/seats` | Update seat count | | `DELETE` | `/api/v1/organizations/{orgId}/plan/{planId}` | Cancel a plan | *** ## Organization Usage Track token consumption and costs across your organization. | Method | Endpoint | Description | | ------ | -------------------------------------- | ------------------------- | | `GET` | `/api/v1/organizations/{orgId}/usages` | Get aggregated usage data | For dashboards and monitoring, see [Monitoring Overview](/enterprise-solutions/monitoring/overview) and [Telemetry](/enterprise-solutions/monitoring/telemetry). *** ## API Keys 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 | | -------- | --------------------------- | -------------------- | | `GET` | `/api/v1/api-keys` | List your API keys | | `POST` | `/api/v1/api-keys` | Create a new API key | | `DELETE` | `/api/v1/api-keys/{key_id}` | Delete an API key | *** ## Related The public inference API for sending prompts and receiving completions. Configure single sign-on for your organization. Add, remove, and manage member roles in the UI. Track usage, costs, and telemetry across your organization. # MCP Server Controls Source: https://docs.cline.bot/enterprise-solutions/configuration/infrastructure-configuration/control-other-cline-features/mcp-server-controls Enterprise controls for MCP server allowlisting and remote MCP server management Cline no longer exposes an MCP Marketplace browse/install surface in the SDK-backed VS Code extension. For Enterprise administrators, the legacy remote configuration field names are still supported for compatibility and now govern MCP server access: local server availability, local server allowlisting, organization-managed remote MCP servers, and blocking personal remote MCP servers. ## Overview Enterprise administrators have four configuration options to govern MCP server usage across their organization: | Setting | Purpose | | ------------------------------- | -------------------------------------------------------------- | | `mcpMarketplaceEnabled` | Allow or block locally configured MCP servers | | `allowedMCPServers` | Restrict locally configured MCP servers to approved server IDs | | `remoteMCPServers` | Push pre-configured remote MCP servers to all users | | `blockPersonalRemoteMCPServers` | Prevent users from adding their own remote MCP servers | These settings are applied through your organization's [remote configuration](/enterprise-solutions/configuration/remote-configuration/overview) and take effect immediately for all team members. ## Blocking Local MCP Servers To block locally configured MCP servers for your organization, set `mcpMarketplaceEnabled` to `false`: ```json theme={"system"} { "mcpMarketplaceEnabled": false } ``` When `mcpMarketplaceEnabled` is set to `false`: * Locally configured MCP servers are blocked * Enterprise policy takes precedence over individual preferences When `mcpMarketplaceEnabled` is set to `true` or omitted: * Locally configured MCP servers are allowed unless restricted by `allowedMCPServers` Setting `mcpMarketplaceEnabled` to `false` blocks all locally configured MCP servers. If you want to allow specific local servers while restricting others, leave this setting enabled or omitted and use the allowlist approach described below instead. ## Restricting Local Servers to Approved IDs Rather than blocking all local MCP servers, you can restrict local server usage to a curated list of approved servers using the `allowedMCPServers` setting. This is the recommended approach for most enterprises: it lets developers benefit from MCP while ensuring only vetted local servers are available. ### Configuration Add an `allowedMCPServers` array to your remote configuration. Each entry requires an `id` field that matches the local MCP server name used in the user's MCP configuration: ```json theme={"system"} { "allowedMCPServers": [ { "id": "filesystem" }, { "id": "github" }, { "id": "internal-code-search" } ] } ``` ### How It Works When `allowedMCPServers` is configured with one or more entries: * Local MCP servers can connect only when their configured server name matches an allowed `id` * Local MCP servers not on the list are blocked * The allowlist applies to all team members in the organization When `allowedMCPServers` is omitted, `undefined`, or an empty array (`[]`): * No local server allowlist restriction is applied ### Choosing Server IDs The `id` for each allowed server must match the server name in the user's `mcpServers` configuration. For example: ```json theme={"system"} { "mcpServers": { "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/project"] } } } ``` ## Pushing Pre-Configured Remote MCP Servers Use `remoteMCPServers` to push hosted MCP servers directly to all users. This is ideal for internal MCP servers or third-party servers that need specific configuration. ### Configuration ```json theme={"system"} { "remoteMCPServers": [ { "name": "Internal Code Search", "url": "https://mcp.internal.yourcompany.com/code-search", "alwaysEnabled": true, "headers": { "Authorization": "Bearer ${AUTH_TOKEN}" } }, { "name": "Documentation Server", "url": "https://mcp.internal.yourcompany.com/docs", "alwaysEnabled": false } ] } ``` ### Remote Server Options Each remote MCP server entry supports the following fields: | Field | Type | Required | Description | | --------------- | ------- | -------- | --------------------------------------------- | | `name` | string | Yes | Display name for the server | | `url` | string | Yes | The URL endpoint of the MCP server | | `alwaysEnabled` | boolean | No | When `true`, users cannot disable this server | | `headers` | object | No | Custom HTTP headers for authentication | ### Always-Enabled Servers When `alwaysEnabled` is set to `true`: * The server is automatically active for all users * Users cannot toggle the server off * The server appears in the user's MCP configuration but the disable control is locked * This is useful for compliance, security, or internal tooling servers that must always be available ## Blocking Personal Remote MCP Servers To prevent users from adding their own remote MCP servers, set `blockPersonalRemoteMCPServers` to `true`: ```json theme={"system"} { "blockPersonalRemoteMCPServers": true } ``` When `blockPersonalRemoteMCPServers` is `true`: * Users cannot add or configure remote MCP servers on their own * Only servers defined in the organization's `remoteMCPServers` configuration are available * This ensures all remote MCP connections go through approved, organization-managed endpoints When `blockPersonalRemoteMCPServers` is `false` or omitted: * Users can freely add their own remote MCP server connections ## Combined Configuration Examples ### Locked-Down Environment For organizations that need strict control over all MCP server access: ```json theme={"system"} { "mcpMarketplaceEnabled": true, "allowedMCPServers": [ { "id": "filesystem" }, { "id": "github" } ], "remoteMCPServers": [ { "name": "Internal API Gateway", "url": "https://mcp.internal.yourcompany.com/gateway", "alwaysEnabled": true, "headers": { "X-Api-Key": "org-managed-key" } } ], "blockPersonalRemoteMCPServers": true } ``` This configuration: * Allows only the two named local MCP servers * Pushes an always-enabled internal MCP server to all users * Blocks users from adding their own remote MCP servers ### Open Environment with Internal Servers For organizations that want flexibility with internal server access: ```json theme={"system"} { "remoteMCPServers": [ { "name": "Company Knowledge Base", "url": "https://mcp.yourcompany.com/kb", "alwaysEnabled": true } ] } ``` This configuration: * Leaves local MCP servers unrestricted * Ensures all developers have access to the company knowledge base * Allows users to add their own remote MCP servers ### Local Servers Blocked with Internal Remote Servers Only For organizations that want to fully manage the MCP experience: ```json theme={"system"} { "mcpMarketplaceEnabled": false, "remoteMCPServers": [ { "name": "Approved Code Assistant", "url": "https://mcp.internal.yourcompany.com/code-assist", "alwaysEnabled": true }, { "name": "Internal Docs Search", "url": "https://mcp.internal.yourcompany.com/docs", "alwaysEnabled": true } ], "blockPersonalRemoteMCPServers": true } ``` This configuration: * Blocks locally configured MCP servers * Provides only organization-managed remote MCP servers * Prevents users from adding any additional remote servers ## Enterprise Policy Recommendations ### Recommended Approach Most organizations should **use the allowlist** (`allowedMCPServers`) rather than blocking local MCP servers entirely. This gives developers access to useful tools while ensuring security review of each server. Before adding an MCP server to your allowlist: * Review the server's source code on GitHub * Evaluate the server's permissions and data access patterns * Check for active maintenance and security practices * Assess whether the server's data handling meets your compliance requirements * Test the server in a sandbox environment before approving For internal tooling, use `remoteMCPServers` with `alwaysEnabled: true`: * Connect Cline to internal APIs, databases, and knowledge bases * Ensure consistent access across all developers * Manage authentication centrally through custom headers * Use `blockPersonalRemoteMCPServers` to prevent shadow IT MCP servers can access external APIs and process data: * Audit which servers handle sensitive data * Ensure servers comply with your data residency requirements * Document approved servers in your security policies * Regularly review and update your allowlist ### Recommendations by Organization Size #### Small Teams (5–20 developers) * **Local Servers:** Open or lightly restricted with an allowlist * **Remote Servers:** Push internal servers as needed * **Personal Servers:** Allow with guidance * **Review Cadence:** Quarterly allowlist review #### Medium Organizations (20–100 developers) * **Local Servers:** Restricted to an approved allowlist * **Remote Servers:** Push internal servers with `alwaysEnabled` * **Personal Servers:** Consider blocking (`blockPersonalRemoteMCPServers: true`) * **Review Cadence:** Monthly allowlist review #### Large Enterprises (100+ developers) * **Local Servers:** Strictly restricted to a vetted allowlist * **Remote Servers:** All MCP access through organization-managed servers * **Personal Servers:** Blocked (`blockPersonalRemoteMCPServers: true`) * **Review Cadence:** Formal approval process for new servers with security review ## Support & Questions For help configuring MCP server policies: * Review [Remote Configuration Overview](/enterprise-solutions/configuration/remote-configuration/overview) * See [MCP Overview](/mcp/mcp-overview) for general MCP concepts * Contact your Enterprise support representative * Join our [Discord](https://discord.gg/cline) for community discussion # YOLO Mode Source: https://docs.cline.bot/enterprise-solutions/configuration/infrastructure-configuration/control-other-cline-features/yolo-mode Enterprise controls for YOLO Mode autonomous operation YOLO Mode enables Cline to operate with complete autonomy, auto-approving all actions without user confirmation. For Enterprise administrators, this page covers how to control access to YOLO Mode across your organization. For complete details about YOLO Mode functionality, risks, and best practices, see [YOLO Mode in Features](/features/yolo-mode). ## Overview When YOLO Mode is enabled, Cline automatically approves all operations including file changes, terminal commands, browser actions, and mode transitions. This provides maximum automation speed but removes all safety guardrails. YOLO Mode is powerful but potentially dangerous. Administrators should carefully consider which teams or users should have access to this feature. ## Enterprise Administrator Configuration As an Enterprise administrator, you can control whether users in your organization can enable YOLO Mode through remote configuration. ### Disabling YOLO Mode for All Users Add the following to your remote configuration JSON: ```json theme={"system"} { "yoloModeAllowed": false } ``` When `yoloModeAllowed` is set to `false`: * The YOLO Mode toggle is disabled in all user interfaces * Users cannot enable YOLO Mode even in their local settings * This policy applies immediately to all team members * Enterprise policy takes precedence over individual preferences ### Enabling YOLO Mode for All Users ```json theme={"system"} { "yoloModeAllowed": true } ``` When `yoloModeAllowed` is set to `true` or omitted: * Users can enable or disable YOLO Mode in their local Cline settings * Individual users make their own decisions about using YOLO Mode * No organizational restrictions apply ## Enterprise Policy Recommendations ### Recommended Approach Most organizations should **disable YOLO Mode by default** for the following reasons: YOLO Mode removes all approval gates, potentially allowing: * Unreviewed code changes to critical systems * Execution of commands without oversight * Automated actions that may violate compliance policies * Risk of data exposure through unmonitored operations Without approval prompts: * Changes happen too quickly to review in real-time * Mistakes can compound before detection * Quality gates are bypassed * Rollback becomes more complex Many industries require: * Documented approval trails for code changes * Clear accountability for automated actions * Traceable decision-making processes * YOLO Mode may conflict with these requirements ### Exceptions: When to Allow YOLO Mode Consider enabling YOLO Mode for: **Sandbox/Development Environments** * Isolated testing environments * Personal development machines * Proof-of-concept projects * Temporary exploratory work **Specialized Roles** * DevOps automation engineers (with proper monitoring) * Research & development teams in sandboxed environments * Teams with robust rollback and recovery procedures **Controlled Use Cases** * Scripted CI/CD pipelines with comprehensive logging * Automated testing scenarios * Demonstration or training environments ## Enterprise Considerations ### Security Implications When YOLO Mode is enabled in your organization: **Risk Factors:** * All tool executions happen automatically without human review * Potential for rapid propagation of mistakes across multiple files * Reduced opportunity to catch security vulnerabilities before implementation * Automated operations may bypass existing security controls **Mitigations:** * Implement comprehensive logging and monitoring * Restrict YOLO Mode to non-production environments * Require periodic security reviews for teams using YOLO Mode * Ensure version control and rollback procedures are in place ### Monitoring Requirements When allowing YOLO Mode in your organization, implement: **Mandatory Monitoring:** 1. **Real-time Activity Tracking** * Monitor which users enable YOLO Mode * Track when YOLO Mode is active * Log all automated actions taken 2. **Audit Trail Maintenance** * Preserve complete history of YOLO Mode sessions * Document what was automated and when * Maintain records for compliance purposes 3. **Anomaly Detection** * Alert on unusual patterns of automated actions * Flag high-risk operations performed automatically * Monitor for potential security incidents ### Monitoring YOLO Mode Usage When YOLO Mode is enabled (by policy), track usage through: **Telemetry Events:** * Captures when users toggle YOLO Mode on/off * Records which tasks were executed with YOLO Mode enabled * Provides aggregate usage statistics across your organization **Task History:** * Task metadata indicates whether YOLO Mode was active * Complete action logs show automated approvals * Enables post-action review and analysis **Audit Logs:** * Standard logging captures all automated decisions * Tool executions are recorded with timestamps * Provides compliance trail for regulated environments ## Recommended Policies by Organization Size ### Small Teams (5-20 developers) * **Default:** Disabled * **Exceptions:** Allow for individual sandbox environments * **Monitoring:** Basic telemetry sufficient ### Medium Organizations (20-100 developers) * **Default:** Disabled * **Exceptions:** Permit for designated dev/test environments only * **Monitoring:** Required telemetry + regular audit reviews ### Large Enterprises (100+ developers) * **Default:** Strictly disabled * **Exceptions:** Require security approval for each use case * **Monitoring:** Comprehensive telemetry + real-time alerting + compliance reporting ## Technical Implementation ### Configuration Management **Centralized Control through Remote Configuration:** ```json theme={"system"} { "yoloModeAllowed": false, // Other policies... } ``` This setting: * Applies instantly to all connected clients * Cannot be overridden by individual users * Persists across Cline restarts * Is synchronized across all team members ### Policy Enforcement The enforcement mechanism: 1. Users authenticate with your enterprise configuration server 2. Remote configuration is downloaded and applied 3. Local UI respects enterprise policy settings 4. YOLO Mode toggle is disabled if policy forbids it 5. Users see a message explaining the enterprise restriction ## Compliance Considerations For organizations in regulated industries: **SOC 2 Compliance:** * YOLO Mode may conflict with change management controls * Document decision to allow/disallow in security policies * Implement compensating controls if YOLO Mode is permitted **GDPR/Data Protection:** * Automated operations must still respect data handling policies * Ensure YOLO Mode doesn't bypass data protection safeguards * Maintain audit trails of automated data processing **Industry-Specific:** * Financial services: Generally incompatible with Reg requirements * Healthcare: May violate HIPAA audit trail requirements * Government: Often conflicts with approval workflow mandates ## Support & Questions For help configuring YOLO Mode policies: * Review [Remote Configuration Overview](/enterprise-solutions/configuration/remote-configuration/overview) * See [Features: YOLO Mode](/features/yolo-mode) for detailed functionality * Contact your Enterprise support representative * Join our [Discord](https://discord.gg/cline) for community discussion # Configure Anthropic Provider (Admin) Source: https://docs.cline.bot/enterprise-solutions/configuration/remote-configuration/anthropic/admin-configuration This guide explains how administrators configure Anthropic as the organization-wide LLM provider for Cline. As an administrator, you can add Anthropic as the organization-wide LLM provider for all Cline users through the hosted admin console. This centralized approach provides direct access to Anthropic's Claude models, with an optional custom base URL for organizations that route traffic through a proxy. ## Before You Begin To get started with setting up Anthropic as your organization's LLM provider, you'll need a few items in place. **Administrator access to the Cline Admin console**\ You need admin privileges to enforce provider settings across your organization. If you can navigate to **Settings → Cline Settings** in the admin console at [app.cline.bot](https://app.cline.bot), you have the right access level. **Anthropic API access**\ Your organization needs an Anthropic account with API access to Claude models. Members will need individual API keys to authenticate. If your organization requires routing API traffic through a proxy or custom endpoint, have the proxy URL ready before configuring. ## Configuration Steps Navigate to [app.cline.bot](https://app.cline.bot) and sign in with your administrator account. Go to **Settings → Cline Settings**. You should see the provider configuration options if you have the correct admin access level. Toggle on **Enable settings** to reveal the remote provider configuration options. This allows you to enforce provider settings across your organization. Open the **API Provider** dropdown menu and select **Anthropic**. This will open the Anthropic configuration panel where you'll configure all your organization-wide settings. The configuration panel includes settings that control how Anthropic works for your organization: By default, Cline connects directly to the Anthropic API (`https://api.anthropic.com`). If your organization routes API traffic through a proxy or custom endpoint, enter the base URL here. Use cases for a custom base URL: * Corporate proxy that logs or filters API traffic * Self-hosted API gateway for rate limiting or access control * Regional routing requirements Leave this empty to use the default Anthropic API endpoint. If using a proxy, ensure it correctly forwards requests to the Anthropic API and preserves all required headers. After configuring your settings, close the provider configuration panel and click **Save** on the settings page to persist your changes. Once saved, all organization members signed into the Cline extension will automatically use Anthropic with your configured settings. They won't be able to select other providers or switch to their personal Cline accounts. Members can't switch to personal Cline accounts or join other organizations once remote configuration is enabled. This ensures consistent provider usage across your team. ## Verification To verify the configuration: 1. Check that the provider shows as "Anthropic" in the Enabled provider field 2. Confirm the settings persist after refreshing the page 3. Test with a member account to ensure they see only Anthropic as a provider 4. Verify that Claude models are available in the model dropdown ## Troubleshooting **Members don't see the configured provider**\ Ensure you clicked Save after closing the configuration panel. Verify the member account belongs to the correct organization. **Connection errors when using a custom base URL**\ Verify the proxy URL is correct and accessible from your team's development environments. Ensure the proxy correctly forwards requests to the Anthropic API. **Configuration changes don't persist**\ Make sure to click the Save button on the main settings page, not just close the configuration panel. **Need to change settings later**\ You can update the base URL or other settings at any time. Changes take effect immediately for all organization members. For further details, consult the [Anthropic API documentation](https://docs.anthropic.com/) and coordinate with your infrastructure team. # Configure Anthropic in VS Code (Members) Source: https://docs.cline.bot/enterprise-solutions/configuration/remote-configuration/anthropic/member-configuration Guide for engineers connecting to their organization's Anthropic provider through VS Code after admin setup As a team member, you can connect your local development environment to your organization's Anthropic provider setup. This guide walks you through configuring your API key in VS Code so you can start using Claude models through your organization's configuration. Your administrator has already configured the provider settings — you just need to add your API key to get started. ## Before You Begin To successfully connect to your organization's Anthropic provider, you'll need a few things ready. **Cline extension installed and configured**\ The Cline extension must be installed in VS Code and you need to be signed into your organization account. If you haven't installed Cline yet, follow our [installation guide](/getting-started/installing-cline). **Quick Check**: Open the Cline panel in VS Code. If you see your organization name in the bottom left, you're signed in correctly. **Anthropic API key**\ You need an API key from Anthropic to authenticate requests. Your organization may provide keys centrally or require you to create one through the [Anthropic Console](https://console.anthropic.com/). If you're unsure how to obtain an API key, check with your administrator about your organization's key provisioning process. ## Configuration Steps Open VS Code and access the Cline settings panel using either of these methods: * Click the settings icon (⚙️) in the Cline panel * Click on the API Provider dropdown located directly below the chat area 1. Select or confirm the **Anthropic** provider is selected 2. Enter your Anthropic API key in the **API Key** field 3. If your administrator configured a custom base URL, it will already be set and locked 4. Click **Save** to store your credentials API keys are stored locally and are only used by the Cline extension. The base URL setting is controlled by your administrator. If a custom proxy URL is configured, your API requests will be routed through it automatically. After entering your API key, administrator-controlled settings (such as base URL) will be locked (shown with a lock icon 🔒) as they're managed by your organization. Send a test message in Cline to verify your API key works correctly with the configured Anthropic endpoint. **Testing Recommendation** Try a simple test like "Hello" first to verify basic connectivity before starting development tasks. ## Troubleshooting **Anthropic not available as provider option**\ Confirm you're signed into the correct Cline organization. Verify your administrator has saved the Anthropic configuration and that you have the latest version of the Cline extension. **Authentication errors ("Invalid API Key" or "Unauthorized")**\ Verify your API key is correct and active. Check the [Anthropic Console](https://console.anthropic.com/) to confirm your key status and that it has sufficient permissions. **Connection errors or timeouts**\ If your administrator configured a custom base URL (proxy), check with your IT team about network requirements. If using the default Anthropic endpoint, ensure you have internet access to `api.anthropic.com`. **Models not available**\ The available models depend on your Anthropic API plan and your organization's configuration. Contact your administrator if expected models are not available. **Rate limit errors**\ Your API key may have rate limits configured by Anthropic. If you encounter rate limit errors during normal use, contact your administrator about adjusting limits or managing key usage across the team. ## Security Best Practices When working with your Anthropic API key: * Keep your API key secure and do not share it * Never store your API key in code or version control * Report any suspected key compromise to your administrator immediately * Regularly check the [Anthropic Console](https://console.anthropic.com/) for unusual usage patterns For further details, consult the [Anthropic API documentation](https://docs.anthropic.com/) and coordinate with your organization's administrator. # Configure AWS Bedrock Provider (Admin) Source: https://docs.cline.bot/enterprise-solutions/configuration/remote-configuration/aws-bedrock/admin-configuration This guide explains how administrators configure AWS Bedrock as the organization-wide LLM provider for Cline. As an administrator, you can add AWS Bedrock as the organization-wide LLM provider for all Cline users through the hosted admin console. This centralized approach ensures consistent access to Amazon's AI models while maintaining your organization's security and compliance requirements through region controls and basic configuration options. ## Before You Begin To get started with setting up AWS Bedrock as your organization's LLM provider, you'll need a few items in place. **Administrator access to the Cline Admin console**\ You need admin privileges to enforce provider settings across your organization. If you can navigate to **Settings → Cline Settings** in the admin console at [app.cline.bot](https://app.cline.bot), you have the right access level. **AWS Bedrock account with the right permissions**\ Your AWS account needs specific Bedrock permissions to work with Cline. If you don't have direct AWS access, coordinate with your cloud team to get these permissions set up before proceeding. **Your preferred AWS region**\ Choose your primary AWS region carefully since this will be enforced for all users. Check which models are available in your region first. Some newer models might not be available in all regions yet. ## Configuration Steps Navigate to [app.cline.bot](https://app.cline.bot) and sign in with your administrator account. Go to **Settings → Cline Settings**. You should see the provider configuration options if you have the correct admin access level. Toggle on **Enable settings** to reveal the remote provider configuration options. This allows you to enforce provider settings across your organization. Open the **API Provider** dropdown menu and select **Amazon Bedrock**. This will open the Bedrock configuration panel where you'll configure all your organization-wide settings. The configuration panel includes several settings that control how Bedrock works for your organization. Configure what you need: Enter your preferred AWS region like `us-west-2` or `us-east-1`. This region will be enforced for all organization members. [View AWS Global Infrastructure](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/) For most organizations, `us-east-1` or `us-west-2` are recommended as they have the best model availability. If your organization uses a private VPC endpoint for Bedrock, specify it here to ensure all API calls go through your network infrastructure. [Learn more about AWS PrivateLink](https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-services-overview.html) Enable this to let Bedrock automatically route requests to other regions when your primary region has capacity constraints. Useful for maintaining availability during high-demand periods. [Learn more about Inference Profiles](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html) Turn this on to use AWS's global inference routing, which automatically directs requests to the optimal region based on availability and latency. Enable prompt caching to reduce costs and latency. Bedrock caches portions of prompts that remain consistent across requests, making repeated interactions faster and cheaper. [Learn more about Prompt Caching](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html) After configuring your settings, close the provider configuration panel and click **Save** on the settings page to persist your changes. Once saved, all organization members signed into the Cline extension will automatically use AWS Bedrock with your configured settings. They won't be able to select other providers or switch to their personal Cline accounts. Members can't switch to personal Cline accounts or join other organizations once remote configuration is enabled. This ensures consistent provider usage across your team. ## Verification To verify the configuration: 1. Check that the provider shows as "Amazon Bedrock" in the Enabled provider field 2. Confirm the settings persist after refreshing the page 3. Test with a member account to ensure they see only Bedrock as a provider ## Troubleshooting **Members don't see the configured provider**\ Ensure you clicked Save after closing the configuration panel. Verify the member account belongs to the correct organization. **Configuration changes don't persist**\ Make sure to click the Save button on the main settings page, not just close the configuration panel. **Need to change regions later**\ You can update the region at any time. Members will need to ensure their local AWS credentials have access to the new region. For more information, refer to the [AWS Bedrock Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html). 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. # Configure AWS Bedrock in VS Code (Members) Source: https://docs.cline.bot/enterprise-solutions/configuration/remote-configuration/aws-bedrock/member-configuration Guide for engineers configuring AWS Bedrock credentials in VS Code after admin setup As a team member, you can connect your local development environment to your organization's AWS Bedrock setup. This guide walks you through configuring your AWS credentials in VS Code so you can start using models through your organization's Bedrock infrastructure. Your administrator has already configured the provider settings-you just need to add your credentials to get started. ## Before You Begin To successfully connect to your organization's AWS Bedrock setup, you'll need a few things ready. **Cline extension installed and configured**\ The Cline extension must be installed in VS Code and you need to be signed into your organization account. If you haven't installed Cline yet, follow our [installation guide](/getting-started/installing-cline). **Quick Check**: Open the Cline panel in VS Code. If you see your organization name in the bottom left, you're signed in correctly. **AWS credentials with Bedrock access**\ You need AWS credentials that have permission to access Bedrock in your organization's configured region. If you don't have AWS credentials yet, reach out to your IT or cloud team to get access keys or AWS CLI profiles configured with the necessary Bedrock permissions. ## Configuration Steps Open VS Code and access the Cline settings panel using either of these methods: * Click the settings icon (⚙️) in the Cline panel * Click on the API Provider dropdown located directly below the chat area (it will display as `bedrock.anthropic.claude-sonnet-4-20250514-v1:0` or similar) Choose one of the following credential methods to authenticate with AWS Bedrock: Use dedicated AWS access keys specifically for Bedrock access. [Learn more about AWS Bedrock API Keys](https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html) 1. Select the **API Key** radio button 2. Enter your AWS Access Key ID and Secret Access Key 3. These credentials are stored locally and used only by the VS Code extension Use an existing AWS CLI profile configured on your machine. [Learn more about AWS CLI Profiles](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) 1. Select the **AWS Profile** radio button 2. Choose or enter the profile name from your `~/.aws/credentials` file 3. Cline will use the credentials associated with that profile Use your default AWS credential chain (environment variables, EC2 instance roles, etc.). 1. Select the **AWS Credentials** radio button 2. Cline will automatically detect credentials from your environment using the standard AWS credential provider chain The AWS Region is preconfigured by your administrator and does not need to be set in the extension. After selecting your authentication method, the extension will display checkmarks for enabled features: * ✓ Supports images * ✓ Supports browser use * ✓ Supports prompt caching Additional settings like cross-region inference and global inference profile will be locked (shown with a lock icon 🔒) as they're controlled by your administrator. Send a test message in Cline to verify your credentials work correctly with the configured Bedrock region. **Testing Recommendation** It is recommended to test the connection in plan mode to verify everything works correctly before using it for actual tasks. ## Troubleshooting **Authentication errors ("Access Denied" or "Invalid Credentials")**\ Verify your chosen credential method has the necessary IAM permissions to call Bedrock in the configured region. Required permissions include `bedrock:InvokeModel` and `bedrock:InvokeModelWithResponseStream`. For more information, refer to [AWS Bedrock IAM Permissions](https://docs.aws.amazon.com/bedrock/latest/userguide/security-iam.html). **Region-related errors or "model not available"**\ Ask your administrator to confirm which region is configured for your organization. Ensure your AWS credentials have access to Bedrock in that specific region. [View AWS Global Infrastructure](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/) **Don't see AWS Bedrock as an option**\ Confirm you're signed into the correct Cline organization. Verify your administrator has saved the Bedrock configuration. Try signing out and back into the extension. **AWS Credentials option not finding credentials**\ Verify AWS CLI is installed and configured with `aws configure` ([AWS CLI Installation Guide](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)). Check that credentials are present in `~/.aws/credentials`. For EC2/ECS environments, ensure IAM roles are properly attached. If using environment variables, set `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`. ## Security Best Practices When configuring your AWS credentials, follow these security guidelines: * Use IAM roles with minimum required permissions ([AWS IAM Best Practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)) * Rotate access keys regularly if using the API Key method * Never store credentials in code or version control * Prefer AWS Profile method for better credential management * Consider using AWS SSO/federated roles for enhanced security Your organization administrator controls which models are available. The extension will automatically display available models based on your region's Bedrock configuration. For more information about available models, refer to the [AWS Bedrock Model Access documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html). For further assistance, consult the [AWS Bedrock Documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html) and coordinate with your organization's cloud administrator. # Configure Google Vertex AI Provider (Admin) Source: https://docs.cline.bot/enterprise-solutions/configuration/remote-configuration/google-vertex/admin-configuration This guide explains how administrators configure Google Vertex AI as the organization-wide LLM provider for Cline. As an administrator, you can add Google Vertex AI as the organization-wide LLM provider for all Cline users through the hosted admin console. This centralized approach ensures consistent access to Google's Gemini models while maintaining your organization's project boundaries and regional settings. ## Before You Begin To get started with setting up Google Vertex AI as your organization's LLM provider, you'll need a few items in place. **Administrator access to the Cline Admin console**\ You need admin privileges to enforce provider settings across your organization. If you can navigate to **Settings → Cline Settings** in the admin console at [app.cline.bot](https://app.cline.bot), you have the right access level. **Google Cloud Project with Vertex AI enabled**\ You need a Google Cloud project with the Vertex AI API enabled and appropriate models accessible. If you haven't set up Google Cloud or Vertex AI yet, work with your cloud team to enable the Vertex AI API and ensure necessary quotas are configured. **Project configuration details**\ You'll need your Google Cloud project ID and preferred region for Vertex AI model access. Service accounts should have the minimum IAM permissions needed for Vertex AI access to follow security best practices. ## Configuration Steps Navigate to [app.cline.bot](https://app.cline.bot) and sign in with your administrator account. Go to **Settings → Cline Settings**. You should see the provider configuration options if you have the correct admin access level. Toggle on **Enable settings** to reveal the remote provider configuration options. This allows you to enforce provider settings across your organization. Open the **API Provider** dropdown menu and select **Google Vertex AI**. This will open the Vertex AI configuration panel where you'll configure all your organization-wide settings. The configuration panel includes settings that control how Vertex AI works for your organization: Enter your Google Cloud project ID where Vertex AI is enabled. This project will be used for all AI model requests from your organization members. Use a dedicated project for AI workloads to better track usage and costs. Ensure the project has sufficient quotas for your team's expected usage. Select the Google Cloud region where your Vertex AI models should be accessed. Common options include `us-central1`, `us-east4`, or `europe-west4`. [View Google Cloud Regions](https://cloud.google.com/docs/geography-and-regions) Choose a region close to your team's location for optimal performance. Some models may not be available in all regions. After configuring your settings, close the provider configuration panel and click **Save** on the settings page to persist your changes. Once saved, all organization members signed into the Cline extension will automatically use Google Vertex AI with your configured settings. They won't be able to select other providers or switch to their personal Cline accounts. Members can't switch to personal Cline accounts or join other organizations once remote configuration is enabled. This ensures consistent provider usage across your team. ## Verification To verify the configuration: 1. Check that the provider shows as "Google Vertex AI" in the Enabled provider field 2. Confirm the settings persist after refreshing the page 3. Test with a member account to ensure they see only Vertex AI as a provider 4. Verify that Gemini models are available in the model dropdown ## Troubleshooting **Members don't see the configured provider**\ Ensure you clicked Save after closing the configuration panel. Verify the member account belongs to the correct organization and that your Google Cloud project has Vertex AI API enabled. **Project access errors**\ Verify the project ID is correct and that Vertex AI API is enabled. Check that the project has appropriate billing configured and hasn't exceeded quotas. **Regional availability issues**\ Confirm the selected region supports the Gemini models you want to use. Some newer models may only be available in specific regions. **Configuration changes don't persist**\ Make sure to click the Save button on the main settings page, not just close the configuration panel. **Need to change project or region later**\ You can update these settings at any time. Members will need to ensure their local Google Cloud credentials have access to the new project/region. For further details, consult the [Google Cloud Vertex AI Documentation](https://cloud.google.com/vertex-ai/docs) and coordinate with your internal cloud team. # Configure Google Vertex AI in VS Code (Members) Source: https://docs.cline.bot/enterprise-solutions/configuration/remote-configuration/google-vertex/member-configuration Guide for engineers connecting to their organization's Google Vertex AI setup through VS Code after admin setup As a team member, you can connect your local development environment to your organization's Google Vertex AI setup. This guide walks you through configuring your Google Cloud credentials in VS Code so you can start using Vertex AI models through your organization's configured project and regional settings. Your administrator has already configured the provider settings-you just need to add your credentials to get started. ## Before You Begin To successfully connect to your organization's Google Vertex AI setup, you'll need a few things ready. **Cline extension installed and configured**\ The Cline extension must be installed in VS Code and you need to be signed into your organization account. If you haven't installed Cline yet, follow our [installation guide](/getting-started/installing-cline). **Quick Check**: Open the Cline panel in VS Code. If you see your organization name in the bottom left, you're signed in correctly. **Google Cloud credentials with Vertex AI access**\ You need Google Cloud credentials that have permission to access Vertex AI in your organization's configured project and region. If you're unsure which method to use, check with your administrator or IT team about how your organization has configured Google Cloud access. ## Configuration Steps Open VS Code and access the Cline settings panel using either of these methods: * Click the settings icon (⚙️) in the Cline panel * Click on the API Provider dropdown located directly below the chat area (it will display as `vertex_ai/gemini-pro` or similar) Choose one of the following credential methods to authenticate with Google Vertex AI: Use a service account JSON key file for Vertex AI access. [Learn more about Service Account Keys](https://cloud.google.com/iam/docs/service-accounts) 1. Select the **Service Account Key** authentication method 2. Upload or paste your service account JSON key content 3. The key should have `aiplatform.user` or similar Vertex AI permissions 4. These credentials are stored locally and used only by the VS Code extension Use the Google Cloud SDK installed on your machine with your authenticated account. [Learn more about Google Cloud SDK](https://cloud.google.com/sdk/docs/install) 1. Select the **Google Cloud SDK** authentication method 2. Ensure you've authenticated with `gcloud auth login` 3. Verify your account has access to the organization's Vertex AI project 4. Cline will use your default Google Cloud credentials automatically Use Google Cloud's application default credentials (ADC) chain. 1. Select the **Application Default Credentials** method 2. Ensure ADC is properly configured in your environment 3. This works well for environments where Google Cloud credentials are managed centrally 4. Cline will automatically detect credentials from your environment The Google Cloud Project ID and Region are preconfigured by your administrator and do not need to be set in the extension. After selecting your authentication method, the extension will display checkmarks for enabled features: * ✓ Supports images (for Gemini Pro Vision and similar models) * ✓ Supports multimodal inputs * ✓ Supports function calling (for supported models) The project ID and region settings will be locked (shown with a lock icon 🔒) as they're controlled by your administrator. Send a test message in Cline to verify your credentials work correctly with the configured Vertex AI project and region. **Testing Recommendation** Try a simple test like "Hello" first to verify basic connectivity, then test multimodal capabilities if needed by sharing an image. ## Model Usage ### Available Model Families The models available through your organization's Vertex AI setup typically include: **Gemini Models:** * **Gemini Pro**: Advanced reasoning, code generation, and multimodal capabilities * **Gemini Pro Vision**: Image understanding and visual question answering * **Gemini Ultra**: Most capable model for complex reasoning tasks **PaLM Models:** * **PaLM 2 for Text**: Text generation and completion * **PaLM 2 for Chat**: Conversational AI interactions * **Codey**: Specialized for code generation and explanation **Specialized Models:** * **Text Embedding**: For semantic search and similarity tasks * **Custom Models**: Your organization's fine-tuned variants (if available) ### Model Selection Strategy Choose models based on your development needs: * **General tasks**: Use Gemini Pro for most text and reasoning tasks * **Visual content**: Use Gemini Pro Vision when working with images * **Code-heavy work**: Use Codey models for programming tasks * **Complex reasoning**: Use Gemini Ultra for sophisticated problem-solving * **Embedding tasks**: Use Text Embedding models for semantic operations ### Multimodal Capabilities Take advantage of Vertex AI's multimodal features: * **Image Analysis**: Upload images directly in Cline for analysis * **Visual Question Answering**: Ask questions about images * **Code Screenshots**: Get explanations of code from screenshots * **Document Processing**: Analyze charts, graphs, and visual data ## Troubleshooting **Google Vertex AI not available as provider option**\ Confirm you're signed into the correct Cline organization. Verify your administrator has saved the Vertex AI configuration and that you have the latest version of the Cline extension. **Authentication errors ("Access Denied" or "Invalid Credentials")**\ Verify your chosen credential method has the necessary IAM permissions to access Vertex AI in the configured project and region. Required permissions include `aiplatform.endpoints.predict` and `aiplatform.models.predict`. **Project access errors**\ Ask your administrator to confirm which Google Cloud project is configured for your organization. Ensure your Google Cloud credentials have access to that specific project. **Regional access errors**\ Verify your credentials have access to Vertex AI in the configured region. Some models may not be available in all regions, so confirm with your administrator about the selected region. **Google Cloud SDK authentication issues**\ Ensure Google Cloud SDK is properly installed and authenticated: ```bash theme={"system"} gcloud auth login gcloud config set project YOUR_PROJECT_ID gcloud auth application-default login ``` **Service account key errors**\ Verify the service account key is valid and hasn't expired. Check that the service account has the proper Vertex AI permissions in your organization's project. Ensure the JSON key file is properly formatted and contains all required fields. **Model access errors or "model not found"**\ Some models may not be enabled in your organization's project or region. Contact your administrator if specific models are not available. Verify that your organization has enabled the models you're trying to use in the Google Cloud Console. ## Security Best Practices When configuring your Google Cloud credentials, follow these security guidelines: * Use service accounts with minimal required permissions for Vertex AI access * Rotate service account keys regularly (every 90 days recommended) * Never store credentials in code or version control * Use Google Cloud SDK where possible for better credential management * Consider using Workload Identity for containerized development environments * Report any suspicious activity or unauthorized access attempts Your organization administrator controls which models and regions are available. The extension will automatically display available models based on your project's configuration and regional availability. For more information about Google Cloud authentication and Vertex AI permissions, refer to the [Google Cloud IAM Documentation](https://cloud.google.com/iam/docs) and coordinate with your organization's cloud administrator. # Configure LiteLLM Provider (Admin) Source: https://docs.cline.bot/enterprise-solutions/configuration/remote-configuration/litellm/admin-configuration This guide explains how administrators configure LiteLLM as the organization-wide LLM provider for Cline. As an administrator, you can add LiteLLM as the organization-wide LLM provider for all Cline users through the hosted admin console. This centralized approach provides unified access to multiple AI models through your LiteLLM proxy interface. ## Before You Begin To get started with setting up LiteLLM as your organization's LLM provider, you'll need a few items in place. **Administrator access to the Cline Admin console**\ You need admin privileges to enforce provider settings across your organization. If you can navigate to **Settings → Cline Settings** in the admin console at [app.cline.bot](https://app.cline.bot), you have the right access level. **Quick Check**: Try accessing the settings page now. If you can see the provider configuration options, you're good to go. **LiteLLM proxy instance running**\ You need a deployed LiteLLM proxy that your team can access. This can be self-hosted or managed through a cloud provider. If you haven't deployed LiteLLM yet, work with your infrastructure team to set up a LiteLLM proxy instance. **LiteLLM endpoint details**\ You'll need the base URL of your LiteLLM proxy and optionally a master key if your deployment requires authentication. Ensure your LiteLLM proxy is accessible from your team's development environments and has the models you want to make available configured. ## Configuration Steps Navigate to [app.cline.bot](https://app.cline.bot) and sign in with your administrator account. Go to **Settings → Cline Settings**. You should see the provider configuration options if you have the correct admin access level. Toggle on **Enable settings** to reveal the remote provider configuration options. This allows you to enforce provider settings across your organization. Open the **API Provider** dropdown menu and select **LiteLLM**. This will open the LiteLLM configuration panel where you'll configure all your organization-wide settings. The configuration panel includes settings that control how LiteLLM works for your organization: Enter your LiteLLM proxy endpoint URL. This should be the full URL where your LiteLLM proxy is accessible, such as `https://litellm.yourcompany.com` or `http://your-proxy:4000`. Use HTTPS endpoints in production for security. Make sure the URL is accessible from your team's development environments. If your LiteLLM proxy requires authentication, enter the master key here. This will be used to authenticate requests from all organization members. **Centralized API Key Management**: By configuring the Master Key at the organization level, you enable centralized API key management. Organization members won't need to manage their own individual API keys - access is fully managed through this centralized configuration. The master key provides full access to your LiteLLM proxy. Only enter this if your proxy requires authentication and you want centralized key management. After configuring your settings, close the provider configuration panel and click **Save** on the settings page to persist your changes. Once saved, all organization members signed into the Cline extension will automatically use LiteLLM with your configured settings. They won't be able to select other providers or switch to their personal Cline accounts. Members can't switch to personal Cline accounts or join other organizations once remote configuration is enabled. This ensures consistent provider usage across your team. ## Verification To verify the configuration: 1. Check that the provider shows as "LiteLLM" in the Enabled provider field 2. Confirm the settings persist after refreshing the page 3. Test with a member account to ensure they see only LiteLLM as a provider 4. Verify that the configured models are available in the model dropdown ## Troubleshooting **Members don't see the configured provider**\ Ensure you clicked Save after closing the configuration panel. Verify the member account belongs to the correct organization and that your LiteLLM proxy is accessible from their network. **Connection errors to LiteLLM proxy**\ Verify the Base URL is correct and accessible. Check that any firewalls or security groups allow access from your team's IP addresses or development environments. **Authentication failures**\ If using a master key, verify it's correctly entered and has proper permissions in your LiteLLM deployment. Check the LiteLLM proxy logs for authentication errors. **Models not available**\ Confirm the models are properly configured in your LiteLLM proxy deployment. The available models depend on how your LiteLLM proxy is configured. **Configuration changes don't persist**\ Make sure to click the Save button on the main settings page, not just close the configuration panel. **Need to change endpoint or key later**\ You can update these settings at any time. Changes take effect immediately for all organization members. For further details about LiteLLM deployment and configuration, consult the [LiteLLM Documentation](https://docs.litellm.ai/) and coordinate with your infrastructure team. # Configure LiteLLM in VS Code (Members) Source: https://docs.cline.bot/enterprise-solutions/configuration/remote-configuration/litellm/member-configuration Guide for engineers connecting to their organization's LiteLLM proxy through VS Code after admin setup As a team member, you can connect your local development environment to your organization's LiteLLM proxy setup. This guide walks you through configuring your connection in VS Code so you can start using multiple AI models through your organization's unified proxy interface. Your administrator has already configured the provider settings-you just need to add your credentials to get started. ## Before You Begin To successfully connect to your organization's LiteLLM proxy, you'll need a few things ready. **Cline extension installed and configured**\ The Cline extension must be installed in VS Code and you need to be signed into your organization account. If you haven't installed Cline yet, follow our [installation guide](/getting-started/installing-cline). **Quick Check**: Open the Cline panel in VS Code. If you see your organization name in the bottom left, you're signed in correctly. **Access credentials for your organization's LiteLLM proxy**\ You need credentials to access your organization's LiteLLM proxy. This might be an API key, or the proxy might be configured for open access within your network. If you're unsure about the credentials needed, check with your administrator or IT team about how to access your organization's LiteLLM proxy. ## Configuration Steps Open VS Code and access the Cline settings panel using either of these methods: * Click the settings icon (⚙️) in the Cline panel * Click on the API Provider dropdown located directly below the chat area (it will display as `LiteLLM` or show a specific model name) The LiteLLM configuration options depend on how your organization has set up the proxy: If your organization requires API key authentication: 1. Select or confirm the **LiteLLM** provider is selected 2. Enter your assigned API key in the **API Key** field 3. The base URL should already be configured by your administrator 4. Click **Save** to store your credentials API keys are stored locally in VS Code and are only used by the Cline extension. If your LiteLLM proxy is configured for open access within your network: 1. Select or confirm the **LiteLLM** provider is selected 2. Leave the API key field empty 3. The extension will connect directly to the configured proxy endpoint 4. No additional authentication is required Open access is common when the LiteLLM proxy is deployed within a secure network environment. If your organization uses custom authentication or specific connection parameters: 1. Follow any custom instructions provided by your administrator 2. Contact your IT team if you encounter connection issues 3. Additional configuration may be needed outside of VS Code Custom configurations might require specific network settings or additional authentication steps. Once connected, you'll see the models available through your organization's LiteLLM proxy: * View available models in the model dropdown * Models are determined by your administrator's proxy configuration * You can switch between models for different types of tasks * Some models may be restricted based on your access level **Model Selection** Choose models based on your task requirements: * **Fast models** (like GPT-3.5-turbo) for quick responses * **Powerful models** (like GPT-4) for complex reasoning * **Specialized models** for code generation or specific domains Send a test message in Cline to verify your connection works correctly with the LiteLLM proxy. **Testing Recommendation** Test the connection in plan mode first to verify everything works correctly before using it for actual development tasks. ## Model Usage ### Available Model Categories The models available through your LiteLLM proxy typically include: **Text Generation Models:** * OpenAI GPT-4, GPT-3.5-turbo variants * Anthropic Claude 3 Sonnet, Haiku, Opus * Open source models like Llama 2, Mistral **Code-Specific Models:** * OpenAI GPT-4 for code * CodeLlama variants * Specialized code completion models **Multimodal Models:** * GPT-4 Vision for image analysis * Claude 3 models with vision capabilities ### Model Selection Strategy Choose models based on your development needs: * **Quick iterations**: Use faster, cost-effective models * **Complex problems**: Use more powerful models * **Code-heavy tasks**: Use code-specialized models * **Visual content**: Use multimodal models when working with images ## Troubleshooting **LiteLLM not available as provider option**\ Confirm you're signed into the correct Cline organization. Verify your administrator has saved the LiteLLM configuration and that you have the latest version of the Cline extension. **Connection errors or timeouts**\ Verify your network can reach the LiteLLM proxy endpoint. Check with your IT team about firewall rules or VPN requirements. Ensure the proxy endpoint is accessible from your development environment. **Authentication failures**\ If using API key authentication, verify the key is correctly entered and hasn't expired. Contact your administrator to confirm your key is active and has the proper permissions. **Models not loading or are limited**\ The available models depend on your organization's LiteLLM configuration. Contact your administrator if you need access to specific models or if expected models aren't available. **Slow response times**\ Response times depend on the models being used and proxy load. Try switching to faster models for routine tasks. Contact your administrator if performance is consistently poor. **Error messages from specific models**\ Some models may be temporarily unavailable or have specific limitations. Try alternative models or contact your administrator if specific models are consistently failing. ## Security Best Practices When working with your organization's LiteLLM proxy: * Keep your API credentials secure and don't share them * Use appropriate models for the sensitivity of your data * Follow your organization's usage guidelines * Report any suspicious activity or unauthorized access attempts * Regularly update the Cline extension for security patches Your organization administrator controls which models are available and usage policies. The extension will automatically display available models based on your proxy configuration and access level. # Configure OpenAI Compatible Provider (Admin) Source: https://docs.cline.bot/enterprise-solutions/configuration/remote-configuration/openai-compatible/admin-configuration This guide explains how administrators configure an OpenAI-compatible endpoint as the organization-wide LLM provider for Cline. As an administrator, you can add an OpenAI-compatible endpoint as the organization-wide LLM provider for all Cline users through the hosted admin console. This covers any provider that exposes an OpenAI-compatible API, including Azure Foundry (Azure OpenAI), self-hosted inference engines (vLLM, TGI), and other compatible services. ## Before You Begin To get started with setting up an OpenAI-compatible provider for your organization, you'll need a few items in place. **Administrator access to the Cline Admin console**\ You need admin privileges to enforce provider settings across your organization. If you can navigate to **Settings → Cline Settings** in the admin console at [app.cline.bot](https://app.cline.bot), you have the right access level. **An OpenAI-compatible API endpoint**\ You need a running endpoint that implements the OpenAI chat completions API. This could be: * Azure Foundry (Azure OpenAI Service) * A self-hosted inference engine (vLLM, text-generation-inference, etc.) * Any third-party service with an OpenAI-compatible API If you're using Azure Foundry, you'll need your Azure OpenAI endpoint URL and optionally the API version. Work with your Azure administrator to ensure the endpoint is provisioned and accessible. **Endpoint URL and authentication details**\ You'll need the base URL of your endpoint and any required authentication headers. ## Configuration Steps Navigate to [app.cline.bot](https://app.cline.bot) and sign in with your administrator account. Go to **Settings → Cline Settings**. You should see the provider configuration options if you have the correct admin access level. Toggle on **Enable settings** to reveal the remote provider configuration options. This allows you to enforce provider settings across your organization. Open the **API Provider** dropdown menu and select **OpenAI Compatible**. This will open the configuration panel where you'll configure all your organization-wide settings. The configuration panel includes settings that control how the provider works for your organization: Enter the base URL of your OpenAI-compatible endpoint. Examples: * **Azure Foundry**: `https://your-resource.openai.azure.com` * **Self-hosted vLLM**: `https://inference.yourcompany.com/v1` * **Other compatible services**: The provider's API base URL Use HTTPS endpoints in production for security. Ensure the URL is accessible from your team's development environments. Add custom HTTP headers that will be included with every API request. This is useful for: * Custom authentication schemes beyond API keys * Routing headers for internal load balancers * Organization or tenant identifiers required by your endpoint Headers are configured as key-value pairs. If you're using Azure Foundry (Azure OpenAI), specify the API version string. For example: `2024-02-15-preview` or `2024-06-01`. This field is only needed for Azure OpenAI deployments. Leave it empty for non-Azure endpoints. Check the [Azure OpenAI API version documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference) for available versions. Enable this to use Azure Active Directory (Entra ID) token-based authentication instead of API keys. When enabled, members authenticate using their Azure AD credentials rather than a static API key. This field is only relevant for Azure Foundry deployments. After configuring your settings, close the provider configuration panel and click **Save** on the settings page to persist your changes. Once saved, all organization members signed into the Cline extension will automatically use the OpenAI Compatible provider with your configured settings. They won't be able to select other providers or switch to their personal Cline accounts. Members can't switch to personal Cline accounts or join other organizations once remote configuration is enabled. This ensures consistent provider usage across your team. ## Azure Foundry Configuration For organizations using Azure Foundry (Azure OpenAI Service), use the following configuration: 1. **Base URL**: Your Azure OpenAI endpoint (e.g., `https://your-resource.openai.azure.com`) 2. **Azure API Version**: The API version to use (e.g., `2024-06-01`) 3. **Azure Identity Authentication**: Enable if your organization uses Azure AD for authentication instead of API keys ## Verification To verify the configuration: 1. Check that the provider shows as "OpenAI Compatible" in the Enabled provider field 2. Confirm the settings persist after refreshing the page 3. Test with a member account to ensure they see only the OpenAI Compatible provider 4. Verify that configured models are available in the model dropdown ## Troubleshooting **Members don't see the configured provider**\ Ensure you clicked Save after closing the configuration panel. Verify the member account belongs to the correct organization. **Connection errors to the endpoint**\ Verify the Base URL is correct and accessible from your team's development environments. Check that any firewalls or security groups allow access from developer IP addresses. **Azure authentication failures**\ If using Azure Identity Authentication, verify that members' Azure AD accounts have the appropriate role assignments on the Azure OpenAI resource. If using API keys, verify the key is correctly entered by the member. **Configuration changes don't persist**\ Make sure to click the Save button on the main settings page, not just close the configuration panel. **Need to change endpoint or settings later**\ You can update these settings at any time. Changes take effect immediately for all organization members. For Azure Foundry, consult the [Azure OpenAI Service documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/). For other OpenAI-compatible endpoints, refer to your provider's documentation. # Configure OpenAI Compatible in VS Code (Members) Source: https://docs.cline.bot/enterprise-solutions/configuration/remote-configuration/openai-compatible/member-configuration Guide for engineers connecting to their organization's OpenAI-compatible endpoint through VS Code after admin setup As a team member, you can connect your local development environment to your organization's OpenAI-compatible endpoint. This guide walks you through configuring your credentials in VS Code so you can start using models through your organization's configured endpoint. Your administrator has already configured the provider settings — you just need to add your API key to get started. ## Before You Begin To successfully connect to your organization's OpenAI-compatible endpoint, you'll need a few things ready. **Cline extension installed and configured**\ The Cline extension must be installed in VS Code and you need to be signed into your organization account. If you haven't installed Cline yet, follow our [installation guide](/getting-started/installing-cline). **Quick Check**: Open the Cline panel in VS Code. If you see your organization name in the bottom left, you're signed in correctly. **API key or credentials for your endpoint**\ You need an API key or credentials to authenticate with your organization's configured endpoint. For Azure Foundry deployments using Azure Identity Authentication, your Azure AD credentials may be used instead. If you're unsure what credentials to use, check with your administrator or IT team about how your organization has configured access. ## Configuration Steps Open VS Code and access the Cline settings panel using either of these methods: * Click the settings icon (⚙️) in the Cline panel * Click on the API Provider dropdown located directly below the chat area The authentication method depends on how your administrator configured the endpoint: For most OpenAI-compatible endpoints: 1. Select or confirm the **OpenAI Compatible** provider is selected 2. Enter your API key in the **API Key** field 3. The base URL, custom headers, and other settings are preconfigured by your administrator 4. Click **Save** to store your credentials API keys are stored locally and are only used by the Cline extension. If your organization uses Azure AD authentication: 1. Select or confirm the **OpenAI Compatible** provider is selected 2. Ensure you are signed into Azure in your development environment 3. The extension will use your Azure AD credentials automatically 4. No API key is needed when Azure Identity Authentication is enabled You may need the Azure Account extension or Azure CLI installed for credential resolution. The Base URL, custom headers, Azure API version, and Azure Identity settings are preconfigured by your administrator and do not need to be set in the extension. After configuring your credentials, administrator-controlled settings will be locked (shown with a lock icon 🔒) as they're managed by your organization. Send a test message in Cline to verify your credentials work correctly with the configured endpoint. **Testing Recommendation** Try a simple test like "Hello" first to verify basic connectivity before starting development tasks. ## Troubleshooting **OpenAI Compatible not available as provider option**\ Confirm you're signed into the correct Cline organization. Verify your administrator has saved the configuration and that you have the latest version of the Cline extension. **Authentication errors ("Access Denied" or "Invalid API Key")**\ Verify your API key is correct and active. For Azure Foundry with Azure Identity Authentication, ensure you are signed into Azure in your development environment and that your account has the appropriate role assignments on the Azure OpenAI resource. **Connection errors or timeouts**\ The endpoint URL is configured by your administrator. If you experience connection issues, check with your IT team about network requirements (VPN, firewall rules, etc.). **Models not available**\ The available models depend on your organization's endpoint configuration. Contact your administrator if expected models are not available in the model dropdown. **Configuration changes don't persist**\ Make sure to save your credentials. The base URL and other admin-controlled settings cannot be changed locally. ## Security Best Practices When working with your API credentials: * Keep your API key secure and do not share it * Never store credentials in code or version control * Report any suspected key compromise to your administrator immediately * Follow your organization's usage guidelines for the configured endpoint Your organization administrator controls which endpoint, models, and settings are available. The extension will automatically apply the configured settings based on your organization's remote configuration. For Azure Foundry, refer to the [Azure OpenAI Service documentation](https://learn.microsoft.com/en-us/azure/ai-services/openai/). For other endpoints, consult your organization's internal documentation or contact your administrator. # Enterprise Provider Configuration Source: https://docs.cline.bot/enterprise-solutions/configuration/remote-configuration/overview Configure inference providers through the Cline hosted admin console for centralized organization management Remote Provider Configuration allows administrators to centrally configure inference providers for their entire organization through the Cline hosted admin console. This approach ensures consistent provider access, security policies, and cost management across all team members without requiring individual developer setup or infrastructure deployment. ## How Remote Configuration Works Remote configuration operates through Cline's hosted service at [app.cline.bot](https://app.cline.bot), where administrators can: Configure providers once for the entire organization through the web-based admin console. Team members automatically receive the configured provider settings when signed into their organization. New team members get instant access to inference providers without complex individual configuration. Ensure all team members use the same models, regions, and settings organization-wide. ## Supported Providers Cline supports remote configuration for the following inference providers: | Provider | Use Case | Configuration | Member Setup | | --------------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | | **Cline** | Organizations using Cline's native provider with centralized API key management | API provider selection, model access | No individual API keys needed — fully managed by organization | | **Amazon Bedrock** | Organizations using AWS infrastructure | Region selection, VPC endpoints, cross-region inference, global inference, prompt caching | AWS credential configuration (API key, CLI profile, or credential chain) | | **Google Vertex AI** | Organizations using Google Cloud Platform | Project ID, region selection, model access | Google Cloud credential configuration (service account, SDK, or ADC) | | **Azure Foundry** | Organizations using Azure OpenAI or Azure AI services | Base URL, Azure API version, Azure identity authentication, custom headers | API key configuration in the extension | | **Anthropic** | Organizations using the Anthropic API directly | Optional custom base URL for proxy deployments, model access | API key configuration in the extension | | **OpenAI Compatible** | Organizations using any OpenAI-compatible endpoint (self-hosted, vLLM, custom proxies) | Base URL, custom headers, model access | API key configuration in the extension | | **LiteLLM** | Organizations requiring multi-model access through a unified proxy | Proxy endpoint, authentication, model routing | API key or endpoint configuration (or centralized with Master Key) | **Azure Foundry** uses the OpenAI Compatible provider configuration with Azure-specific settings (API version, Azure identity authentication). See the [OpenAI Compatible admin configuration](/enterprise-solutions/configuration/remote-configuration/openai-compatible/admin-configuration) for setup instructions. ## Configuration Process The typical remote configuration process follows these steps: Access the Cline admin console and configure the desired inference provider with organization-wide settings. Provider configuration is automatically distributed to all organization members signed into Cline. Team members add their individual credentials (API keys, AWS profiles, etc.) to connect to the configured provider. For some providers like Cline and LiteLLM (with Master Key), no individual credentials are needed. Once credentials are configured, members can immediately start using the inference provider through Cline. ## Benefits of Remote Configuration ### **For Administrators** * **Centralized Control**: Manage all provider settings from one location * **Security Compliance**: Ensure consistent security policies across the organization * **Easy Updates**: Change provider settings organization-wide instantly ### **For Team Members** * **Simplified Setup**: No need to research provider configuration options * **Consistent Experience**: Same models and features available to everyone * **Quick Onboarding**: Get started immediately with pre-configured providers * **Focus on Development**: Spend time coding instead of configuring inference providers ## Getting Started To get started with provider remote configuration: 1. **Choose Your Provider**: Select the inference provider that best fits your organization's needs and existing infrastructure 2. **Admin Configuration**: Follow the provider-specific admin configuration guide 3. **Member Onboarding**: Have team members complete the provider-specific member configuration 4. **Start Developing**: Begin using Cline with centrally managed inference provider access Select your provider below to begin the configuration process: AWS-based AI models with enterprise security and compliance features. Google Cloud's AI platform with Gemini models and regional control. Any OpenAI-compatible endpoint, including Azure Foundry. Direct Anthropic API access with optional custom base URL configuration. Unified proxy for accessing 100+ AI models through a single interface. # OpenTelemetry Integration Source: https://docs.cline.bot/enterprise-solutions/monitoring/opentelemetry Export Cline telemetry to your observability platform using OpenTelemetry Protocol (OTLP) Cline includes opt-in OpenTelemetry support for exporting metrics and logs to your own observability infrastructure using the OpenTelemetry Protocol (OTLP). OpenTelemetry integration is **optional** and intended for advanced users with existing observability infrastructure. Most users won't need this feature. ## What is OpenTelemetry? [OpenTelemetry](https://opentelemetry.io/) is an industry-standard observability framework that provides a unified way to collect and export telemetry data (metrics, logs, and traces). Cline's OpenTelemetry support allows you to: * Export telemetry to your own systems * Integrate with observability platforms like Datadog, New Relic, Grafana Cloud, etc. * Maintain full control over your monitoring data * Use your organization's existing monitoring infrastructure ## Supported Features Cline supports OpenTelemetry's **OTLP (OpenTelemetry Protocol)** export with: Export metrics about Cline usage, performance, and errors Export structured logs for debugging and analysis ### Export Formats Cline supports three OTLP export protocols: * **gRPC** (default, recommended) * **HTTP/protobuf** * **HTTP/JSON** ## Configuration OpenTelemetry is configured using [Remote Configuration](/enterprise-solutions/configuration/remote-configuration/overview#how-remote-configuration-works) from the [dashboard](https://app.cline.bot/dashboard/organization?tab=settings). ### Basic Setup Enable OpenTelemetry, configure an OTLP endpoint and select a protocol: If you're using gRPC, you can opt out of TLS. Once the collector has been configured, you can enable logs and/or metrics collection. At least one of them needs to be enabled. You only need to configure it further if you need an advanced configuration. ### Advanced Configuration You can add custom protocols and endpoints for both, logs and metrics. You can also configure the metrics export interval, and the logs batch size, batch timeout and max queue size. **Custom headers for authentication:** Finally, if your collector needs authentication headers, you can add key value pairs in the headers section. ## Integration Examples ### Datadog Export to Datadog using their OTLP endpoint: ### New Relic Export to New Relic: ### Grafana Cloud Export to Grafana Cloud: ## Testing Configuration To test your configuration, log in to your account, perform some actions in a task, wait for the export interval, and verify that the data has arrived at your collector. ## Troubleshooting If you aren’t getting any data in your collector, the easiest way to verify your integration is to enable the developer tools in your editor. To do this, open the [webview developer tools](https://code.visualstudio.com/api/extension-guides/webview#inspecting-and-debugging-webviews). Once you’ve done so, if you perform some actions that trigger metrics and/or logs (such as doing a task with Cline), you will see error logs if any error occurs when sending the data to your collector. If you don't see any logs, enable [debug mode](#debug-mode). ### Connection Errors 1. **Verify endpoint is accessible:** ```bash theme={"system"} curl -v https://your-otlp-endpoint:4317 ``` 2. **Check if insecure mode is needed** by opting out of TLS 3. **Verify authentication headers:** Double-check your API keys and authentication headers are correct ### Debug Mode Enable debug logging to see detailed OpenTelemetry information: ```bash theme={"system"} TEL_DEBUG_DIAGNOSTICS=true code . ``` This will output detailed information about: * Configuration being used * Exporters being created * Connection attempts * Export successes/failures ## What Gets Exported When OpenTelemetry is enabled, Cline exports: ### Metrics * Feature usage counts * Task execution metrics * Error rates and types * Performance measurements ### Logs * System events * Error logs with context * Operational information Exported data is already anonymous and doesn't include code content, file paths, or sensitive information. However, you're responsible for securing the data once exported to your systems. ## Limitations Current OpenTelemetry support in Cline: * ✅ OTLP metrics export (gRPC, HTTP) * ✅ OTLP logs export (gRPC, HTTP) * ✅ Basic configuration via [Remote Configuration](/enterprise-solutions/configuration/remote-configuration/overview#how-remote-configuration-works) * ❌ Distributed tracing (not yet implemented) * ❌ Custom instrumentation API (not yet exposed) * ❌ Sampling configuration (uses defaults) ## Best Practices 1. **Test First**: Always test with console exporter before sending to production 2. **Secure Credentials**: Never hardcode API keys; use secure environment variable management 3. **Monitor Costs**: Be aware of data ingestion costs with your observability platform 4. **Start Simple**: Begin with metrics only, add logs if needed 5. **Use Compression**: OTLP supports compression; check if your endpoint requires it ## Next Steps Complete catalog of all emitted OTel events Configure simple built-in telemetry Learn more about OpenTelemetry # OpenTelemetry Events Reference Source: https://docs.cline.bot/enterprise-solutions/monitoring/opentelemetry-events Complete reference of OpenTelemetry log events emitted by Cline This page documents all OpenTelemetry log events currently instrumented in Cline. These events are emitted when OpenTelemetry integration is enabled and provide detailed insights into user behavior, task execution, and system operations. Events are only emitted when OpenTelemetry is enabled. See [OpenTelemetry](/enterprise-solutions/monitoring/opentelemetry) for configuration instructions. ## Event Categories Cline emits events across several categories, each prefixed with a namespace: Authentication, telemetry controls, extension lifecycle Task execution, conversation turns, tool usage, tokens Workspace initialization, VCS detection, path resolution User interface interactions and model selection Hook discovery, execution, and context modification Git worktree operations and merge handling Host environment detection Diagnostic and connection testing ## User Events Events related to user authentication, telemetry preferences, and extension lifecycle. | Event | Description | Key Attributes | | ------------------------------ | --------------------------------------------------- | ------------------------------ | | `user.opt_out` | User explicitly opts out of telemetry | user\_id, timestamp | | `user.opt_in` | User explicitly opts into telemetry | user\_id, timestamp | | `user.telemetry_enabled` | Telemetry service enabled/initialization signal | enabled, timestamp | | `user.extension_activated` | Extension activation event | extension\_version, host\_type | | `user.extension_storage_error` | Error while reading/writing extension storage state | error\_type, error\_message | | `user.auth_started` | Authentication flow started | provider, timestamp | | `user.auth_succeeded` | Authentication flow succeeded | provider, user\_id | | `user.auth_failed` | Authentication flow failed | provider, error\_reason | | `user.auth_logged_out` | User logged out | reason, provider | | `user.onboarding_progress` | Onboarding step/action progress | step, action, completed | ### Example: user.auth\_succeeded ```json theme={"system"} { "event": "user.auth_succeeded", "timestamp": "2026-03-05T10:30:00Z", "attributes": { "provider": "github", "user_id": "user_abc123", "session_id": "sess_xyz789" } } ``` ## Workspace Events Events related to workspace initialization, version control detection, and multi-root operations. | Event | Description | Key Attributes | | --------------------------------- | ----------------------------------------- | -------------------------------------- | | `workspace.initialized` | Workspace initialization completed | roots\_count, vcs\_type, duration\_ms | | `workspace.init_error` | Workspace initialization failed | error\_type, fallback\_used | | `workspace.vcs_detected` | Version control system detection event | vcs\_type, root\_path\_hash | | `workspace.multi_root_checkpoint` | Multi-root checkpoint operation telemetry | operation, roots\_count, duration\_ms | | `workspace.path_resolved` | Workspace path resolution | hint, fallback\_used, cross\_workspace | ### Example: workspace.initialized ```json theme={"system"} { "event": "workspace.initialized", "timestamp": "2026-03-05T10:32:15Z", "attributes": { "roots_count": 2, "vcs_type": "git", "duration_ms": 145, "multi_root_enabled": true } } ``` ## Task Events Core events tracking task lifecycle, conversation turns, tool usage, and execution details. ### Task Lifecycle | Event | Description | Key Attributes | | ------------------------ | --------------------------------------------- | ------------------------------------------------------ | | `task.created` | New task/conversation started | task\_id, mode, model, provider | | `task.restarted` | Existing task restarted/reopened | task\_id, time\_since\_last\_message | | `task.completed` | Task completed | task\_id, duration\_ms, model, provider, tokens\_total | | `task.feedback` | User feedback on task | task\_id, feedback\_type (thumbs\_up/thumbs\_down) | | `task.historical_loaded` | Historical task loaded from storage | task\_id, age\_days | | `task.retry_clicked` | User clicked retry on a failed action/request | task\_id, action\_type | ### Conversation & Tokens | Event | Description | Key Attributes | | ------------------------ | -------------------------- | --------------------------------------------------------------- | | `task.conversation_turn` | Conversation turn event | role (user/assistant), provider, model, tokens\_in, tokens\_out | | `task.tokens` | Token usage event | tokens\_in, tokens\_out, cached\_tokens, cost | | `task.mode` | Plan/Act mode switch event | previous\_mode, new\_mode, task\_id | ### Tool Usage | Event | Description | Key Attributes | | --------------------------------- | ------------------------------------------------ | -------------------------------------------------------- | | `task.tool_used` | Tool invocation and outcome telemetry | tool\_name, success, duration\_ms, auto\_approved | | `task.mcp_tool_called` | MCP tool call lifecycle event | status (started/success/error), tool\_name, server\_name | | `task.browser_tool_start` | Browser tool/session started | url, action | | `task.browser_tool_end` | Browser tool/session ended with stats | duration\_ms, actions\_count, success | | `task.browser_error` | Browser tool error event | error\_type, url | | `task.terminal_execution` | Terminal execution capture success/failure event | success, command\_hash, duration\_ms | | `task.terminal_output_failure` | Terminal output capture failed | reason | | `task.terminal_user_intervention` | User intervention during terminal execution | intervention\_type | | `task.terminal_hang` | Terminal hang/stuck detection event | duration\_ms, command\_hash | ### Features & Options | Event | Description | Key Attributes | | ------------------------------- | ------------------------------------------------ | ----------------------------------------------------- | | `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 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 | | `task.workspace_search_pattern` | Workspace search strategy/pattern telemetry | pattern\_type, files\_scanned | ### Advanced Features | Event | Description | Key Attributes | | ------------------------------------------- | ----------------------------------------------------------- | ----------------------------------- | | `task.focus_chain_enabled` | Focus chain feature enabled | task\_id | | `task.focus_chain_disabled` | Focus chain feature disabled | task\_id | | `task.focus_chain_progress_first` | First focus-chain checklist/progress emitted | items\_count | | `task.focus_chain_progress_update` | Subsequent focus-chain checklist/progress updates | items\_total, items\_completed | | `task.focus_chain_incomplete_on_completion` | Task completed while focus-chain checklist still incomplete | items\_remaining | | `task.focus_chain_list_opened` | Focus-chain markdown/list opened by user | task\_id | | `task.focus_chain_list_written` | Focus-chain markdown/list written/saved | task\_id | | `task.subagent_enabled` | Subagents feature enabled | task\_id | | `task.subagent_disabled` | Subagents feature disabled | task\_id | | `task.subagent_started` | Subagent execution started | subagent\_id, prompt\_length | | `task.subagent_completed` | Subagent execution completed | subagent\_id, duration\_ms, success | | `task.skill_used` | Skill invocation event | skill\_name, task\_id | ### Auto-Compact & Context | Event | Description | Key Attributes | | ---------------------------- | -------------------------------------------------------- | --------------------------------------- | | `task.summarize_task` | Auto-compaction/summarize triggered for context pressure | conversation\_length, estimated\_tokens | | `task.auto_condense_toggled` | Auto-condense setting toggled | enabled | ### Settings & Features | Event | Description | Key Attributes | | ------------------------------ | ------------------------------- | ------------------------------- | | `task.feature_toggled` | Generic feature toggle changed | feature\_name, enabled | | `task.rule_toggled` | Cline rule toggled on/off | rule\_name, enabled, is\_global | | `task.yolo_mode_toggled` | YOLO mode toggled | enabled | | `task.cline_web_tools_toggled` | Cline web tools setting toggled | enabled | ### API & Performance | Event | Description | Key Attributes | | ----------------------------- | ----------------------------------------- | -------------------------------------------- | | `task.gemini_api_performance` | Gemini-specific API performance telemetry | duration\_ms, tokens, cache\_hit | | `task.provider_api_error` | API provider error event | provider, model, error\_code, error\_message | | `task.diff_edit_failed` | Diff/replace edit failed | file\_path\_hash, error\_type | | `task.initialization` | Task initialization timing/metadata event | duration\_ms, mode | ### AI Output Feedback | Event | Description | Key Attributes | | ------------------------- | ------------------------------- | ----------------------------------------- | | `task.ai_output.accepted` | AI-generated file edit accepted | lines\_added, lines\_removed, file\_count | | `task.ai_output.rejected` | AI-generated file edit rejected | lines\_added, lines\_removed, file\_count | ### Example: task.tool\_used ```json theme={"system"} { "event": "task.tool_used", "timestamp": "2026-03-05T10:35:22Z", "attributes": { "task_id": "task_1234567890", "tool_name": "write_to_file", "success": true, "duration_ms": 125, "auto_approved": false, "model": "claude-sonnet-4", "provider": "anthropic" } } ``` ## UI Events Events tracking user interface interactions. | Event | Description | Key Attributes | | --------------------------- | ------------------------------ | -------------------------------- | | `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/skills menu/modal opened | menu\_type | ### Example: ui.model\_selected ```json theme={"system"} { "event": "ui.model_selected", "timestamp": "2026-03-05T11:20:00Z", "attributes": { "model": "claude-sonnet-4", "provider": "anthropic", "previous_model": "gpt-4o", "mode": "act" } } ``` ## Hooks Events Events related to hook discovery, execution lifecycle, and context modifications. | Event | Description | Key Attributes | | --------------------------- | -------------------------------- | --------------------------------------------------------------------- | | `hooks.enabled` | Hooks feature enabled | user\_id | | `hooks.disabled` | Hooks feature disabled | user\_id | | `hooks.cancel_requested` | Hook requested cancellation | hook\_name, task\_id | | `hooks.context_modified` | Hook modified context | hook\_name, modification\_type | | `hooks.discovery_completed` | Hook discovery completed | hooks\_count, global\_count, workspace\_count | | `hooks.execution` | Unified hook execution lifecycle | hook\_name, status (started/completed/failed/cancelled), duration\_ms | ### Hook Execution Lifecycle The `hooks.execution` event tracks the complete lifecycle with a `status` attribute: * **started**: Hook execution began * **completed**: Hook finished successfully * **failed**: Hook encountered an error * **cancelled**: Hook was cancelled by user or system ### Example: hooks.execution ```json theme={"system"} { "event": "hooks.execution", "timestamp": "2026-03-05T10:40:15Z", "attributes": { "hook_name": "preToolUse", "status": "completed", "duration_ms": 234, "task_id": "task_1234567890", "context_modified": false } } ``` ## Worktree Events Events related to Git worktree operations. | Event | Description | Key Attributes | | -------------------------- | ---------------------------- | -------------------------------------- | | `worktree.view_opened` | Worktree view opened | user\_id | | `worktree.created` | Worktree create event | success, branch\_name, duration\_ms | | `worktree.merge_attempted` | Worktree merge attempt event | has\_conflicts, delete\_option\_chosen | ### Example: worktree.created ```json theme={"system"} { "event": "worktree.created", "timestamp": "2026-03-05T14:22:00Z", "attributes": { "success": true, "branch_name_hash": "abc123", "duration_ms": 1250, "parent_branch": "main" } } ``` ## Host Events Events related to host environment detection. | Event | Description | Key Attributes | | --------------- | -------------------------------- | ------------------------------------------ | | `host.detected` | Host environment detection event | host\_type (vscode/jetbrains/cli), version | ### Example: host.detected ```json theme={"system"} { "event": "host.detected", "timestamp": "2026-03-05T09:00:00Z", "attributes": { "host_type": "vscode", "version": "1.95.0", "platform": "darwin" } } ``` ## Test Events Diagnostic and connection testing events. | Event | Description | Key Attributes | | ----------------------- | ----------------------------------------------------------- | --------------------------------- | | `cline.test.connection` | OTEL connection test event from "Test OTEL Connection" flow | success, exporter\_type, endpoint | ### Example: cline.test.connection ```json theme={"system"} { "event": "cline.test.connection", "timestamp": "2026-03-05T15:30:00Z", "attributes": { "success": true, "exporter_type": "otlp", "endpoint": "https://api.datadoghq.com:4317", "protocol": "grpc" } } ``` ## Event Attribute Guidelines ### Common Attributes Most events include these standard attributes: | Attribute | Type | Description | | ------------------- | -------- | ----------------------------------------------- | | `timestamp` | ISO 8601 | Event occurrence time | | `user_id` | string | Anonymized user identifier (when authenticated) | | `session_id` | string | Current session identifier | | `extension_version` | string | Cline extension version | | `host_type` | string | vscode, jetbrains, or cli | ### Privacy & Hashing Sensitive information is hashed or anonymized: * **File paths**: Hashed to preserve privacy * **Command content**: Hashed, not logged verbatim * **User identifiers**: Anonymized tokens * **Branch names**: Hashed in worktree events File paths, command arguments, and code content are **never** included in raw form. Only hashes or anonymized identifiers are used. ## Task Event Deep Dive Task events are the most detailed category. Here's a typical task execution flow: ```mermaid theme={"system"} sequenceDiagram participant User participant Cline participant OTel User->>Cline: Start Task Cline->>OTel: task.created User->>Cline: Submit Message Cline->>OTel: task.conversation_turn (user) Cline->>Cline: Process with AI Cline->>OTel: task.tokens Cline->>OTel: task.conversation_turn (assistant) Cline->>Cline: Use Tool Cline->>OTel: task.tool_used User->>Cline: Provide Feedback Cline->>OTel: task.option_selected User->>Cline: Complete Task Cline->>OTel: task.completed ``` ### Task Token Tracking Token events provide detailed cost and usage information: ```json theme={"system"} { "event": "task.tokens", "timestamp": "2026-03-05T10:35:30Z", "attributes": { "task_id": "task_1234567890", "tokens_in": 2500, "tokens_out": 850, "cached_tokens": 1200, "cost": 0.0043, "model": "claude-sonnet-4", "provider": "anthropic" } } ``` ## Using Events for Analytics **SQL syntax is illustrative only.** Attribute access varies by observability platform — for example, `JSON_EXTRACT(attributes, '$.model')` in BigQuery, `attributes['model']` in ClickHouse, or `@attributes.model` in Datadog. Adapt all queries below to your platform's query language before use. ### Query Patterns **Most used tools:** ```sql theme={"system"} SELECT attributes.tool_name, COUNT(*) as count FROM otel_logs WHERE event = 'task.tool_used' AND attributes.success = true GROUP BY attributes.tool_name ORDER BY count DESC LIMIT 10 ``` **Average task duration by model:** ```sql theme={"system"} SELECT attributes.model, AVG(attributes.duration_ms) as avg_duration_ms, COUNT(*) as task_count FROM otel_logs WHERE event = 'task.completed' GROUP BY attributes.model ``` **Token usage by provider:** ```sql theme={"system"} SELECT attributes.provider, SUM(attributes.tokens_in) as total_tokens_in, SUM(attributes.tokens_out) as total_tokens_out, SUM(attributes.cost) as total_cost FROM otel_logs WHERE event = 'task.tokens' AND timestamp >= NOW() - INTERVAL '30 days' GROUP BY attributes.provider ``` **Tool approval rates:** ```sql theme={"system"} SELECT attributes.tool_name, SUM(CASE WHEN attributes.auto_approved THEN 1 ELSE 0 END)::float / COUNT(*) as auto_approval_rate, COUNT(*) as total_uses FROM otel_logs WHERE event = 'task.tool_used' GROUP BY attributes.tool_name ORDER BY total_uses DESC ``` ## Integration Examples Query syntax below is illustrative. Attribute access varies by platform — for example, `JSON_EXTRACT(attributes, '$.model')` in BigQuery, `attributes['model']` in ClickHouse, or dot notation in Datadog. Adapt to your platform's query language. ### Datadog Dashboard Create custom Datadog dashboards using these events: ```json theme={"system"} { "widgets": [ { "definition": { "type": "timeseries", "requests": [ { "q": "sum:cline.task.completed{*}.as_count()", "display_type": "bars" } ], "title": "Tasks Completed Over Time" } }, { "definition": { "type": "query_value", "requests": [ { "q": "sum:cline.task.tokens{*}", "aggregator": "sum" } ], "title": "Total Tokens Used" } } ] } ``` ### Grafana Queries Example Loki query for tool usage: ```logql theme={"system"} {event="task.tool_used"} | json | line_format "{{.attributes_tool_name}}: {{.attributes_success}}" ``` ### New Relic NRQL Query task completion rates: ```sql theme={"system"} SELECT count(*) FROM Log WHERE event = 'task.completed' FACET attributes.model SINCE 1 day ago ``` ## Event Schema Reference All events follow this structure: ```typescript theme={"system"} interface OtelLogEvent { event: string // Event name (e.g., "task.created") timestamp: string // ISO 8601 timestamp attributes: { // Event-specific attributes [key: string]: string | number | boolean } resource: { service_name: "cline" service_version: string // Extension version host_type: string // vscode | jetbrains | cli } } ``` ## Best Practices Focus on events relevant to your use case. Not all events need dashboards. Alert on error events and usage anomalies for proactive monitoring. Roll up events into metrics for long-term trend analysis. Remember events are already anonymized. Don't attempt to de-anonymize. ## Troubleshooting ### Events Not Appearing If events aren't showing up in your observability platform: 1. **Verify OTel is enabled** in remote configuration or environment variables 2. **Check endpoint configuration** - ensure URL and protocol are correct 3. **Validate credentials** - test with the "Test OTEL Connection" button 4. **Check exporter settings** - ensure logs exporter includes `otlp` 5. **Review platform-specific requirements** - some platforms need specific headers ### Event Volume Concerns If you're seeing excessive event volume: 1. **Sample events** - Configure sampling in your OTel collector 2. **Filter events** - Use your platform's filtering to drop noisy events 3. **Aggregate on collection** - Pre-aggregate metrics before export 4. **Adjust export intervals** - Increase `openTelemetryMetricExportInterval` and batch settings ## See Also Configure OTel integration Backup conversation history Basic telemetry overview # OpenTelemetry Environment Variables Source: https://docs.cline.bot/enterprise-solutions/monitoring/opentelemetry_override Configure OpenTelemetry using environment variables for advanced scenarios This is an **advanced configuration method**. Most users should use [Remote Configuration](/enterprise-solutions/monitoring/opentelemetry) via the dashboard instead. Environment variables provide an alternative way to configure OpenTelemetry, useful for self-hosted deployments, local development, CI/CD pipelines, or when you need to override organization settings. ## When to Use * **Self-hosted deployments** without dashboard access * **Local development and testing** with your own collectors * **CI/CD pipelines** that need observability * **Override organization settings** with user-specific configuration Environment variable configuration bypasses user telemetry settings and will export data regardless of individual preferences. ## Environment Variables ### Core Configuration | Variable | Description | Values | | ------------------------------ | ----------------------------------- | --------------------- | | `CLINE_OTEL_TELEMETRY_ENABLED` | Enable OpenTelemetry export | `"true"` or `"false"` | | `CLINE_OTEL_METRICS_EXPORTER` | Metrics exporters (comma-separated) | `"console"`, `"otlp"` | | `CLINE_OTEL_LOGS_EXPORTER` | Logs exporters (comma-separated) | `"console"`, `"otlp"` | ### OTLP Configuration | Variable | Description | Values | | ----------------------------------- | ---------------------------------------------------------- | --------------------------------------------- | | `CLINE_OTEL_EXPORTER_OTLP_PROTOCOL` | OTLP protocol | `"grpc"`, `"http/json"`, or `"http/protobuf"` | | `CLINE_OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP collector endpoint (applies to both metrics and logs) | URL with optional port | | `CLINE_OTEL_EXPORTER_OTLP_HEADERS` | Authentication headers (comma-separated `key=value` pairs) | `"key=value,key2=value2"` | | `CLINE_OTEL_EXPORTER_OTLP_INSECURE` | Disable TLS for gRPC (local development only) | `"true"` | ### Advanced OTLP Configuration For separate metrics and logs endpoints: | Variable | Description | | ------------------------------------------- | ---------------------------------- | | `CLINE_OTEL_EXPORTER_OTLP_METRICS_PROTOCOL` | Metrics-specific protocol override | | `CLINE_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Metrics-specific endpoint | | `CLINE_OTEL_EXPORTER_OTLP_LOGS_PROTOCOL` | Logs-specific protocol override | | `CLINE_OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` | Logs-specific endpoint | ### Export Tuning | Variable | Description | Default | | ----------------------------------- | --------------------------------------- | ------- | | `CLINE_OTEL_METRIC_EXPORT_INTERVAL` | Milliseconds between metric exports | 60000 | | `CLINE_OTEL_LOG_BATCH_SIZE` | Maximum batch size for log records | 512 | | `CLINE_OTEL_LOG_BATCH_TIMEOUT` | Maximum time before exporting logs (ms) | 5000 | | `CLINE_OTEL_LOG_MAX_QUEUE_SIZE` | Maximum queue size for log records | 2048 | ## Quick Start Examples ### Datadog with gRPC ```bash theme={"system"} export CLINE_OTEL_TELEMETRY_ENABLED=true export CLINE_OTEL_METRICS_EXPORTER=otlp export CLINE_OTEL_LOGS_EXPORTER=otlp export CLINE_OTEL_EXPORTER_OTLP_PROTOCOL=grpc export CLINE_OTEL_EXPORTER_OTLP_ENDPOINT=https://api.datadoghq.com:4317 export CLINE_OTEL_EXPORTER_OTLP_HEADERS="dd-api-key=YOUR_API_KEY" code . ``` The endpoint shown above is for Datadog's **US1 region**. If you're in a different region (EU, US3, US5, AP1, etc.), replace `api.datadoghq.com` with your region-specific hostname (e.g., `api.datadoghq.eu` for EU). See [Datadog's OTLP documentation](https://docs.datadoghq.com/opentelemetry/) for your region's endpoint. ### New Relic with HTTP ```bash theme={"system"} export CLINE_OTEL_TELEMETRY_ENABLED=true export CLINE_OTEL_METRICS_EXPORTER=otlp export CLINE_OTEL_LOGS_EXPORTER=otlp export CLINE_OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf export CLINE_OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.nr-data.net:4318 export CLINE_OTEL_EXPORTER_OTLP_HEADERS="api-key=YOUR_LICENSE_KEY" code . ``` ### Local Development (Insecure) ```bash theme={"system"} export CLINE_OTEL_TELEMETRY_ENABLED=true export CLINE_OTEL_METRICS_EXPORTER=otlp export CLINE_OTEL_LOGS_EXPORTER=otlp export CLINE_OTEL_EXPORTER_OTLP_PROTOCOL=grpc export CLINE_OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 export CLINE_OTEL_EXPORTER_OTLP_INSECURE=true code . ``` ### Console Output (Testing) ```bash theme={"system"} export CLINE_OTEL_TELEMETRY_ENABLED=true export CLINE_OTEL_METRICS_EXPORTER=console export CLINE_OTEL_LOGS_EXPORTER=console code . ``` ## Debugging Enable detailed OpenTelemetry diagnostic logging: ```bash theme={"system"} export TEL_DEBUG_DIAGNOSTICS=true code . ``` This outputs: * Configuration being used * Exporters being created * Connection attempts * Export successes/failures Check the VS Code Developer Tools Console (Help > Toggle Developer Tools) for diagnostic output. ## Configuration Priority When multiple configuration methods are present, Cline uses this priority order: 1. **Environment variables** (highest priority) - This method 2. **Remote Configuration** - Dashboard settings 3. **Default settings** - Built-in defaults Environment variable configuration will override dashboard settings. ## See Also Configure OpenTelemetry via the web dashboard Learn about Remote Configuration system # Enterprise Monitoring Source: https://docs.cline.bot/enterprise-solutions/monitoring/overview Optional telemetry and observability for your Cline deployment Cline includes optional monitoring capabilities for organizations that want to track usage and integrate with their observability infrastructure. ## Monitoring Options Built-in anonymous usage tracking that helps improve Cline (opt-in) Backup conversation history to S3/R2 for compliance and analysis Export metrics and logs to your own observability backends Export to your own observability backends through environment variables (advanced) ## Cline Telemetry Cline includes opt-in telemetry for anonymous usage tracking: * Feature usage patterns * Task completion rates * Error occurrences * Performance metrics Users can enable or disable telemetry in Cline settings. All data is anonymous and does not include code content, file paths, or sensitive information. See [Cline Telemetry](/enterprise-solutions/monitoring/telemetry) for configuration details. ## OpenTelemetry Integration For advanced monitoring needs, Cline supports OpenTelemetry's OTLP (OpenTelemetry Protocol) for exporting metrics and logs to your own infrastructure. This allows you to: * Export telemetry to your existing observability platforms * Integrate with tools like Datadog, New Relic, or Grafana Cloud * Maintain full control over your monitoring data * Aggregate metrics across your organization OpenTelemetry integration is **optional** and requires additional configuration. Most users don't need this feature. See [OpenTelemetry](/enterprise-solutions/monitoring/opentelemetry) for setup instructions. ## Use Cases ### When to Use Cline Telemetry * You want to help improve Cline through anonymous usage data * No additional setup required * Suitable for most users ### When to Use OpenTelemetry * You need granular metrics in your own systems * You're integrating with existing observability infrastructure * You want detailed logs and metrics for debugging * You need custom dashboards or alerting ## Getting Started Decide whether basic telemetry or OpenTelemetry integration fits your needs For basic telemetry, enable it in Cline settings. For OpenTelemetry, see the configuration guide. Confirm telemetry is being collected as expected ## Privacy & Security All Cline monitoring features are designed with privacy in mind: No personal information collected Users can disable at any time Code never leaves your machine Open source - see what's collected ## Next Steps Set up basic telemetry settings Advanced monitoring with OpenTelemetry # Prompt Storage Source: https://docs.cline.bot/enterprise-solutions/monitoring/prompt-storage Backup conversation history to S3 or Cloudflare R2 for compliance, audit, and analysis Prompt Storage allows enterprises to automatically back up Cline conversation history to cloud storage (AWS S3 or Cloudflare R2). This provides a centralized repository for compliance, audit trails, and usage analysis while maintaining local storage as the primary source of truth. ## Overview Every Cline task conversation is stored locally in `~/.cline/data/tasks//api_conversation_history.json`. When prompt storage is enabled, a background sync worker automatically uploads these conversation files to your configured S3 or R2 bucket. Maintain conversation records for regulatory requirements and internal policies. Track AI interactions across your organization with timestamped conversation logs. Analyze conversation patterns, token usage, and model performance at scale. Backup conversation history independent of local storage for business continuity. ## How It Works ```mermaid theme={"system"} graph LR A[User] --> B[Cline Extension] B --> C[Local Storage
~/.cline/data/tasks/] C --> D[Background Sync Worker] D --> E[S3/R2 Bucket] E --> F[Compliance/Analytics] ``` 1. **Local Storage First**: All conversations are written to local disk immediately 2. **Background Sync**: A worker process queues conversation files for upload 3. **Reliable Upload**: Automatic retry logic with configurable batch sizes 4. **Cloud Backup**: Files are stored in your S3/R2 bucket with the same path structure ## Storage Architecture ### What Gets Stored Prompt storage uploads the following files from each task: | File | Content | Purpose | | ------------------------------- | -------------------------------------------------- | ----------------------------------- | | `api_conversation_history.json` | Full conversation in Anthropic MessageParam format | Core conversation data for analysis | | Task metadata | Task ID, timestamps, model info | Correlation and indexing | ### What's NOT Stored Prompt storage **does not** include: * ❌ Workspace files not accessed by Cline * ❌ API keys or secrets * ❌ User credentials or authentication tokens Conversation history includes **all tool inputs and outputs**. This means code written via `write_to_file`, file contents read via `read_file`, and command outputs are included in the uploaded data. Review your compliance and data classification requirements before enabling. ### Storage Path Pattern Files are uploaded to your bucket following this structure: ``` s3://your-bucket/tasks/{taskId}/api_conversation_history.json ``` This mirrors the local storage structure, making it easy to correlate local and cloud data. ## Configuration Prompt storage is configured through Remote Configuration in the `enterpriseTelemetry.promptUploading` section. ### Schema ```json theme={"system"} { "enterpriseTelemetry": { "promptUploading": { "enabled": true, "type": "s3_access_keys", "s3AccessSettings": { "bucket": "your-cline-prompts", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "region": "us-east-1", "intervalMs": 30000, "maxRetries": 5, "batchSize": 10, "maxQueueSize": 1000, "maxFailedAgeMs": 604800000, "backfillEnabled": false } } } } ``` ### Configuration Fields #### Core Settings | Field | Type | Required | Description | | --------- | ------- | -------- | ------------------------------------------------------ | | `enabled` | boolean | Yes | Enable/disable prompt storage | | `type` | string | Yes | Storage type: `"s3_access_keys"` or `"r2_access_keys"` | #### Access Settings (S3/R2) | Field | Type | Required | Description | Default | | ----------------- | ------ | -------- | -------------------------------- | ------- | | `bucket` | string | Yes | S3/R2 bucket name | - | | `accessKeyId` | string | Yes | AWS/Cloudflare access key ID | - | | `secretAccessKey` | string | Yes | AWS/Cloudflare secret access key | - | | `region` | string | S3 only | AWS region (e.g., `us-east-1`) | - | | `endpoint` | string | R2 only | Cloudflare R2 endpoint URL | - | | `accountId` | string | R2 only | Cloudflare account ID | - | #### Sync Worker Settings | Field | Type | Description | Default | | ----------------- | ------- | ----------------------------------- | ------------------ | | `intervalMs` | number | Milliseconds between sync attempts | 30000 (30s) | | `maxRetries` | number | Maximum retries before giving up | 5 | | `batchSize` | number | Items to process per interval | 10 | | `maxQueueSize` | number | Maximum queue size before eviction | 1000 | | `maxFailedAgeMs` | number | Time before discarding failed items | 604800000 (7 days) | | `backfillEnabled` | boolean | Sync existing tasks on startup | false | ## Setup Guides ### AWS S3 Configuration Create a dedicated S3 bucket for Cline conversation storage: ```bash theme={"system"} aws s3 mb s3://your-cline-prompts --region us-east-1 ``` Enable versioning and encryption: ```bash theme={"system"} aws s3api put-bucket-versioning \ --bucket your-cline-prompts \ --versioning-configuration Status=Enabled aws s3api put-bucket-encryption \ --bucket your-cline-prompts \ --server-side-encryption-configuration '{ "Rules": [{ "ApplyServerSideEncryptionByDefault": { "SSEAlgorithm": "AES256" } }] }' ``` Create an IAM policy with minimal required permissions: ```json theme={"system"} { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:PutObjectAcl", "s3:GetObject", "s3:DeleteObject" ], "Resource": "arn:aws:s3:::your-cline-prompts/*" }, { "Effect": "Allow", "Action": [ "s3:ListBucket" ], "Resource": "arn:aws:s3:::your-cline-prompts" } ] } ``` Save this as `cline-prompt-storage-policy.json` and create the policy: ```bash theme={"system"} aws iam create-policy \ --policy-name ClinePromptStorage \ --policy-document file://cline-prompt-storage-policy.json ``` Create a dedicated IAM user and attach the policy: ```bash theme={"system"} aws iam create-user --user-name cline-prompt-uploader aws iam attach-user-policy \ --user-name cline-prompt-uploader \ --policy-arn arn:aws:iam::YOUR_ACCOUNT_ID:policy/ClinePromptStorage aws iam create-access-key --user-name cline-prompt-uploader ``` Save the `AccessKeyId` and `SecretAccessKey` from the output. In the Cline admin console at [app.cline.bot](https://app.cline.bot): 1. Navigate to **Settings** → **Enterprise Telemetry** 2. Enable **Prompt Uploading** 3. Select **S3** as the storage type 4. Enter your bucket name, access key ID, secret key, and region 5. Configure sync worker settings (or use defaults) 6. Save configuration Use the "Test Connection" button in the admin console to verify: * Bucket access * Write permissions * Credential validity A test file will be uploaded and deleted from your bucket. ### Optional: Lifecycle Policies Configure retention policies for cost management: ```json theme={"system"} { "Rules": [ { "Id": "ArchiveOldPrompts", "Status": "Enabled", "Transitions": [ { "Days": 90, "StorageClass": "GLACIER" } ] }, { "Id": "DeleteOldPrompts", "Status": "Enabled", "Expiration": { "Days": 2555 } } ] } ``` ### Cloudflare R2 Configuration 1. Log in to the [Cloudflare Dashboard](https://dash.cloudflare.com) 2. Navigate to **R2** in the sidebar 3. Click **Create bucket** 4. Name your bucket (e.g., `cline-prompts`) 5. Select a location close to your users 6. Click **Create bucket** 1. In the R2 dashboard, click **Manage R2 API Tokens** 2. Click **Create API token** 3. Configure permissions: * **Token name**: Cline Prompt Storage * **Permissions**: Object Read & Write * **Bucket**: Select your bucket or use All buckets 4. Click **Create API Token** 5. Save the **Access Key ID** and **Secret Access Key** 6. Note your **Account ID** (shown in the R2 overview) Your R2 endpoint follows this format: ``` https://.r2.cloudflarestorage.com ``` Find your account ID in the Cloudflare dashboard under R2 overview. In the Cline admin console at [app.cline.bot](https://app.cline.bot): 1. Navigate to **Settings** → **Enterprise Telemetry** 2. Enable **Prompt Uploading** 3. Select **R2** as the storage type 4. Enter: * Bucket name * Access key ID * Secret access key * Account ID * Endpoint URL 5. Configure sync worker settings (or use defaults) 6. Save configuration Use the "Test Connection" button to verify: * Bucket access with provided credentials * Write permissions * Endpoint connectivity ### Cost Advantages R2 offers significant cost advantages over S3: * **No egress fees**: Download data at no cost * **Lower storage costs**: \~$0.015/GB vs S3's ~$0.023/GB * **Global edge access**: Fast access from anywhere ## Sync Worker Behavior The background sync worker manages the upload queue with these characteristics: ### Queue Management * **FIFO ordering**: Files are uploaded in the order they were created * **Automatic batching**: Processes up to `batchSize` items per interval * **Queue size limits**: Evicts oldest items when `maxQueueSize` is exceeded * **Retry logic**: Failed uploads are retried up to `maxRetries` times ### Failure Handling When an upload fails: 1. **Immediate retry**: Item stays in queue for next sync interval 2. **Exponential backoff**: Retry attempts are spaced out 3. **Maximum retries**: After `maxRetries` attempts, item is marked as permanently failed 4. **Age-based cleanup**: Failed items older than `maxFailedAgeMs` are discarded 5. **No data loss**: Local files remain intact regardless of sync status ### Backfill Mode When `backfillEnabled` is set to `true`: * On first startup, scans all existing tasks in `~/.cline/data/tasks/` * Queues conversation files that haven't been uploaded * Useful for enabling prompt storage on an existing Cline deployment * Can generate significant upload volume — monitor queue size Enable backfill carefully on large deployments. Consider starting with `backfillEnabled: false` and monitoring the steady-state queue before enabling backfill. ## Monitoring & Observability ### Integration with OpenTelemetry While prompt storage operates independently, it integrates with Cline's observability system: * **Task lifecycle events**: `task.created`, `task.completed` track when conversations are generated * **Conversation events**: `task.conversation_turn`, `task.tokens` provide usage metrics * **Local monitoring**: Sync worker status is logged but not yet exported as OTel events See [OpenTelemetry](/enterprise-solutions/monitoring/opentelemetry) for configuring metrics export. ### CloudWatch Monitoring (S3) Monitor S3 upload activity with CloudWatch: ```bash theme={"system"} # View PutObject requests (uploads) aws cloudwatch get-metric-statistics \ --namespace AWS/S3 \ --metric-name NumberOfObjects \ --dimensions Name=BucketName,Value=your-cline-prompts \ --start-time 2026-03-01T00:00:00Z \ --end-time 2026-03-08T00:00:00Z \ --period 3600 \ --statistics Sum ``` ### R2 Analytics Cloudflare R2 provides built-in analytics in the dashboard: * Request counts and rates * Storage usage over time * Bandwidth utilization * Error rates ## Security & Compliance ### Encryption **At Rest:** * S3: Enable server-side encryption (SSE-S3 or SSE-KMS) * R2: Encryption enabled by default **In Transit:** * All uploads use HTTPS/TLS * Credentials are never logged or exposed ### Access Control **Recommended IAM policies:** * Use dedicated IAM users/roles * Limit permissions to write-only if read access isn't needed * Enable MFA for credential generation * Rotate access keys regularly **Bucket policies:** ```json theme={"system"} { "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Principal": "*", "Action": "s3:*", "Resource": [ "arn:aws:s3:::your-cline-prompts/*", "arn:aws:s3:::your-cline-prompts" ], "Condition": { "Bool": { "aws:SecureTransport": "false" } } } ] } ``` ### Audit Logging **S3 Server Access Logging:** ```bash theme={"system"} aws s3api put-bucket-logging \ --bucket your-cline-prompts \ --bucket-logging-status '{ "LoggingEnabled": { "TargetBucket": "your-log-bucket", "TargetPrefix": "cline-prompts-access/" } }' ``` **CloudTrail for API Calls:** Enable CloudTrail to track all S3 API operations on your bucket. ### Data Retention Implement retention policies based on your compliance requirements: * **GDPR**: Consider right to erasure * **SOC 2**: Maintain audit trails for required period * **HIPAA**: Ensure appropriate retention and disposal ## Troubleshooting ### Common Issues **Symptoms**: `maxQueueSize` limit reached, oldest items being evicted **Causes**: * Upload rate slower than conversation creation rate * Network connectivity issues * Insufficient batch size or interval **Solutions**: 1. Increase `batchSize` to process more items per interval 2. Decrease `intervalMs` to sync more frequently 3. Check network connectivity and credentials 4. Temporarily increase `maxQueueSize` while investigating **Symptoms**: Repeated upload failures, items reaching `maxRetries` **Causes**: * Invalid or expired credentials * Insufficient IAM permissions * Bucket policy denying access **Solutions**: 1. Verify credentials are correct in remote config 2. Check IAM policy includes `s3:PutObject` permission 3. Review bucket policies for deny rules 4. Test with AWS CLI: `aws s3 cp test.txt s3://your-bucket/` **Symptoms**: Connection timeouts, failed uploads **Causes**: * Incorrect endpoint URL * Firewall blocking Cloudflare IPs * Invalid account ID **Solutions**: 1. Verify endpoint format: `https://.r2.cloudflarestorage.com` 2. Check firewall rules allow HTTPS to Cloudflare IPs 3. Confirm account ID in Cloudflare dashboard 4. Test with curl: `curl -I https://.r2.cloudflarestorage.com` **Symptoms**: Queue at max size immediately after enabling backfill **Causes**: * Large number of existing tasks * Backfill queuing faster than upload processing **Solutions**: 1. Disable backfill temporarily: `"backfillEnabled": false` 2. Let steady-state queue drain first 3. Increase `batchSize` and decrease `intervalMs` 4. Consider `maxQueueSize` increase during backfill period 5. Re-enable backfill once queue is stable ### Debug Logging Enable debug logging to diagnose sync issues: 1. Check extension developer console (Help → Toggle Developer Tools) 2. Look for `[ClineBlobStorage]` and `[SyncWorker]` log entries 3. Failed uploads log error messages with details ### Testing Configuration Use the built-in test connection feature: ```typescript theme={"system"} // Programmatic test (for custom integrations) import { testPromptUploading } from '@/core/controller/state/testPromptUploading' await testPromptUploading(controller) // Returns: { success: boolean, message: string } ``` ## Data Format Reference ### Conversation File Schema Uploaded `api_conversation_history.json` files contain an array of messages: ```json theme={"system"} [ { "role": "user", "content": [ { "type": "text", "text": "Create a React component for a todo list" } ] }, { "role": "assistant", "content": [ { "type": "text", "text": "I'll create a todo list component..." }, { "type": "tool_use", "id": "toolu_123", "name": "write_to_file", "input": { "path": "TodoList.tsx", "content": "..." } } ] } ] ``` This follows the [Anthropic Messages API format](https://docs.anthropic.com/claude/reference/messages_post). ### Metadata Schema Task metadata includes: ```json theme={"system"} { "taskId": "1234567890", "createdAt": "2026-03-05T10:30:00Z", "lastModified": "2026-03-05T11:45:00Z", "modelInfo": { "id": "claude-sonnet-4", "provider": "anthropic" }, "tokensUsed": { "input": 1250, "output": 3400 } } ``` ## Best Practices Test with a single team or project before rolling out organization-wide. Set up billing alerts and review storage usage monthly. Use dedicated IAM users with minimal permissions and rotate keys regularly. Define and implement data retention policies based on compliance needs. ## See Also Configure metrics and logs export for comprehensive observability Learn about Cline's built-in anonymous usage tracking Understand the remote configuration system # Cline Telemetry Source: https://docs.cline.bot/enterprise-solutions/monitoring/telemetry Configure usage analytics and event tracking Cline includes telemetry to help understand usage patterns and improve the product. Users can control whether to share this data. ## What is Cline Telemetry? Telemetry captures anonymous usage events such as: * Features used (which tools and commands) * Task completion rates * Error occurrences * Performance metrics All telemetry data is **anonymous** and does not include code content, file contents, or other sensitive information. ## User Controls ### Enabling/Disabling Cline Telemetry Individual users can control telemetry through Cline settings: 1. Open Cline settings 2. Find "Cline Telemetry" toggle 3. Enable or disable as preferred Changes take effect immediately. ### What Gets Collected When telemetry is enabled, Cline captures: * Tools executed (e.g., read\_file, execute\_command) * Slash commands used * Skills triggered * Settings changed * Task started/completed events * Mode switches (Plan/Act) * Checkpoint usage * Task duration * API failures * Tool execution errors * System errors * Error types and frequencies ### What Doesn't Get Collected Cline Telemetry **never** includes: * Your code or file contents * File paths or names * Command arguments or parameters * Conversation content * Personal information * API keys or credentials ## Enterprise Configuration Administrators can set default telemetry state through remote configuration: ```json theme={"system"} { "telemetryEnabled": true } ``` Even with enterprise configuration, individual users can still disable Cline Telemetry in their local settings. ## Enterprise Monitoring Features For organizations with additional compliance or monitoring requirements, Cline provides: ### Prompt Storage Automatically backup conversation history to AWS S3 or Cloudflare R2 for: * Compliance and audit trails * Usage analysis and reporting * Disaster recovery See [Prompt Storage](/enterprise-solutions/monitoring/prompt-storage) for configuration details. ### OpenTelemetry Integration Export detailed metrics and logs to your own observability platforms like Datadog, New Relic, or Grafana Cloud. See [OpenTelemetry](/enterprise-solutions/monitoring/opentelemetry) for setup instructions. ## Privacy Cline's telemetry is designed with privacy in mind: No personal information is collected Users can disable at any time Code never leaves your machine Open source - see exactly what's collected ## Why Telemetry Matters Anonymous usage data helps: * **Identify bugs**: Discover issues affecting users * **Prioritize features**: Focus on most-used capabilities * **Improve performance**: Find and fix slow operations * **Enhance reliability**: Track and reduce error rates ## Related Enterprise monitoring and observability See what data is collected # Onboarding Source: https://docs.cline.bot/enterprise-solutions/onboarding This guide explains how administrators configure SSO provisioning and user management in Cline Enterprise. ## Overview Cline Enterprise integrates with your existing identity provider (IdP) via WorkOS to deliver secure SSO and zero-touch user lifecycle management. In this guide, you'll connect your IdP (Okta, Azure AD, Google Workspace, or any SAML/OIDC provider), enable just-in-time (JIT) provisioning so new users are created automatically on first sign-in, and configure role mapping so permissions stay aligned with your directory-no manual invites or seat reconciliations required. ## Prerequisites * [Cline Enterprise License](https://cline.bot/contact-sales) * Access to your identity provider (IdP) configuration (e.g., Okta, Azure AD, Google Workspace) * Knowledge of your organization's SSO requirements ## Configuration Steps ### Step 1: Onboard to Cline Enterprise license Your IdP administrator will receive an email with a link to register their organization with WorkOS during onboarding. ### Step 2: Configure Your Identity Provider For a short overview of where SSO configuration lives (Cline dashboard vs WorkOS vs your IdP), see [SSO Setup](/enterprise-solutions/sso-setup). Connect your identity provider (IdP) to WorkOS: 1. In the WorkOS dashboard, go to **AuthKit → Connections** 2. Click **Add Connection** 3. Select your identity provider (e.g., Okta, Azure AD, Google Workspace, Generic SAML/OIDC) 4. Follow the provider-specific setup instructions Each identity provider (IdP) will have its own setup process and required fields. Be sure to follow the specific instructions in the WorkOS dashboard for your chosen provider. For more explicit instruction on connecting your IdP, refer to the [WorkOS SSO documentation](https://workos.com/docs/authkit/sso) ### Step 3: Configure User Provisioning Cline Enterprise uses **just-in-time provisioning** that works automatically: * **Organizations are created automatically** * **Users gain access automatically** on their first SSO sign-in, once their credentials have been configured by the IdP administrator. * **Roles sync automatically** from your IdP (Admin/Owner → Admin, Member → Member) * **No manual user invites or seat management** required No additional configuration is needed. Users are provisioned automatically when they sign in through SSO. ### Step 4: Configure User Attributes Mapping User roles are mapped automatically from your IdP: * **Admin** in IdP → **Admin** role in Cline (Note: The first Owner of the org is created manually during onboarding) * **Member** in IdP → **Member** role in Cline For what each role can access, see the [Roles and Permissions](/enterprise-solutions/team-management/managing-members) page. If needed, you can configure additional user attributes in the Cline Admin console: 1. Go to **Settings → Authentication → User Attributes** 2. Map attributes such as email and name based on your IdP configuration For information about available user attributes, see the [WorkOS User Object Documentation](https://workos.com/docs/authkit/user-management). ### Step 5: Test SSO Connection Before allowing users to sign in, test the SSO flow to ensure everything is configured correctly. **To test the connection:** 1. In the WorkOS dashboard (or Cline Admin console if available), locate and click **Test SSO Connection** 2. You'll be redirected to your IdP's login page 3. Enter valid credentials for a test user 4. After successful authentication, you should be redirected back 5. Confirm that the user's information (name, email, role) displays correctly **Expected outcome:** The test user is authenticated, their account details are visible, and their role matches what's configured in your IdP. **If the test fails:** Double-check your IdP configuration (redirect URIs, SAML certificates, attribute mappings). See the [WorkOS SSO documentation](https://workos.com/docs/authkit/sso) for troubleshooting guidance. ### User Access Once SSO is configured, users in your IdP can access Cline automatically without manual invites or account setup. **First-time sign-in flow:** 1. User navigates to Cline and clicks **Sign in with SSO** 2. User authenticates via your organization's IdP 3. Cline automatically creates their account in your Organization 4. Role is assigned based on their IdP role (see [Step 4](#step-4-configure-user-attributes-mapping)) 5. User is redirected to Cline and can begin working **What happens automatically:** * Account creation with correct organization assignment * Role and permission assignment * Basic profile information (name, email) populated from IdP **No action required:** Users don't need to request access or wait for approval. Access is granted immediately upon successful IdP authentication. ### Managing Access All access management and revocation of users is currently handled by your IdP: * Add users → access granted automatically on first login * Change roles → updated on next login * Remove users → access revoked automatically Role changes sync automatically on the user's next sign-in. ### Changing your IdP In order to change to a different IdP, please contact support and we will guide you through this process. *** ## Verification Steps to verify successful configuration: 1. **Test User Sign-In**: Have a test user sign in through the SSO flow (access is granted automatically on first login) 2. **Verify User Provisioning**: Confirm that the user is automatically created and has appropriate role permissions 3. **Check User Attributes**: Verify that user information (name, email, organization) is correctly populated 4. **Test Role Changes**: Update a user's role in your IdP and verify it syncs on their next login 5. **Test User Deprovisioning**: Remove a user from your IdP and verify they lose access to Cline on their next login attempt 6. **Review Audit Logs**: Check WorkOS audit logs to ensure authentication events are being recorded *** # Cline Enterprise Source: https://docs.cline.bot/enterprise-solutions/overview Enterprise security, governance, and observability for the coding agent millions of developers trust Cline Enterprise brings centralized governance to the same open-source architecture that millions of developers already use. Your code stays in your environment, you use your own inference at your negotiated rates, and you get the security and observability capabilities that platform teams need for org-wide deployment. Visit our website for detailed information about enterprise features, pricing, and deployment options. ## What You Get It delivers five core capabilities that platform teams need for production deployment. Each addresses a specific requirement for scaling AI coding across your organization. ### Security by Design Your code never leaves your environment. Cline processes everything locally - no uploads, no indexing, no training on your data. All processing happens within your environment Code and context never transmitted externally Repositories are never indexed or cached Your code and prompts aren't used for training ### Bring Your Own Inference Use your existing cloud contracts and negotiated rates. Most AI tools force you to buy inference through them with markup. Cline connects directly to your providers. Connect to any inference provider: * AWS Bedrock * Google Vertex AI * Azure OpenAI * Anthropic direct * OpenAI direct * Cerebras * Any OpenAI-compatible endpoint Switch models instantly as new ones release. Use Claude Sonnet 4.5 as your daily driver, GPT-5 for complex refactoring, open-source models for simple tasks. Your existing cloud credits and startup program contracts now cover AI coding. We handle the agent loop. You handle the inference. No markup, no vendor lock-in. ### Governance at Scale Platform teams need central control when thousands of developers use AI. Individual API keys scattered across laptops create security risks and cost overruns. Enterprise governance provides: * **SSO authentication**: Corporate credentials instead of personal API keys * **Role-based access control**: Three-tier hierarchy (Member/Admin/Owner) with organization-scoped permissions * **Model and tool controls**: Govern which models and tools each team accesses * **Remote configuration**: Manage settings for all developers from one dashboard * **Usage tracking and observability**: OpenTelemetry integration for monitoring usage, costs, and performance with selective audit logging for administrative operations Configure once, deploy everywhere. Developers work how they prefer while you maintain control. ### Complete Observability Export logs to your existing observability stack. Track usage, costs, and performance across all teams. * **OpenTelemetry export**: Direct integration with Datadog, Grafana, Splunk * **Real-time analytics**: Track adoption, performance, and patterns * **Cost breakdown**: See exactly what each team spends on which models * **JSON output**: Build custom dashboards in your existing tools The same observability standards you require for production systems. ## Deployment Cline Enterprise connects securely to your infrastructure. Deploy in cloud environments. Configure to work with your existing security policies and compliance requirements. Rolling out to your organization: 1. Configure Cline Core to connect to your infrastructure 2. Set SSO, RBAC, and governance policies 3. Deploy to developers via your existing software distribution 4. Monitor usage through your observability tools ## Next Steps * Review security architecture * Configure [cloud provider setup](/provider-config/aws-bedrock/api-key) (AWS Bedrock, Vertex AI, Azure) * Set up [MCP servers](/mcp/mcp-overview) for custom tooling * Add [custom instructions](/customization/cline-rules) for your codebase Schedule a walkthrough to see how Cline Enterprise fits your infrastructure. We'll work with your security and compliance requirements to deploy in your environment. # SSO Setup Source: https://docs.cline.bot/enterprise-solutions/sso-setup Configure Single Sign-On (SSO) for Cline Enterprise via WorkOS AuthKit. ## Overview Cline Enterprise integrates with your identity provider (IdP) via **WorkOS AuthKit** for SSO. This page describes, at a high level, how SSO is set up for Cline Enterprise using WorkOS AuthKit. If you haven't completed initial onboarding, start with [Onboarding](/enterprise-solutions/onboarding). ### Video Walkthrough