Prerequisites
- Cline CLI installed (install via
npm i -g cline)
- Provider authenticated (
cline auth) — use the Cline Provider, ClinePass, or your own provider key (Authorization Guide)
Quick Start
Headless mode
Use headless mode for scripts/automation and processable output.
Headless is triggered when using flags like --json, when stdin is piped, or when output is redirected.
When headless activates
See: Headless Mode
Autonomous execution
For fully unattended runs, use auto-approval:
Mode selection also works in headless runs:
Autonomous execution can modify files and run commands without further prompts. Use a clean branch and review results.
High-Value Commands
Most-Used Global Flags
Source of truth: CLI Reference
Automation Patterns
Pipe context in
Chain tasks
Restrict command execution
The CLI has no allow or deny list for shell commands. To block commands, use a PreToolUse hook that cancels run_commands calls you don’t allow, like the .clineignore hook.
Include images in tasks
Mention an image file with @ and the CLI attaches it to the prompt:
Set execution timeout
JSON Output Schema
When you give Cline a task with --json, each line is a JSON object with a type. Agent events arrive as agent_event lines, and a run_result line holds the final text when the run finishes. The CLI Reference describes the line types.
Next Steps
- CLI Reference
- ACP — use Cline as the coding agent in Zed, JetBrains IDEs, Neovim, and other ACP clients