docs/cline-cli/cli-reference.mdx
This page documents all available commands, flags, and configuration options for Cline CLI. For quick help in your terminal, use:
cline --help # Show all commands
cline task --help # Show task command options
cline auth --help # Show auth command options
man cline # View the full manual page (if installed)
cline [prompt] [options]
cline <command> [options] [arguments]
These options work with any command:
| Option | Description |
|---|---|
--config <path> | Use a custom configuration directory instead of ~/.cline/data/ |
-c, --cwd <path> | Set the working directory for the task |
-v, --verbose | Show detailed output including model reasoning |
--help | Show help for the command |
Cline CLI automatically detects the best output mode based on how you invoke it:
| Mode | When Activated | Description |
|---|---|---|
| Interactive | cline with no args, TTY connected | Rich terminal UI with real-time streaming, keyboard shortcuts, and visual feedback. |
| Task | cline "prompt" with TTY connected | Interactive UI starts immediately with your task. |
| Plain Text | stdin piped, stdout redirected, or --yolo/--json flags | Clean text output without UI, suitable for scripting and CI/CD. |
Cline operates in two primary modes that control how it approaches tasks:
| Mode | Description |
|---|---|
| Act Mode (default) | Cline actively uses tools to accomplish tasks. It can read files, write code, execute commands, use a headless browser, and more. |
| Plan Mode | Cline gathers information and creates a detailed plan before implementation. It explores the codebase, asks clarifying questions, and presents a strategy for your approval before switching to Act Mode. |
Use -a, --act or -p, --plan flags to explicitly set the mode.
Run Cline without a subcommand to start a task or enter interactive mode.
# Interactive mode (no arguments)
cline
# Start a task directly
cline "your prompt here"
# Resume the latest task for the current directory
cline --continue
Options:
| Option | Description |
|---|---|
-a, --act | Start in Act mode (default). Cline executes actions directly. |
-p, --plan | Start in Plan mode. Cline analyzes and creates a strategy before acting. |
-y, --yolo | YOLO mode: auto-approve all actions, use plain text output, exit when complete. Ideal for CI/CD. |
-m, --model <id> | Use a specific model (e.g., claude-sonnet-4-5-20250929, gpt-4o). |
-i, --images <paths...> | Include image files with the prompt. |
--thinking | Enable extended thinking with a 1024 token budget. |
--json | Output messages as JSON (one object per line). Forces plain text mode. |
--timeout <seconds> | Maximum execution time before the task is stopped. |
--continue | Resume the most recent task from the current working directory. |
Mode Behavior:
| Invocation | Output Mode | Why |
|---|---|---|
cline | Interactive UI | No arguments, TTY connected |
cline "prompt" | Interactive UI | TTY connected |
cline -y "prompt" | Plain text | YOLO flag forces plain text |
cline --json "prompt" | JSON | JSON flag forces plain text |
cat file | cline "prompt" | Plain text | stdin is piped |
cline "prompt" > out.txt | Plain text | stdout is redirected |
Run a task with a prompt. This is equivalent to cline "prompt".
cline task "Create a REST API endpoint"
cline t "Fix the bug in utils.js"
Options: Same as the default command above.
Configure authentication with an AI provider.
# Interactive wizard
cline auth
# Quick setup with flags
cline auth -p anthropic -k sk-ant-api-xxxxx -m claude-sonnet-4-5-20250929
Options:
| Option | Description |
|---|---|
-p, --provider <id> | Provider ID. See Supported Providers 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) |
Browse task history with pagination.
# Show recent tasks (default: 10)
cline history
# Show more tasks
cline history -n 20
# Paginate through history
cline history -n 10 -p 2
Options:
| Option | Description |
|---|---|
-n, --limit <number> | Number of tasks to show (default: 10) |
-p, --page <number> | Page number, 1-based (default: 1) |
View and manage configuration settings.
cline config
Opens an interactive configuration view with tabs for:
.clinerules files and imported rulesCheck for updates and install the latest version.
cline update
Show the installed CLI version.
cline version
Developer tools for debugging.
# Open the log file
cline dev log
Override the default configuration directory:
export CLINE_DIR=/path/to/custom/config
cline "your task"
When set, all Cline data (settings, secrets, task history) is stored in this directory instead of ~/.cline/data/.
Use cases:
Restrict which shell commands Cline can execute:
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"], "deny": ["rm -rf *"]}'
Format:
{
"allow": ["pattern1", "pattern2"],
"deny": ["pattern3"],
"allowRedirects": true
}
| Field | Type | Description |
|---|---|---|
allow | string[] | Glob patterns for allowed commands. If set, only matching commands are permitted. |
deny | string[] | Glob patterns for denied commands. Deny rules always take precedence over allow rules. |
allowRedirects | boolean | Whether to allow shell redirects (>, >>, <). Default: false. |
Examples:
# Allow only npm and git commands (deny everything else)
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"]}'
# Allow dev commands but explicitly deny dangerous ones
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *", "node *"], "deny": ["rm -rf *", "sudo *"]}'
# Allow file reading with redirects
export CLINE_COMMAND_PERMISSIONS='{"allow": ["cat *", "echo *"], "allowRedirects": true}'
How commands are evaluated:
&&, ||, |, ;)allowRedirects is not true, command is denied$(...) and (...)) are recursively validatedWhen using --json, each message is output as a JSON object (one per line):
{
"type": "say",
"text": "I'll create the file now.",
"ts": 1760501486669,
"say": "text"
}
Required fields:
| Field | Type | Description |
|---|---|---|
type | "ask" | "say" | Message category |
text | string | Human-readable message content |
ts | number | Unix timestamp in milliseconds |
Optional fields:
| Field | Type | Description |
|---|---|---|
say | string | Subtype when type is "say" (e.g., "text", "tool") |
ask | string | Subtype when type is "ask" (e.g., "tool", "followup") |
reasoning | string | Model reasoning (omitted when empty) |
partial | boolean | true while streaming (omitted when complete) |
images | string[] | Image URIs (omitted when empty) |
files | string[] | File paths (omitted when empty) |
Cline stores all data in ~/.cline/ by default:
~/.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)
# Start interactive mode
cline
# Start with a task and use interactive UI
cline "Help me refactor this codebase"
# Run a task directly
cline "Add error handling to utils.js"
# Start in Plan mode to review strategy first
cline -p "Design a caching layer for the API"
# Use a specific model
cline -m gpt-4o "Explain this code"
# Pipe file contents
cat README.md | cline "Summarize this document"
# Review git changes
git diff | cline "Review these changes"
# Analyze test output
npm test 2>&1 | cline "Fix any failing tests"
# YOLO mode for automated workflows
cline -y "Run tests and fix failures"
# JSON output for scripting
cline --json "List all TODO comments" | jq '.text'
# With timeout
cline -y --timeout 600 "Run the full test suite"
# Chain commands
git diff | cline -y "explain" | cline -y "write a commit message"
# Interactive wizard
cline auth
# Quick setup: Anthropic
cline auth -p anthropic -k sk-ant-api-xxxxx -m claude-sonnet-4-5-20250929
# Quick setup: OpenAI
cline auth -p openai-native -k sk-xxxxx -m gpt-4o
# Quick setup: OpenRouter
cline auth -p openrouter -k sk-or-xxxxx
# OpenAI-compatible with custom URL
cline auth -p openai -k your-key -b https://api.example.com/v1