Skip to main content
For quick help in your terminal:
cline --help          # Show all commands and global options
cline task --help     # Show options for the task command
cline auth --help     # Show options for the auth command

Synopsis

cline [prompt] [options]
cline <command> [options] [arguments]

Global options

These options are accepted by any command:
OptionDescription
--config <path>Use a custom configuration directory instead of ~/.cline/data/
-c, --cwd <path>Set the working directory for the task or command
-v, --verboseShow detailed output including model reasoning
--helpShow help for the command

Default command

Running cline without a subcommand starts a task or opens interactive mode.
# Open interactive mode (no prompt)
cline

# Start a task with a prompt
cline "your prompt here"

# Resume the most recent task for the current directory
cline --continue
Options:
OptionDescription
-a, --actStart in Act mode. Cline executes actions immediately. (default)
-p, --planStart in Plan mode. Cline analyzes and plans before acting.
-y, --yoloYOLO mode: auto-approve all actions, plain text output, exit on completion.
--auto-approve-allAuto-approve all actions while keeping the interactive TUI.
-m, --model <id>Override the model for this task (e.g., claude-sonnet-4-5-20250929, gpt-4o).
-i, --images <paths...>Attach image files to the prompt.
--thinking [tokens]Enable extended thinking. Default budget: 1024 tokens. Pass a number to customize.
--reasoning-effort <level>Set reasoning effort: none, low, medium, high, or xhigh.
--max-consecutive-mistakes <n>Maximum consecutive mistakes before halting (YOLO mode).
--jsonOutput messages as JSON (one object per line). Forces headless mode.
--timeout <seconds>Maximum execution time before the task is stopped.
--continueResume the most recent task from the current working directory.
--double-check-completionReject the first completion attempt to force re-verification.
--auto-condenseUse AI-powered context compaction instead of mechanical truncation.
--hooks-dir <path>Path to an additional hooks directory injected at runtime.
--acpRun in ACP (Agent Client Protocol) mode for editor integration.
-T, --taskId <id>Resume an existing task by ID.
Mode selection behavior:
InvocationOutput modeReason
clineInteractive TUINo arguments, TTY connected
cline "prompt"Interactive TUITTY connected
cline -y "prompt"Plain text--yolo flag
cline --json "prompt"JSON--json flag
cat file | cline "prompt"Plain textstdin piped
cline "prompt" > out.txtPlain textstdout redirected

cline task (alias: t)

Run a new task with a prompt. Equivalent to cline "prompt".
cline task "Create a REST API endpoint"
cline t "Fix the bug in utils.js"
Accepts the same options as the default command above, plus:
OptionDescription
-T, --taskId <id>Resume an existing task by ID, optionally sending an additional prompt.

cline auth

Configure authentication with an AI provider.
# Interactive wizard
cline auth

# Non-interactive: Anthropic
cline auth -p anthropic -k sk-ant-api-xxxxx -m claude-sonnet-4-5-20250929

# Non-interactive: OpenAI
cline auth -p openai-native -k sk-xxxxx -m gpt-4o

# Non-interactive: OpenRouter
cline auth -p openrouter -k sk-or-xxxxx -m anthropic/claude-sonnet-4-5-20250929

# Non-interactive: OpenAI-compatible with custom base URL
cline auth -p openai -k your-key -b https://api.example.com/v1
Options:
OptionDescription
-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 IDDescription
anthropicAnthropic Claude (direct API)
openai-nativeOpenAI GPT models
openai-codexChatGPT subscription via OAuth
openrouterOpenRouter (multiple providers via one key)
bedrockAWS Bedrock
geminiGoogle Gemini
xaiX AI (Grok)
cerebrasCerebras (fast inference)
deepseekDeepSeek
moonshotMoonshot AI (Kimi models)
ollamaOllama (local models)
lmstudioLM Studio (local models)
openaiAny OpenAI-compatible API

cline history (alias: h)

Browse task history with pagination.
# Show 10 most recent tasks (default)
cline history

# Show 20 tasks
cline history -n 20

# Show page 2
cline history -n 10 -p 2
Options:
OptionDescription
-n, --limit <number>Number of tasks to show. Default: 10.
-p, --page <number>Page number (1-based). Default: 1.

cline config

Open the interactive configuration view.
cline config
Navigate tabs with arrow keys:
TabContents
SettingsGlobal and workspace-specific settings
Rules.clinerules files and imported rules (Cursor, Windsurf format)
WorkflowsAvailable workflows (shown as slash commands in interactive mode)
HooksConfigured hook scripts
SkillsEnabled skills

cline mcp add

Add an MCP server to ~/.cline/data/settings/cline_mcp_settings.json.
# STDIO server
cline mcp add my-server -- node /path/to/server.js

# Remote HTTP server
cline mcp add linear https://mcp.linear.app/mcp --type http

# SSE server
cline mcp add my-sse-server https://example.com/sse --type sse
Arguments:
ArgumentDescription
<name>Name for the MCP server entry
[targetOrCommand...]For stdio: use -- <command> [args]. For http/sse: provide the URL.
Options:
OptionDescription
--type <type>Transport type: stdio (default), http, or sse.

