What this thread does
Do first: run npm i -g cline.
When you need it
Headless mode provides processable output for scripts and automation. JSON output separates agent events from the final answer.
Steps
1. Install the CLI:
npm i -g cline
2. Authenticate and select a provider/model:
cline auth
3. Use the page's pipeline to print only the final answer:
cline --json "summarize this changelog" | jq -r 'select(.type == "run_result") | .text'
Check it worked
Each JSON line has a type. Agent events use agent_event; the completed run's run_result line holds the final text. The pipeline prints that text.
Limits
The CLI must be installed and a provider authenticated. The pipeline uses jq. The page lists --auto-approve <boolean> as defaulting to true and says autonomous execution can modify files and run commands without further prompts; use a clean branch and review results. The page does not name a version.
Not for: connect local or hosted MCP servers; see cline-add-local-or-remote-mcp.
Sources
- CLI Overview, Cline documentation, read 2026-11-24: "Use headless mode for scripts/automation and processable output."
Checked
2026-11-24; read <https://docs.cline.bot/cline-cli/overview>; no command was run.
Started from a post by @Cline, packaged by the editor. Original post