Documentation Index Fetch the complete documentation index at: https://docs.cline.bot/llms.txt
Use this file to discover all available pages before exploring further.
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)
Synopsis
cline [prompt] [options]
cline < comman d > [options] [arguments]
Global Options
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, --verboseShow detailed output including model reasoning --helpShow help for the command
Modes of Operation
Cline CLI automatically detects the best output mode based on how you invoke it:
Mode When Activated Description Interactive cline with no args, TTY connectedRich terminal UI with real-time streaming, keyboard shortcuts, and visual feedback. Task cline "prompt" with TTY connectedInteractive 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.
Agent Behavior
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.
Commands
cline (default)
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, --actStart in Act mode (default). Cline executes actions directly. -p, --planStart in Plan mode. Cline analyzes and creates a strategy before acting. -y, --yoloYOLO 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. --thinkingEnable extended thinking with a 1024 token budget. --jsonOutput messages as JSON (one object per line). Forces plain text mode. --timeout <seconds>Maximum execution time before the task is stopped. --continueResume the most recent task from the current working directory.
Mode Behavior:
Invocation Output Mode Why clineInteractive 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.txtPlain text stdout is redirected
cline task (alias: t)
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.
cline auth
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 anthropicAnthropic Claude (direct API) openai-nativeOpenAI GPT models openai-codexChatGPT subscription via OAuth openrouterOpenRouter (access multiple providers) bedrockAWS Bedrock geminiGoogle Gemini xaiX AI (Grok) cerebrasCerebras (fast inference) deepseekDeepSeek ollamaOllama (local models) lmstudioLM Studio (local models) openaiOpenAI-compatible API (custom base URL)
cline history (alias: h)
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)
cline config
View and manage configuration settings.
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 update
Check for updates and install the latest version.
cline version
Show the installed CLI version.
cline dev
Developer tools for debugging.
# Open the log file
cline dev log
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, task history) is stored in this directory instead of ~/.cline/data/.
Use cases:
Running isolated Cline instances with different settings
CI/CD environments with custom state directories
Testing configuration changes without affecting your main setup
CLINE_COMMAND_PERMISSIONS
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 allowstring[]Glob patterns for allowed commands. If set, only matching commands are permitted. denystring[]Glob patterns for denied commands. Deny rules always take precedence over allow rules. allowRedirectsbooleanWhether 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:
Check for dangerous characters (backticks outside single quotes, unquoted newlines)
Parse command into segments split by operators (&&, ||, |, ;)
If redirects are detected and allowRedirects is not true, command is denied
Each segment is validated against deny rules first, then allow rules
Subshell contents ($(...) and (...)) are recursively validated
All segments must pass for the command to be allowed
When 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 textstringHuman-readable message content tsnumberUnix timestamp in milliseconds
Optional fields:
Field Type Description saystringSubtype when type is "say" (e.g., "text", "tool") askstringSubtype when type is "ask" (e.g., "tool", "followup") reasoningstringModel reasoning (omitted when empty) partialbooleantrue while streaming (omitted when complete)imagesstring[]Image URIs (omitted when empty) filesstring[]File paths (omitted when empty)
Configuration Files
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)
Examples
Interactive Development
# Start interactive mode
cline
# Start with a task and use interactive UI
cline "Help me refactor this codebase"
Direct Task Execution
# 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"
Automation and CI/CD
# 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"
Authentication
# 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
Support
See Also
Installation & Setup Install Cline CLI and configure authentication.
Interactive Mode Keyboard shortcuts, slash commands, and file mentions.
Headless Mode Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows.
Configuration Environment variables and advanced settings.