cline update

Check for updates and install the latest version.
cline update

cline version

Print the installed CLI version.
cline version
# Cline CLI version: 2.11.0

cline dev log

Open the debug log file in your default editor.
cline dev log
Useful for diagnosing unexpected behavior or reporting bugs.

Environment variables

CLINE_DIR

Override the default configuration directory:
export CLINE_DIR=/path/to/custom/config
cline "your task"
When set, all Cline data — settings, secrets, and task history — is stored in this directory instead of ~/.cline/data/. Use cases:
  • Running isolated Cline instances (e.g., parallel CI jobs)
  • Keeping separate configurations for different projects
  • Testing configuration changes without touching your main setup

CLINE_COMMAND_PERMISSIONS

Restrict which shell commands Cline is allowed to execute:
export CLINE_COMMAND_PERMISSIONS='{"allow": ["npm *", "git *"], "deny": ["rm -rf *"]}'
Format:
{
  "allow": ["pattern1", "pattern2"],
  "deny": ["pattern3"],
  "allowRedirects": false
}
FieldTypeDescription
allowstring[]Glob patterns for permitted commands. If set, only matching commands are allowed.
denystring[]Glob patterns for denied commands. Deny rules always take precedence over allow rules.
allowRedirectsbooleanWhether shell redirects (>, >>, <) are permitted. Default: false.
Command evaluation order:
  1. Check for dangerous characters (backticks outside single quotes, unquoted newlines)
  2. Parse command segments split by operators (&&, ||, |, ;)
  3. If redirects are detected and allowRedirects is not true, deny the command
  4. Validate each segment: deny rules are checked first, then allow rules
  5. Recursively validate subshell contents ($(...) and (...))
  6. All segments must pass for the command to be allowed
When allow is set, any command not matching the allow patterns is denied. Use this in security-sensitive environments like shared CI runners.

JSON output format

When using --json, each message is written as a JSON object on its own line:
{"type":"say","text":"I'll create the file now.","ts":1760501486669,"say":"text"}
Required fields:
FieldTypeDescription
type"ask" or "say"Message category
textstringHuman-readable message content
tsnumberUnix timestamp in milliseconds
Optional fields:
FieldTypeDescription
saystringSubtype when type is "say" (e.g., "text", "tool")
askstringSubtype when type is "ask" (e.g., "tool", "followup")
reasoningstringModel reasoning output (omitted when empty)
partialbooleantrue while the message is still streaming; omitted when complete
imagesstring[]Image data URIs (omitted when empty)
filesstring[]File paths referenced (omitted when empty)

Configuration files

Cline stores all data under ~/.cline/ by default:
~/.cline/
├── data/
│   ├── globalState.json          # Global settings
│   ├── secrets.json              # API keys (encrypted at rest)
│   ├── settings/
│   │   └── cline_mcp_settings.json  # MCP server configuration
│   ├── workspace/                # Per-workspace state
│   └── tasks/                    # Task history and conversation logs
└── log/                          # Debug logs (open with cline dev log)
The CLINE_DIR environment variable or --config flag changes the root from ~/.cline/data/ to your specified path.

Examples

Interactive development

# Open interactive mode
cline

# Start with an initial task
cline "Help me refactor this module to use async/await"

# Start in Plan mode to review strategy first
cline -p "Design a caching layer for the API"

Headless and automation

# Auto-approve everything (YOLO)
cline -y "Run the test suite and fix any failures"

# JSON output piped to jq
cline --json "List all TODO comments" | jq -r 'select(.type == "say") | .text'

# Task with a timeout
cline -y --timeout 600 "Run the full test suite"

# Chain commands
git diff | cline -y "explain" | cline -y "write a commit message"

Piped input

# Summarize a file
cat README.md | cline "Summarize this document"

# Review git changes
git diff | cline "Review these changes for potential issues"

# Analyze test output
npm test 2>&1 | cline -y "Fix any failing tests"

# Review a GitHub PR
gh pr diff 123 | cline -y "Review this PR"

Authentication

# Interactive wizard
cline auth

# Anthropic
cline auth -p anthropic -k sk-ant-api-xxxxx -m claude-sonnet-4-5-20250929

# OpenAI
cline auth -p openai-native -k sk-xxxxx -m gpt-4o

# OpenRouter
cline auth -p openrouter -k sk-or-xxxxx

# OpenAI-compatible with custom base URL
cline auth -p openai -k your-key -b https://api.example.com/v1

Isolated configurations

# Work configuration
cline --config ~/.cline-work "Review this PR"

# Personal configuration with a different model
cline --config ~/.cline-personal -m gpt-4o "Help with this side project"

See also

Installation

Install Cline CLI and configure authentication.

Interactive mode

Keyboard shortcuts, slash commands, and file mentions.

Headless mode

Run Cline autonomously in scripts and CI/CD pipelines.