|
|
@@ -1,482 +1,426 @@
|
|
|
---
|
|
|
title: "CLI Reference"
|
|
|
-description: "Complete command reference for Cline CLI including configuration, instance management, and task commands"
|
|
|
+description: "Complete command reference for Cline CLI including all commands, flags, and configuration options"
|
|
|
---
|
|
|
|
|
|
-Complete command reference for Cline CLI. Use this for detailed documentation on all commands, options, and configuration.
|
|
|
+# CLI Reference
|
|
|
|
|
|
-For quick help in your terminal:
|
|
|
+This page documents all available commands, flags, and configuration options for Cline CLI. For quick help in your terminal, use:
|
|
|
|
|
|
```bash
|
|
|
cline --help # Show all commands
|
|
|
-cline task --help # Show task-specific commands
|
|
|
-man cline # View the full manual page
|
|
|
+cline task --help # Show task command options
|
|
|
+cline auth --help # Show auth command options
|
|
|
+man cline # View the full manual page (if installed)
|
|
|
```
|
|
|
|
|
|
-## Manual Page
|
|
|
-
|
|
|
-The complete manual page for the Cline CLI:
|
|
|
+## Synopsis
|
|
|
|
|
|
+```bash
|
|
|
+cline [prompt] [options]
|
|
|
+cline <command> [options] [arguments]
|
|
|
```
|
|
|
-CLINE(1) User Commands CLINE(1)
|
|
|
-
|
|
|
-NAME
|
|
|
- cline - orchestrate and interact with Cline AI coding agents
|
|
|
-
|
|
|
-SYNOPSIS
|
|
|
- cline [prompt] [options]
|
|
|
-
|
|
|
- cline command [subcommand] [options] [arguments]
|
|
|
-
|
|
|
-DESCRIPTION
|
|
|
- Try: cat README.md | cline "Summarize this for me:"
|
|
|
-
|
|
|
- cline is a command-line interface for orchestrating multiple Cline AI
|
|
|
- coding agents. Cline is an autonomous AI agent who can read, write,
|
|
|
- and execute code across your projects. He operates through a
|
|
|
- client-server architecture where Cline Core runs as a standalone
|
|
|
- service, and the CLI acts as a scriptable interface for managing tasks,
|
|
|
- instances, and agent interactions.
|
|
|
-
|
|
|
- The CLI is designed for both interactive use and automation, making it
|
|
|
- ideal for CI/CD pipelines, parallel task execution, and terminal-based
|
|
|
- workflows. Multiple frontends (CLI, VSCode, JetBrains) can attach to
|
|
|
- the same Cline Core instance, enabling seamless task handoff between
|
|
|
- environments.
|
|
|
-
|
|
|
-MODES OF OPERATION
|
|
|
- Instant Task Mode
|
|
|
- The simplest invocation: cline "prompt here" immediately spawns
|
|
|
- an instance, creates a task, and enters chat mode. This is
|
|
|
- equivalent to running cline instance new && cline task new &&
|
|
|
- cline task chat in sequence.
|
|
|
-
|
|
|
- Subcommand Mode
|
|
|
- Advanced usage with explicit control: cline <command>
|
|
|
- [subcommand] [options] provides fine-grained control over
|
|
|
- instances, tasks, authentication, and configuration.
|
|
|
-
|
|
|
-AGENT BEHAVIOR
|
|
|
- Cline operates in two primary modes:
|
|
|
-
|
|
|
- ACT MODE
|
|
|
- Cline actively uses tools to accomplish tasks. He can read
|
|
|
- files, write code, execute commands, use a headless browser, and
|
|
|
- more. This is the default mode for task execution.
|
|
|
-
|
|
|
- PLAN MODE
|
|
|
- Cline gathers information and creates a detailed plan before
|
|
|
- implementation. He explores the codebase, asks clarifying
|
|
|
- questions, and presents a strategy for user approval before
|
|
|
- switching to ACT MODE.
|
|
|
-
|
|
|
-INSTANT TASK OPTIONS
|
|
|
- When using the instant task syntax cline "prompt" the following options
|
|
|
- are available:
|
|
|
-
|
|
|
- -o, --oneshot
|
|
|
- Full autonomous mode. Cline completes the task and stops
|
|
|
- following after completion. Example: cline -o "what's 6 + 8?"
|
|
|
-
|
|
|
- -s, --setting setting value
|
|
|
- Override a setting for this task
|
|
|
-
|
|
|
- -y, --no-interactive, --yolo
|
|
|
- Enable fully autonomous mode. Disables all interactivity:
|
|
|
-
|
|
|
- • ask_followup_question tool is disabled
|
|
|
-
|
|
|
- • attempt_completion happens automatically
|
|
|
-
|
|
|
- • execute_command runs in non-blocking mode with timeout
|
|
|
-
|
|
|
- • PLAN MODE automatically switches to ACT MODE
|
|
|
-
|
|
|
- -m, --mode mode
|
|
|
- Starting mode. Options: act (default), plan
|
|
|
-
|
|
|
- -w, --workspace path
|
|
|
- Additional workspace paths. Can be specified multiple times to
|
|
|
- include multiple directories. The current working directory is
|
|
|
- always included as the first workspace. Example: cline -w
|
|
|
- /path/to/other/project "refactor shared code"
|
|
|
|
|
|
-GLOBAL OPTIONS
|
|
|
- These options apply to all subcommands:
|
|
|
+## Global Options
|
|
|
|
|
|
- -F, --output-format format
|
|
|
- Output format. Options: rich (default), json, plain
|
|
|
+These options work with any command:
|
|
|
|
|
|
- -h, --help
|
|
|
- Display help information for the command.
|
|
|
+| Option | Description |
|
|
|
+|--------|-------------|
|
|
|
+| `--config <path>` | Use a custom configuration directory instead of `~/.cline/data/` |
|
|
|
+| `-c, --cwd <path>` | Set the working directory for the task |
|
|
|
+| `-v, --verbose` | Show detailed output including model reasoning |
|
|
|
+| `--help` | Show help for the command |
|
|
|
|
|
|
- -v, --verbose
|
|
|
- Enable verbose output for debugging.
|
|
|
+## Modes of Operation
|
|
|
|
|
|
-COMMANDS
|
|
|
- Authentication
|
|
|
- cline auth [provider] [key]
|
|
|
+Cline CLI automatically detects the best output mode based on how you invoke it:
|
|
|
|
|
|
- cline a [provider] [key]
|
|
|
- Configure authentication for AI model providers. Launches an
|
|
|
- interactive wizard if no arguments provided. If provider is
|
|
|
- specified without a key, prompts for the key or launches the
|
|
|
- appropriate OAuth flow.
|
|
|
+| Mode | When Activated | Description |
|
|
|
+|------|----------------|-------------|
|
|
|
+| **Interactive** | `cline` with no args, TTY connected | Rich terminal UI with real-time streaming, keyboard shortcuts, and visual feedback. |
|
|
|
+| **Task** | `cline "prompt"` with TTY connected | Interactive UI starts immediately with your task. |
|
|
|
+| **Plain Text** | stdin piped, stdout redirected, or `--yolo`/`--json` flags | Clean text output without UI, suitable for scripting and CI/CD. |
|
|
|
|
|
|
- Instance Management
|
|
|
- Cline Core instances are independent agent processes that can run in
|
|
|
- the background. Multiple instances can run simultaneously, enabling
|
|
|
- parallel task execution.
|
|
|
+## Agent Behavior
|
|
|
|
|
|
- cline instance
|
|
|
+Cline operates in two primary modes that control how it approaches tasks:
|
|
|
|
|
|
- cline i
|
|
|
- Display instance management help.
|
|
|
+| Mode | Description |
|
|
|
+|------|-------------|
|
|
|
+| **Act Mode** (default) | Cline actively uses tools to accomplish tasks. It can read files, write code, execute commands, use a headless browser, and more. |
|
|
|
+| **Plan Mode** | Cline gathers information and creates a detailed plan before implementation. It explores the codebase, asks clarifying questions, and presents a strategy for your approval before switching to Act Mode. |
|
|
|
|
|
|
- cline instance new [-d|--default]
|
|
|
+Use `-a, --act` or `-p, --plan` flags to explicitly set the mode.
|
|
|
|
|
|
- cline i n [-d|--default]
|
|
|
- Spawn a new Cline Core instance. Use --default to set it as
|
|
|
- the default instance for subsequent commands.
|
|
|
+## Commands
|
|
|
|
|
|
- cline instance list
|
|
|
+### cline (default)
|
|
|
|
|
|
- cline i l
|
|
|
- List all running Cline Core instances with their addresses and
|
|
|
- status.
|
|
|
+Run Cline without a subcommand to start a task or enter interactive mode.
|
|
|
|
|
|
- cline instance default address
|
|
|
-
|
|
|
- cline i d address
|
|
|
- Set the default instance to avoid specifying --address in task
|
|
|
- commands.
|
|
|
-
|
|
|
- cline instance kill address [-a|--all]
|
|
|
-
|
|
|
- cline i k address [-a|--all]
|
|
|
- Terminate a Cline Core instance. Use --all to kill all running
|
|
|
- instances.
|
|
|
-
|
|
|
- Task Management
|
|
|
- Tasks represent individual work items that Cline executes. Tasks
|
|
|
- maintain conversation history, checkpoints, and settings.
|
|
|
-
|
|
|
- cline task [-a|--address ADDR]
|
|
|
-
|
|
|
- cline t [-a|--address ADDR]
|
|
|
- Display task management help. The --address flag specifies
|
|
|
- which Cline Core instance to use (e.g., localhost:50052).
|
|
|
-
|
|
|
- cline task new prompt [options]
|
|
|
-
|
|
|
- cline t n prompt [options]
|
|
|
- Create a new task in the default or specified instance.
|
|
|
- Options:
|
|
|
-
|
|
|
- -s, --setting setting value
|
|
|
- Set task-specific settings
|
|
|
-
|
|
|
- -y, --no-interactive, --yolo
|
|
|
- Enable autonomous mode
|
|
|
+```bash
|
|
|
+# Interactive mode (no arguments)
|
|
|
+cline
|
|
|
|
|
|
- -m, --mode mode
|
|
|
- Starting mode (act or plan)
|
|
|
+# Start a task directly
|
|
|
+cline "your prompt here"
|
|
|
+```
|
|
|
|
|
|
- cline task open task-id [options]
|
|
|
+**Options:**
|
|
|
+
|
|
|
+| Option | Description |
|
|
|
+|--------|-------------|
|
|
|
+| `-a, --act` | Start in Act mode (default). Cline executes actions directly. |
|
|
|
+| `-p, --plan` | Start in Plan mode. Cline analyzes and creates a strategy before acting. |
|
|
|
+| `-y, --yolo` | YOLO mode: auto-approve all actions, use plain text output, exit when complete. Ideal for CI/CD. |
|
|
|
+| `-m, --model <id>` | Use a specific model (e.g., `claude-sonnet-4-5-20250929`, `gpt-4o`). |
|
|
|
+| `-i, --images <paths...>` | Include image files with the prompt. |
|
|
|
+| `--thinking` | Enable extended thinking with a 1024 token budget. |
|
|
|
+| `--json` | Output messages as JSON (one object per line). Forces plain text mode. |
|
|
|
+| `--timeout <seconds>` | Maximum execution time before the task is stopped. |
|
|
|
+
|
|
|
+**Mode Behavior:**
|
|
|
+
|
|
|
+| Invocation | Output Mode | Why |
|
|
|
+|------------|-------------|-----|
|
|
|
+| `cline` | Interactive UI | No arguments, TTY connected |
|
|
|
+| `cline "prompt"` | Interactive UI | TTY connected |
|
|
|
+| `cline -y "prompt"` | Plain text | YOLO flag forces plain text |
|
|
|
+| `cline --json "prompt"` | JSON | JSON flag forces plain text |
|
|
|
+| `cat file \| cline "prompt"` | Plain text | stdin is piped |
|
|
|
+| `cline "prompt" > out.txt` | Plain text | stdout is redirected |
|
|
|
|
|
|
- cline t o task-id [options]
|
|
|
- Resume a previous task from history. Accepts the same options
|
|
|
- as task new.
|
|
|
+---
|
|
|
|
|
|
- cline task list
|
|
|
+### cline task (alias: t)
|
|
|
|
|
|
- cline t l
|
|
|
- List all tasks in history with their id and snippet
|
|
|
+Run a task with a prompt. This is equivalent to `cline "prompt"`.
|
|
|
|
|
|
- cline task chat
|
|
|
+```bash
|
|
|
+cline task "Create a REST API endpoint"
|
|
|
+cline t "Fix the bug in utils.js"
|
|
|
+```
|
|
|
|
|
|
- cline t c
|
|
|
- Enter interactive chat mode for the current task. Allows
|
|
|
- back-and-forth conversation with Cline.
|
|
|
+**Options:** Same as the default command above.
|
|
|
|
|
|
- cline task send [message] [options]
|
|
|
+---
|
|
|
|
|
|
- cline t s [message] [options]
|
|
|
- Send a message to Cline. If no message is provided, reads from
|
|
|
- stdin. Options:
|
|
|
+### cline auth
|
|
|
|
|
|
- -a, --approve
|
|
|
- Approve Cline's proposed action
|
|
|
+Configure authentication with an AI provider.
|
|
|
|
|
|
- -d, --deny
|
|
|
- Deny Cline's proposed action
|
|
|
+```bash
|
|
|
+# Interactive wizard
|
|
|
+cline auth
|
|
|
|
|
|
- -f, --file FILE
|
|
|
- Attach a file to the message
|
|
|
+# Quick setup with flags
|
|
|
+cline auth -p anthropic -k sk-ant-api-xxxxx -m claude-sonnet-4-5-20250929
|
|
|
+```
|
|
|
|
|
|
- -y, --no-interactive, --yolo
|
|
|
- Enable autonomous mode
|
|
|
+**Options:**
|
|
|
+
|
|
|
+| Option | Description |
|
|
|
+|--------|-------------|
|
|
|
+| `-p, --provider <id>` | Provider ID. See [Supported Providers](#supported-providers) below. |
|
|
|
+| `-k, --apikey <key>` | API key for the provider. |
|
|
|
+| `-m, --modelid <id>` | Model ID to use (e.g., `claude-sonnet-4-5-20250929`, `gpt-4o`). |
|
|
|
+| `-b, --baseurl <url>` | Base URL for OpenAI-compatible providers. |
|
|
|
+
|
|
|
+**Supported Providers:**
|
|
|
+
|
|
|
+| Provider ID | Description |
|
|
|
+|-------------|-------------|
|
|
|
+| `anthropic` | Anthropic Claude (direct API) |
|
|
|
+| `openai-native` | OpenAI GPT models |
|
|
|
+| `openai-codex` | ChatGPT subscription via OAuth |
|
|
|
+| `openrouter` | OpenRouter (access multiple providers) |
|
|
|
+| `bedrock` | AWS Bedrock |
|
|
|
+| `gemini` | Google Gemini |
|
|
|
+| `xai` | X AI (Grok) |
|
|
|
+| `cerebras` | Cerebras (fast inference) |
|
|
|
+| `deepseek` | DeepSeek |
|
|
|
+| `ollama` | Ollama (local models) |
|
|
|
+| `lmstudio` | LM Studio (local models) |
|
|
|
+| `openai` | OpenAI-compatible API (custom base URL) |
|
|
|
|
|
|
- -m, --mode mode
|
|
|
- Switch mode (act or plan)
|
|
|
+---
|
|
|
|
|
|
- cline task view [-f|--follow] [-c|--follow-complete]
|
|
|
+### cline history (alias: h)
|
|
|
|
|
|
- cline t v [-f|--follow] [-c|--follow-complete]
|
|
|
- Display the current conversation. Use --follow to stream
|
|
|
- updates in real-time, or --follow-complete to follow until task
|
|
|
- completion.
|
|
|
+Browse task history with pagination.
|
|
|
|
|
|
- cline task restore checkpoint
|
|
|
+```bash
|
|
|
+# Show recent tasks (default: 10)
|
|
|
+cline history
|
|
|
|
|
|
- cline t r checkpoint
|
|
|
- Restore the task to a previous checkpoint state.
|
|
|
+# Show more tasks
|
|
|
+cline history -n 20
|
|
|
|
|
|
- cline task pause
|
|
|
+# Paginate through history
|
|
|
+cline history -n 10 -p 2
|
|
|
+```
|
|
|
|
|
|
- cline t p
|
|
|
- Pause task execution.
|
|
|
+**Options:**
|
|
|
|
|
|
- Configuration
|
|
|
- Configuration can be set globally. Override these global settings for
|
|
|
- a task using the --setting flag
|
|
|
+| Option | Description |
|
|
|
+|--------|-------------|
|
|
|
+| `-n, --limit <number>` | Number of tasks to show (default: 10) |
|
|
|
+| `-p, --page <number>` | Page number, 1-based (default: 1) |
|
|
|
|
|
|
- cline config
|
|
|
+---
|
|
|
|
|
|
- cline c
|
|
|
+### cline config
|
|
|
|
|
|
- cline config set key value
|
|
|
+View and manage configuration settings.
|
|
|
|
|
|
- cline c s key value
|
|
|
- Set a configuration variable.
|
|
|
+```bash
|
|
|
+cline config
|
|
|
+```
|
|
|
|
|
|
- cline config get key
|
|
|
+Opens an interactive configuration view with tabs for:
|
|
|
+- **Settings** - Global and workspace-specific settings
|
|
|
+- **Rules** - `.clinerules` files and imported rules
|
|
|
+- **Workflows** - Available workflows (appear as slash commands)
|
|
|
+- **Hooks** - Configured hook scripts
|
|
|
+- **Skills** - Enabled skills
|
|
|
|
|
|
- cline c g key
|
|
|
- Read a configuration variable.
|
|
|
+---
|
|
|
|
|
|
- cline config list
|
|
|
+### cline update
|
|
|
|
|
|
- cline c l
|
|
|
- List all configuration variables and their values.
|
|
|
+Check for updates and install the latest version.
|
|
|
|
|
|
- Context Window Configuration
|
|
|
- For local model providers, you can configure the context window size:
|
|
|
+```bash
|
|
|
+cline update
|
|
|
+```
|
|
|
|
|
|
- Ollama
|
|
|
- cline config s ollama-api-options-ctx-num=32768
|
|
|
+---
|
|
|
|
|
|
- LM Studio
|
|
|
- cline config s lm-studio-max-tokens=32768
|
|
|
+### cline version
|
|
|
|
|
|
- For other providers (Anthropic, OpenRouter, etc.), the context window
|
|
|
- is defined per model in the model metadata and is not user-settable.
|
|
|
- Cline uses each model's built-in context limits automatically.
|
|
|
+Show the installed CLI version.
|
|
|
|
|
|
-TASK SETTINGS
|
|
|
- Task settings are persisted in the ~/.cline/x/tasks directory. When
|
|
|
- resuming a task with cline task open, task settings are automatically
|
|
|
- restored.
|
|
|
+```bash
|
|
|
+cline version
|
|
|
+```
|
|
|
|
|
|
- Common settings include:
|
|
|
+---
|
|
|
|
|
|
- yolo Enable autonomous mode (true/false)
|
|
|
+### cline dev
|
|
|
|
|
|
- mode Starting mode (act/plan)
|
|
|
+Developer tools for debugging.
|
|
|
|
|
|
- hooks_enabled
|
|
|
- Enable or disable hooks for the task (true/false)
|
|
|
+```bash
|
|
|
+# Open the log file
|
|
|
+cline dev log
|
|
|
+```
|
|
|
|
|
|
-HOOKS INTEGRATION
|
|
|
- Hooks let you inject custom logic into Cline's workflow at key moments.
|
|
|
- They can validate operations before they execute, monitor tool usage,
|
|
|
- and shape AI decisions. This allows you to integrate hooks into
|
|
|
- automated workflows, CI/CD pipelines, and headless task execution.
|
|
|
+## Environment Variables
|
|
|
|
|
|
- Enable hooks for a task:
|
|
|
+### CLINE_DIR
|
|
|
|
|
|
- cline "prompt" -s hooks_enabled=true
|
|
|
+Override the default configuration directory:
|
|
|
|
|
|
- Configure hooks globally:
|
|
|
+```bash
|
|
|
+export CLINE_DIR=/path/to/custom/config
|
|
|
+cline "your task"
|
|
|
+```
|
|
|
|
|
|
- cline config set hooks-enabled=true
|
|
|
- cline config get hooks-enabled
|
|
|
+When set, all Cline data (settings, secrets, task history) is stored in this directory instead of `~/.cline/data/`.
|
|
|
|
|
|
- Note: Hooks in the CLI are only supported on macOS and Linux.
|
|
|
+**Use cases:**
|
|
|
+- Running isolated Cline instances with different settings
|
|
|
+- CI/CD environments with custom state directories
|
|
|
+- Testing configuration changes without affecting your main setup
|
|
|
|
|
|
- For complete hooks documentation, see:
|
|
|
- <https://docs.cline.bot/features/hooks/index>
|
|
|
+### CLINE_COMMAND_PERMISSIONS
|
|
|
|
|
|
-NOTES & EXAMPLES
|
|
|
- The cline task send and cline task new commands support reading from
|
|
|
- stdin, enabling powerful pipeline compositions:
|
|
|
+Restrict which shell commands Cline can execute:
|
|
|
|
|
|
- cat requirements.txt | cline task send
|
|
|
- echo "Refactor this code" | cline -y
|
|
|
+```bash
|
|
|
+export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"], "deny": ["rm -rf *"]}'
|
|
|
+```
|
|
|
|
|
|
- Instance Management
|
|
|
- Manage multiple Cline instances:
|
|
|
+**Format:**
|
|
|
|
|
|
- # Start a new instance and make it default
|
|
|
- cline instance new --default
|
|
|
+```json
|
|
|
+{
|
|
|
+ "allow": ["pattern1", "pattern2"],
|
|
|
+ "deny": ["pattern3"],
|
|
|
+ "allowRedirects": true
|
|
|
+}
|
|
|
+```
|
|
|
|
|
|
- # List all running instances
|
|
|
- cline instance list
|
|
|
+| Field | Type | Description |
|
|
|
+|-------|------|-------------|
|
|
|
+| `allow` | `string[]` | Glob patterns for allowed commands. If set, **only** matching commands are permitted. |
|
|
|
+| `deny` | `string[]` | Glob patterns for denied commands. Deny rules **always take precedence** over allow rules. |
|
|
|
+| `allowRedirects` | `boolean` | Whether to allow shell redirects (`>`, `>>`, `<`). Default: `false`. |
|
|
|
|
|
|
- # Kill a specific instance
|
|
|
- cline instance kill localhost:50052
|
|
|
+**Examples:**
|
|
|
|
|
|
- # Kill all CLI instances
|
|
|
- cline instance kill --all-cli
|
|
|
+```bash
|
|
|
+# Allow only npm and git commands (deny everything else)
|
|
|
+export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"]}'
|
|
|
|
|
|
- Task History
|
|
|
- Work with task history:
|
|
|
+# Allow dev commands but explicitly deny dangerous ones
|
|
|
+export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *", "node *"], "deny": ["rm -rf *", "sudo *"]}'
|
|
|
|
|
|
- # List previous tasks
|
|
|
- cline task list
|
|
|
+# Allow file reading with redirects
|
|
|
+export CLINE_COMMAND_PERMISSIONS='{"allow": ["cat *", "echo *"], "allowRedirects": true}'
|
|
|
+```
|
|
|
|
|
|
- # Resume a previous task
|
|
|
- cline task open 1760501486669
|
|
|
+**How commands are evaluated:**
|
|
|
|
|
|
- # View conversation history
|
|
|
- cline task view
|
|
|
+1. Check for dangerous characters (backticks outside single quotes, unquoted newlines)
|
|
|
+2. Parse command into segments split by operators (`&&`, `||`, `|`, `;`)
|
|
|
+3. If redirects are detected and `allowRedirects` is not true, command is denied
|
|
|
+4. Each segment is validated against deny rules first, then allow rules
|
|
|
+5. Subshell contents (`$(...)` and `(...)`) are recursively validated
|
|
|
+6. All segments must pass for the command to be allowed
|
|
|
|
|
|
- # Start interactive chat with this task
|
|
|
- cline task chat
|
|
|
+## JSON Output Format
|
|
|
|
|
|
-ARCHITECTURE
|
|
|
- Cline operates on a three-layer architecture:
|
|
|
+When using `--json`, each message is output as a JSON object (one per line):
|
|
|
|
|
|
- Presentation Layer
|
|
|
- User interfaces (CLI, VSCode, JetBrains) that connect to Cline
|
|
|
- Core via gRPC
|
|
|
+```json
|
|
|
+{
|
|
|
+ "type": "say",
|
|
|
+ "text": "I'll create the file now.",
|
|
|
+ "ts": 1760501486669,
|
|
|
+ "say": "text"
|
|
|
+}
|
|
|
+```
|
|
|
|
|
|
- Cline Core
|
|
|
- The autonomous agent service handling task management, AI model
|
|
|
- integration, state management, tool orchestration, and real-time
|
|
|
- streaming updates
|
|
|
+**Required fields:**
|
|
|
|
|
|
- Host Provider Layer
|
|
|
- Environment-specific integrations (VSCode APIs, JetBrains APIs,
|
|
|
- shell APIs) that Cline Core uses to interact with the host
|
|
|
- system
|
|
|
+| Field | Type | Description |
|
|
|
+|-------|------|-------------|
|
|
|
+| `type` | `"ask"` \| `"say"` | Message category |
|
|
|
+| `text` | `string` | Human-readable message content |
|
|
|
+| `ts` | `number` | Unix timestamp in milliseconds |
|
|
|
|
|
|
-BUGS
|
|
|
- Report bugs at: <https://github.com/cline/cline/issues>
|
|
|
+**Optional fields:**
|
|
|
|
|
|
- For real-time help, join the Discord community at:
|
|
|
- <https://discord.gg/cline>
|
|
|
+| Field | Type | Description |
|
|
|
+|-------|------|-------------|
|
|
|
+| `say` | `string` | Subtype when `type` is `"say"` (e.g., `"text"`, `"tool"`) |
|
|
|
+| `ask` | `string` | Subtype when `type` is `"ask"` (e.g., `"tool"`, `"followup"`) |
|
|
|
+| `reasoning` | `string` | Model reasoning (omitted when empty) |
|
|
|
+| `partial` | `boolean` | `true` while streaming (omitted when complete) |
|
|
|
+| `images` | `string[]` | Image URIs (omitted when empty) |
|
|
|
+| `files` | `string[]` | File paths (omitted when empty) |
|
|
|
|
|
|
-SEE ALSO
|
|
|
- Full documentation: <https://docs.cline.bot>
|
|
|
+## Configuration Files
|
|
|
|
|
|
-AUTHORS
|
|
|
- Cline is developed by the Cline Bot Inc. and the open source community.
|
|
|
+Cline stores all data in `~/.cline/` by default:
|
|
|
|
|
|
-COPYRIGHT
|
|
|
- Copyright © 2025 Cline Bot Inc. Licensed under the Apache License 2.0.
|
|
|
+```
|
|
|
+~/.cline/
|
|
|
+├── data/ # Configuration directory
|
|
|
+│ ├── globalState.json # Global settings
|
|
|
+│ ├── secrets.json # API keys (stored securely)
|
|
|
+│ ├── workspace/ # Workspace-specific state
|
|
|
+│ └── tasks/ # Task history and conversations
|
|
|
+└── log/ # Debug logs (view with cline dev log)
|
|
|
```
|
|
|
|
|
|
-## JSON output (-F json)
|
|
|
-
|
|
|
-When you run a command with `-F json` (or `--output-format json`), Cline prints each client message as JSON.
|
|
|
-
|
|
|
-### ClineMessage schema
|
|
|
-
|
|
|
-| Field | Type | Required | Notes |
|
|
|
-|-------|------|----------|-------|
|
|
|
-| `type` | `"ask" or "say"` | Yes | Top-level message category. |
|
|
|
-| `text` | `string` | Yes | Human-readable message content. |
|
|
|
-| `ts` | `number` | Yes | Unix epoch timestamp in milliseconds. |
|
|
|
-| `reasoning` | `string` | No | Omitted when empty. |
|
|
|
-| `say` | `string` | No | Omitted when empty. Present when `type` is `"say"`. |
|
|
|
-| `ask` | `string` | No | Omitted when empty. Present when `type` is `"ask"`. |
|
|
|
-| `partial` | `boolean` | No | Omitted when false. `true` for streaming updates. |
|
|
|
-| `images` | `string[]` | No | Omitted when empty. Image URIs when included with a message. |
|
|
|
-| `files` | `string[]` | No | Omitted when empty. File paths when attached to a message. |
|
|
|
-| `lastCheckpointHash` | `string` | No | Omitted when empty. Git checkpoint hash when available. |
|
|
|
-| `isCheckpointCheckedOut` | `boolean` | No | Omitted when false. `true` if Cline checked out a checkpoint. |
|
|
|
-| `isOperationOutsideWorkspace` | `boolean` | No | Omitted when false. `true` if an operation happened outside the workspace. |
|
|
|
+## Examples
|
|
|
|
|
|
-<Note>
|
|
|
-Most fields are optional and omitted when empty. If you parse this output, treat missing fields as “not present”, not as empty strings.
|
|
|
-</Note>
|
|
|
+### Interactive Development
|
|
|
|
|
|
-### Example
|
|
|
+```bash
|
|
|
+# Start interactive mode
|
|
|
+cline
|
|
|
|
|
|
-```json
|
|
|
-{
|
|
|
- "type": "say",
|
|
|
- "text": "Cline is about to run a command.",
|
|
|
- "ts": 1760501486669,
|
|
|
- "say": "command",
|
|
|
- "partial": false
|
|
|
-}
|
|
|
+# Start with a task and use interactive UI
|
|
|
+cline "Help me refactor this codebase"
|
|
|
```
|
|
|
|
|
|
-### Shell Completion
|
|
|
-
|
|
|
-Generate autocompletion scripts for various shells:
|
|
|
-
|
|
|
-#### Bash
|
|
|
+### Direct Task Execution
|
|
|
|
|
|
```bash
|
|
|
-# Generate bash completion
|
|
|
-cline completion bash > /etc/bash_completion.d/cline
|
|
|
+# Run a task directly
|
|
|
+cline "Add error handling to utils.js"
|
|
|
+
|
|
|
+# Start in Plan mode to review strategy first
|
|
|
+cline -p "Design a caching layer for the API"
|
|
|
|
|
|
-# Or for user-level installation
|
|
|
-cline completion bash > ~/.local/share/bash-completion/completions/cline
|
|
|
+# Use a specific model
|
|
|
+cline -m gpt-4o "Explain this code"
|
|
|
```
|
|
|
|
|
|
-#### Zsh
|
|
|
+### Piped Input
|
|
|
|
|
|
```bash
|
|
|
-# Generate zsh completion
|
|
|
-cline completion zsh > "${fpath[1]}/_cline"
|
|
|
+# Pipe file contents
|
|
|
+cat README.md | cline "Summarize this document"
|
|
|
+
|
|
|
+# Review git changes
|
|
|
+git diff | cline "Review these changes"
|
|
|
|
|
|
-# Or add to your .zshrc
|
|
|
-echo 'source <(cline completion zsh)' >> ~/.zshrc
|
|
|
+# Analyze test output
|
|
|
+npm test 2>&1 | cline "Fix any failing tests"
|
|
|
```
|
|
|
|
|
|
-#### Fish
|
|
|
+### Automation and CI/CD
|
|
|
|
|
|
```bash
|
|
|
-# Generate fish completion
|
|
|
-cline completion fish > ~/.config/fish/completions/cline.fish
|
|
|
-```
|
|
|
+# YOLO mode for automated workflows
|
|
|
+cline -y "Run tests and fix failures"
|
|
|
|
|
|
-#### PowerShell
|
|
|
+# JSON output for scripting
|
|
|
+cline --json "List all TODO comments" | jq '.text'
|
|
|
|
|
|
-```powershell
|
|
|
-# Generate PowerShell completion
|
|
|
-cline completion powershell > cline.ps1
|
|
|
+# With timeout
|
|
|
+cline -y --timeout 600 "Run the full test suite"
|
|
|
|
|
|
-# Add to your PowerShell profile
|
|
|
-Add-Content $PROFILE "cline completion powershell | Out-String | Invoke-Expression"
|
|
|
+# Chain commands
|
|
|
+git diff | cline -y "explain" | cline -y "write a commit message"
|
|
|
```
|
|
|
|
|
|
-### Version Command
|
|
|
+### Authentication
|
|
|
|
|
|
```bash
|
|
|
-# Show version information
|
|
|
-cline version
|
|
|
-```
|
|
|
+# Interactive wizard
|
|
|
+cline auth
|
|
|
|
|
|
-### Environment Variables
|
|
|
+# Quick setup: Anthropic
|
|
|
+cline auth -p anthropic -k sk-ant-api-xxxxx -m claude-sonnet-4-5-20250929
|
|
|
|
|
|
-#### CLINE_DIR
|
|
|
+# Quick setup: OpenAI
|
|
|
+cline auth -p openai-native -k sk-xxxxx -m gpt-4o
|
|
|
|
|
|
-Override the default Cline directory location:
|
|
|
-
|
|
|
-```bash
|
|
|
-# Override default Cline directory
|
|
|
-export CLINE_DIR=/custom/path
|
|
|
+# Quick setup: OpenRouter
|
|
|
+cline auth -p openrouter -k sk-or-xxxxx
|
|
|
|
|
|
-# Default: ~/.cline
|
|
|
+# OpenAI-compatible with custom URL
|
|
|
+cline auth -p openai -k your-key -b https://api.example.com/v1
|
|
|
```
|
|
|
|
|
|
-This directory is used for:
|
|
|
-- Instance registry database
|
|
|
-- Configuration files
|
|
|
-- Task history
|
|
|
-- Checkpoints
|
|
|
+## Support
|
|
|
+
|
|
|
+- **Report bugs:** https://github.com/cline/cline/issues
|
|
|
+- **Discord community:** https://discord.gg/cline
|
|
|
+- **Documentation:** https://docs.cline.bot
|
|
|
+
|
|
|
+## See Also
|
|
|
+
|
|
|
+<Columns cols={2}>
|
|
|
+ <Card title="Installation & Setup" icon="download" href="/cline-cli/installation">
|
|
|
+ Install Cline CLI and configure authentication.
|
|
|
+ </Card>
|
|
|
+
|
|
|
+ <Card title="Interactive Mode" icon="terminal" href="/cline-cli/interactive-mode">
|
|
|
+ Keyboard shortcuts, slash commands, and file mentions.
|
|
|
+ </Card>
|
|
|
+
|
|
|
+ <Card title="CLI Workflows" icon="route" href="/cline-cli/three-core-flows">
|
|
|
+ Interactive mode, direct execution, and automation patterns.
|
|
|
+ </Card>
|
|
|
+
|
|
|
+ <Card title="Configuration" icon="gear" href="/cline-cli/configuration">
|
|
|
+ Environment variables and advanced settings.
|
|
|
+ </Card>
|
|
|
+</Columns>
|