mirror of
https://github.com/cline/cline.git
synced 2026-09-19 02:05:44 +08:00
* docs: restructure CLI reference to web-friendly format Replace embedded man page format with structured markdown sections for better readability. Simplify description, reorganize commands and options into clear categories, and update Next Steps navigation cards. * Add ACP editor integrations documentation (#9036) * Add ACP editor integrations documentation with JetBrains and Neovim video demos * Add Model Orchestration documentation with --config and --thinking flags - Document --config and --thinking flags in CLI reference - Create new model-orchestration.mdx sample page - Add patterns for CI/CD review, task phase optimization, and multi-model consensus - Link to production GitHub Actions workflow - Update samples overview with new card - Update docs navigation * Add Worktree Workflows documentation with --cwd flag - Document --cwd flag in CLI reference - Create comprehensive worktree-workflows.mdx sample page - Add patterns for parallel execution and cross-worktree piping - Include real-world examples and best practices - Add CLI section to features/worktrees.mdx for discoverability - Update samples overview and navigation - Cross-link between CLI and VS Code worktree docs * Remove broken image references from worktrees documentation - Remove worktrees-overview.png Frame (image not available) - Remove worktrees-merge.png Frame (image not available) - Documentation remains fully functional with comprehensive text explanations * Remove accidentally committed local test file - Delete src/test/verify-platformio-mcp.ts which was causing CI failures - File contained TypeScript errors and hardcoded local paths - Was meant for local testing only, should not have been committed * Add native JetBrains plugin recommendation to ACP docs - Add prominent Note recommending native JetBrains plugin - Link directly to JetBrains installation section - Position ACP setup as an alternative approach - Keep all existing ACP content and video * docs: refine CLI reference formatting and ACP title Improve CLI reference readability with clearer headings and descriptions, and clarify the ACP editor integration page title for better discovery.docs: refine CLI reference formatting and ACP title Improve CLI reference readability with clearer headings and descriptions, and clarify the ACP editor integration page title for better discovery. * Fix CLI 2.0 syntax in model-orchestration.mdx - Updated issue analysis pipeline to use shell variables for passing context - Added explanatory note about why direct piping doesn't work - Corrected example to complete each phase before starting the next - All examples now use proper CLI 2.0 syntax * Completely rewrite cli-reference.mdx with accurate CLI 2.0 information - Removed all outdated CLI 1.0 content (instance management, Cline Core architecture, gRPC references) - Added accurate CLI 2.0 commands: task, history, config, auth, update, version, dev - Corrected all command flags and options based on actual man page - Added proper examples for all commands - Included environment variables documentation (CLINE_DIR, CLINE_COMMAND_PERMISSIONS) - Added shell completion instructions - Removed incorrect three-layer architecture description - All content now matches cli/man/cline.1.md source of truth Fixes outdated documentation issue mentioned in PR#9036 * Fix MDX syntax error in cli-reference.mdx - Replace angle bracket URLs with proper markdown links - MDX parser was interpreting <https://...> as invalid HTML tags - Now uses [url](url) format which is proper MDX syntax Fixes deployment validation error --------- Co-authored-by: Renee Huang <renee@cline.bot> * docs: enhance interactive mode documentation with structured settings overview * docs: restructure and improve CLI reference documentation - Reorganize command structure with clearer global options section - Add mode behavior table explaining interactive vs plain text modes - Improve option descriptions with consistent formatting - Add horizontal rules between sections for better readability - Document timeout option and environment variables more clearly - Add Tips & Tricks section for common usage patterns - Update frontmatter description to reflect content changes * docs: improve ACP editor integrations page with editor descriptions - Update page title to be more concise ("ACP: Editor Integrations") - Remove redundant H1 header that duplicated the title - Add introductory descriptions for JetBrains, Neovim, and Zed sections - Rename "Zed Editor" section to just "Zed" for consistency * docs: expand CLI reference with modes of operation and agent behavior * Update docs/cline-cli/cli-reference-deprecated.mdx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Tony Loehr <turingxo@gmail.com> Co-authored-by: Renee Huang <renee@cline.bot> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
483 lines
14 KiB
Plaintext
483 lines
14 KiB
Plaintext
---
|
|
title: "CLI Reference (Deprecated)"
|
|
description: "Command reference for Cline CLI versions earlier than 2.0.0 (deprecated). For the latest commands and options, see the current Cline CLI reference."
|
|
---
|
|
|
|
Complete command reference for Cline CLI. Use this for detailed documentation on all commands, options, and configuration.
|
|
|
|
For quick help in your terminal:
|
|
|
|
```bash
|
|
cline --help # Show all commands
|
|
cline task --help # Show task-specific commands
|
|
man cline # View the full manual page
|
|
```
|
|
|
|
## Manual Page
|
|
|
|
The complete manual page for the Cline CLI:
|
|
|
|
```
|
|
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:
|
|
|
|
-F, --output-format format
|
|
Output format. Options: rich (default), json, plain
|
|
|
|
-h, --help
|
|
Display help information for the command.
|
|
|
|
-v, --verbose
|
|
Enable verbose output for debugging.
|
|
|
|
COMMANDS
|
|
Authentication
|
|
cline auth [provider] [key]
|
|
|
|
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.
|
|
|
|
Instance Management
|
|
Cline Core instances are independent agent processes that can run in
|
|
the background. Multiple instances can run simultaneously, enabling
|
|
parallel task execution.
|
|
|
|
cline instance
|
|
|
|
cline i
|
|
Display instance management help.
|
|
|
|
cline instance new [-d|--default]
|
|
|
|
cline i n [-d|--default]
|
|
Spawn a new Cline Core instance. Use --default to set it as
|
|
the default instance for subsequent commands.
|
|
|
|
cline instance list
|
|
|
|
cline i l
|
|
List all running Cline Core instances with their addresses and
|
|
status.
|
|
|
|
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
|
|
|
|
-m, --mode mode
|
|
Starting mode (act or plan)
|
|
|
|
cline task open task-id [options]
|
|
|
|
cline t o task-id [options]
|
|
Resume a previous task from history. Accepts the same options
|
|
as task new.
|
|
|
|
cline task list
|
|
|
|
cline t l
|
|
List all tasks in history with their id and snippet
|
|
|
|
cline task chat
|
|
|
|
cline t c
|
|
Enter interactive chat mode for the current task. Allows
|
|
back-and-forth conversation with Cline.
|
|
|
|
cline task send [message] [options]
|
|
|
|
cline t s [message] [options]
|
|
Send a message to Cline. If no message is provided, reads from
|
|
stdin. Options:
|
|
|
|
-a, --approve
|
|
Approve Cline's proposed action
|
|
|
|
-d, --deny
|
|
Deny Cline's proposed action
|
|
|
|
-f, --file FILE
|
|
Attach a file to the message
|
|
|
|
-y, --no-interactive, --yolo
|
|
Enable autonomous mode
|
|
|
|
-m, --mode mode
|
|
Switch mode (act or plan)
|
|
|
|
cline task view [-f|--follow] [-c|--follow-complete]
|
|
|
|
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.
|
|
|
|
cline task restore checkpoint
|
|
|
|
cline t r checkpoint
|
|
Restore the task to a previous checkpoint state.
|
|
|
|
cline task pause
|
|
|
|
cline t p
|
|
Pause task execution.
|
|
|
|
Configuration
|
|
Configuration can be set globally. Override these global settings for
|
|
a task using the --setting flag
|
|
|
|
cline config
|
|
|
|
cline c
|
|
|
|
cline config set key value
|
|
|
|
cline c s key value
|
|
Set a configuration variable.
|
|
|
|
cline config get key
|
|
|
|
cline c g key
|
|
Read a configuration variable.
|
|
|
|
cline config list
|
|
|
|
cline c l
|
|
List all configuration variables and their values.
|
|
|
|
Context Window Configuration
|
|
For local model providers, you can configure the context window size:
|
|
|
|
Ollama
|
|
cline config s ollama-api-options-ctx-num=32768
|
|
|
|
LM Studio
|
|
cline config s lm-studio-max-tokens=32768
|
|
|
|
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.
|
|
|
|
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.
|
|
|
|
Common settings include:
|
|
|
|
yolo Enable autonomous mode (true/false)
|
|
|
|
mode Starting mode (act/plan)
|
|
|
|
hooks_enabled
|
|
Enable or disable hooks for the task (true/false)
|
|
|
|
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.
|
|
|
|
Enable hooks for a task:
|
|
|
|
cline "prompt" -s hooks_enabled=true
|
|
|
|
Configure hooks globally:
|
|
|
|
cline config set hooks-enabled=true
|
|
cline config get hooks-enabled
|
|
|
|
Note: Hooks in the CLI are only supported on macOS and Linux.
|
|
|
|
For complete hooks documentation, see:
|
|
<https://docs.cline.bot/features/hooks/index>
|
|
|
|
NOTES & EXAMPLES
|
|
The cline task send and cline task new commands support reading from
|
|
stdin, enabling powerful pipeline compositions:
|
|
|
|
cat requirements.txt | cline task send
|
|
echo "Refactor this code" | cline -y
|
|
|
|
Instance Management
|
|
Manage multiple Cline instances:
|
|
|
|
# Start a new instance and make it default
|
|
cline instance new --default
|
|
|
|
# List all running instances
|
|
cline instance list
|
|
|
|
# Kill a specific instance
|
|
cline instance kill localhost:50052
|
|
|
|
# Kill all CLI instances
|
|
cline instance kill --all-cli
|
|
|
|
Task History
|
|
Work with task history:
|
|
|
|
# List previous tasks
|
|
cline task list
|
|
|
|
# Resume a previous task
|
|
cline task open 1760501486669
|
|
|
|
# View conversation history
|
|
cline task view
|
|
|
|
# Start interactive chat with this task
|
|
cline task chat
|
|
|
|
ARCHITECTURE
|
|
Cline operates on a three-layer architecture:
|
|
|
|
Presentation Layer
|
|
User interfaces (CLI, VSCode, JetBrains) that connect to Cline
|
|
Core via gRPC
|
|
|
|
Cline Core
|
|
The autonomous agent service handling task management, AI model
|
|
integration, state management, tool orchestration, and real-time
|
|
streaming updates
|
|
|
|
Host Provider Layer
|
|
Environment-specific integrations (VSCode APIs, JetBrains APIs,
|
|
shell APIs) that Cline Core uses to interact with the host
|
|
system
|
|
|
|
BUGS
|
|
Report bugs at: <https://github.com/cline/cline/issues>
|
|
|
|
For real-time help, join the Discord community at:
|
|
<https://discord.gg/cline>
|
|
|
|
SEE ALSO
|
|
Full documentation: <https://docs.cline.bot>
|
|
|
|
AUTHORS
|
|
Cline is developed by the Cline Bot Inc. and the open source community.
|
|
|
|
COPYRIGHT
|
|
Copyright © 2025 Cline Bot Inc. Licensed under the Apache License 2.0.
|
|
```
|
|
|
|
## 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. |
|
|
|
|
<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>
|
|
|
|
### Example
|
|
|
|
```json
|
|
{
|
|
"type": "say",
|
|
"text": "Cline is about to run a command.",
|
|
"ts": 1760501486669,
|
|
"say": "command",
|
|
"partial": false
|
|
}
|
|
```
|
|
|
|
### Shell Completion
|
|
|
|
Generate autocompletion scripts for various shells:
|
|
|
|
#### Bash
|
|
|
|
```bash
|
|
# Generate bash completion
|
|
cline completion bash > /etc/bash_completion.d/cline
|
|
|
|
# Or for user-level installation
|
|
cline completion bash > ~/.local/share/bash-completion/completions/cline
|
|
```
|
|
|
|
#### Zsh
|
|
|
|
```bash
|
|
# Generate zsh completion
|
|
cline completion zsh > "${fpath[1]}/_cline"
|
|
|
|
# Or add to your .zshrc
|
|
echo 'source <(cline completion zsh)' >> ~/.zshrc
|
|
```
|
|
|
|
#### Fish
|
|
|
|
```bash
|
|
# Generate fish completion
|
|
cline completion fish > ~/.config/fish/completions/cline.fish
|
|
```
|
|
|
|
#### PowerShell
|
|
|
|
```powershell
|
|
# Generate PowerShell completion
|
|
cline completion powershell > cline.ps1
|
|
|
|
# Add to your PowerShell profile
|
|
Add-Content $PROFILE "cline completion powershell | Out-String | Invoke-Expression"
|
|
```
|
|
|
|
### Version Command
|
|
|
|
```bash
|
|
# Show version information
|
|
cline version
|
|
```
|
|
|
|
### Environment Variables
|
|
|
|
#### CLINE_DIR
|
|
|
|
Override the default Cline directory location:
|
|
|
|
```bash
|
|
# Override default Cline directory
|
|
export CLINE_DIR=/custom/path
|
|
|
|
# Default: ~/.cline
|
|
```
|
|
|
|
This directory is used for:
|
|
- Instance registry database
|
|
- Configuration files
|
|
- Task history
|
|
- Checkpoints
|