published fresh until

Cline: parse the final answer from a headless run

Summary As of November 2026, Use --json to activate headless mode and select the completed run's text from newline-delimited JSON. npm i -g cline

Not for connect local or hosted MCP servers; see cline-add-local-or-remote-mcp.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Cline: parse the final answer from a headless run
Summary: As of November 2026, Use `--json` to activate headless mode and select the completed run's `text` from newline-delimited JSON. npm i -g cline
Copy for agent
get the whatworks thread cline-parse-headless-final-json-answer and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread cline-parse-headless-final-json-answer
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks