sdk/apps/cli/README.md
Run Cline in your terminal. Interactive chat for paired sessions, or fully headless for CI/CD and scripting. The CLI shares its agent core with the Cline VS Code extension, JetBrains plugin, and SDK, so plan/act modes, MCP servers, checkpoints, rules, skills, and provider configuration all behave the same across surfaces.
npm install -g cline
For nightly builds:
npm install -g cline@nightly
Platform binaries are published for macOS, Linux, and Windows on arm64 and x64. The cline package resolves the correct binary for your platform via optional dependencies, so no Node, Bun, or Zig runtime is required at install time.
Run interactively:
cline
Run a single prompt:
cline "Audit this package and propose fixes"
Pipe input:
cat file.txt | cline "Summarize this"
See cline --help for the full flag reference.
Cline supports the same providers as the VS Code extension. You can sign in to Cline directly, use your ChatGPT Subscription through openai-codex, or bring an API key from Anthropic, OpenAI, Google Gemini, OpenRouter, AWS Bedrock, GCP Vertex, Cerebras, Groq, and any OpenAI-compatible endpoint.
cline auth # interactive sign-in
cline auth cline # OAuth sign-in
cline auth --provider anthropic --apikey sk-... --modelid claude-sonnet-4-6
cline auth without a provider opens the interactive auth setup TUI with the same options as the old CLI flow (Sign in with Cline, Sign in with ChatGPT Subscription, Sign in with OCA, or use your own API key).
OAuth-supported providers (cline, openai-codex, oca) do not auto-launch a browser on normal startup. Authenticate explicitly first with cline auth <provider>. For non-interactive runs, if an OAuth provider is selected and no saved credentials are available, cline fails fast with an authentication message instead of launching a hidden browser flow.
Cline CLI runs in a few different shapes depending on what you need:
cline or cline -i opens a full terminal UI with plan/act toggle, slash commands, file mentions, and live tool approvalscline "your prompt" runs a single turn and exitscline --json "..." streams NDJSON events for piping into other toolscline --yolo "..." skips approval prompts and exits when the turn finishescline --zen "..." fires the task to the background hub daemon and exits immediately (see below)Run Cline with zero interaction for scripting and automation. Pipe input, get JSON output, chain commands, integrate into CI/CD pipelines.
# One-shot prompt, auto-approve all tools
cline --yolo "Run tests and fix any failures"
# Pipe a diff in for review
git diff origin/main | cline "Review these changes for issues"
# NDJSON output for downstream tooling
cline --json "List all TODO comments" | jq -r 'select(.type == "agent_event" and .event.text) | .event.text'
/undo to rewind workspace stateopenai-codex), and OCA# Start Cline CLI without a prompt to enter interactive mode
cline
# Single prompt (one-shot) - includes tools, spawn, and teams
cline "Audit this package and propose fixes"
# Interactive mode with a starting prompt
cline -i "Let's work on this together. First, analyze the current state."
# With a custom system prompt
cline -i -s "You are a pirate" "Tell me about the sea"
# Require approval before each tool call
cline --auto-approve false "Inspect and modify this repository"
# Explicit yolo: enables submit_and_exit and disables spawn/team tools by default
cline --yolo --retries 5 "Refactor this package"
# Override consecutive internal mistake (retry) limit (default: 3)
cline --retries 5 "Fix failing tests"
# Team workflow with persistent name
cline --team-name my-team "Plan, implement, and verify release checklist"
cline --team-name my-team "Continue yesterday's team workflow"
# Show verbose run stats (elapsed time, tokens, estimated cost when available)
cline -v "Explain quantum computing"
# Use a specific provider, model, and access token for a single prompt
cline -P openrouter -m google/gemini-3-pro -k sk-... "Set up a storybook"
# Use a different model with the last used provider
cline -m anthropic/claude-opus-4-6 "Explain string theory"
# Stream structured NDJSON output
cline --json "Summarize this repository"
# Quick provider setup
cline auth --provider anthropic --apikey sk-... --modelid claude-sonnet-4-6
cline auth --provider openai-native --apikey sk-... --modelid gpt-5 --baseurl https://api.example.com/v1
Bridge a chat surface into RPC-backed Cline sessions. Each conversation thread maps to a session with full context. Supported platforms: Telegram, Slack, Google Chat, WhatsApp, and Linear.
# Telegram (polling mode)
cline connect telegram -m my_bot -k 123456:ABCDEF...
# Slack (webhook mode)
cline connect slack --bot-token $SLACK_BOT_TOKEN --signing-secret $SLACK_SIGNING_SECRET --base-url https://your-domain.com
# Google Chat (webhook mode)
cline connect gchat --base-url https://your-domain.com
# WhatsApp (webhook mode)
cline connect whatsapp --base-url https://your-domain.com
# Linear (webhook mode)
cline connect linear --api-key $LINEAR_API_KEY --base-url https://your-domain.com
# Stop connector bridges and delete their sessions
cline connect --stop
cline connect --stop telegram
In chat surfaces, connector slash commands include /help, /start, /new, /clear, /whereami, /tools, /yolo, /cwd <path>, /schedule, /abort, and /exit. Run cline connect <adapter> --help to see the full flag list for any adapter.
Schedule agents on cron-like intervals or external events.
cline schedule create "Daily code review" \
--cron "0 9 * * MON-FRI" \
--prompt "Review PRs opened yesterday and summarize issues." \
--workspace /path/to/repo \
--provider cline \
--model openai/gpt-5.3-codex \
--timeout 3600 \
--tags automation,review
cline schedule list
cline schedule get <schedule-id>
cline schedule trigger <schedule-id>
cline schedule history <schedule-id> --limit 20
cline schedule export <schedule-id> > daily-review.yaml
cline schedule import ./daily-review.yaml
Schedules can route results back to chat surfaces with --delivery-adapter, --delivery-bot, and --delivery-thread.
| Flag | Description |
|---|---|
-s, --system <prompt> | Override the system prompt |
-P, --provider <id> | Provider id (default: cline) |
-m, --model <id> | Model id (default: anthropic/claude-sonnet-4.6) |
-k, --key <api-key> | API key override for this run |
-p, --plan | Run in plan mode (default is act mode) |
-i, --tui | Interactive TUI multi-turn mode |
-t, --timeout <seconds> | Optional run timeout in seconds |
-c, --cwd <path> | Working directory for tools |
--config <path> | Configuration directory (used for CLI home resolution) |
--hooks-dir <path> | Additional hooks directory hint for runtime hook injection |
--acp | ACP (Agent Client Protocol) mode |
--thinking [none|low|medium|high|xhigh] | Model thinking level when supported. Defaults to medium when the flag is provided without a level; thinking is off when the flag is omitted. |
--compaction <agentic|basic|off> | Context compaction mode. Defaults to basic; use agentic for LLM compaction or off to disable. |
--retries <count> | Maximum consecutive mistakes (retries) before halting (default: 3) |
--json | Output NDJSON instead of styled text |
--data-dir <path> | Use isolated local state at <path> instead of ~/.cline (enables sandbox mode automatically) |
--auto-approve [true|false] | Set tool auto-approval for all tools |
--kanban | Run the external kanban app |
-y, --yolo | Skip tool approval prompts, enable submit_and_exit, and disable spawn/team tools by default |
-z, --zen | Dispatch the task to the background hub and exit the CLI immediately |
--team-name <name> | Override the runtime team state name |
-h, --help | Show help and exit |
-v, --verbose | Show verbose runtime diagnostics |
-V, --version | Show version and exit |
--json is non-interactive and requires either a prompt argument or piped stdin. --key takes precedence over environment variables.
cline config - Open the interactive config viewcline history|h [options] - List session history or manage saved sessionscline version - Show CLI versioncline update [options] - Check for CLI and kanban updatescline auth <provider> - Authenticate or seed provider credentialscline connect <adapter> - Run a chat connector bridge (telegram, gchat, whatsapp)cline connect --stop [adapter] - Stop connector bridge processes and their sessionscline schedule <command> - Create and manage scheduled runscline doctor - Inspect local CLI health and stale processescline doctor fix - Kill stale local RPC listeners and old CLI processescline doctor log - Open the CLI runtime log filecline hook - Handle a hook payload from stdincline hub - Manage the local hub daemoncline kanban - Run the external kanban app, installing it first when needed--zen (alias -z) runs a task in the background hub daemon and exits the CLI immediately. It is intended for long-running tasks you want to fire off and walk away from.
cline --zen "Refactor the authentication module and add unit tests"
Behavior:
--yolo). spawn/team tools are disabled by default for safety, consistent with yolo-mode defaults.ui.notify events and will surface a system notification when the task completes.cline history later to find the session and inspect the result.--zen is incompatible with --data-dir (the implicit sandbox requires a local backend that exits with the CLI) and with --tui (there is no terminal UI to render into).Tool calls are auto-approved by default. Use --auto-approve false to require review before tool execution.
cline --auto-approve false "Inspect and modify this repository"
When approval is required, the CLI prompts in TTY mode:
Approve tool "<tool_name>" with input <preview>? [y/N]
y or yes to approve.Desktop-integrated approval mode is also supported via env wiring (CLINE_TOOL_APPROVAL_MODE=desktop and CLINE_TOOL_APPROVAL_DIR=<path>). In desktop mode, CLI writes a request JSON file and waits for a matching decision JSON file.
ANTHROPIC_API_KEY - API key for AnthropicCLINE_API_KEY - API key for Cline (when using -P cline)OPENAI_API_KEY - API key for OpenAI (when using -P openai)OPENROUTER_API_KEY - API key for OpenRouter (when using -P openrouter)AI_GATEWAY_API_KEY - API key for Vercel AI Gateway (when using -P vercel-ai-gateway)V0_API_KEY - API key for v0 (when using -P v0)CLINE_DATA_DIR - Base data directory for sessions/settings/teams/hooksCLINE_SANDBOX - Set to 1 to force sandbox modeCLINE_SANDBOX_DATA_DIR - Override sandbox state directoryCLINE_TEAM_DATA_DIR - Override team persistence directoryCLINE_BUILD_ENV - Runtime build mode for SDK-owned subprocess launchesCLINE_DEBUG_HOST - Host for development inspector listeners (default 127.0.0.1)CLINE_DEBUG_PORT_BASE - Base inspector port for development child processesCLINE_TOOL_APPROVAL_MODE - Approval mode (desktop uses file IPC; unset uses terminal prompt)CLINE_TOOL_APPROVAL_DIR - Directory for desktop approval request/decision filesCLINE_LOG_ENABLED - Set to 0/false to disable runtime file loggingCLINE_LOG_LEVEL - Runtime log level (trace|debug|info|warn|error|fatal|silent, default info)CLINE_LOG_PATH - Runtime log file path (default <CLINE_DATA_DIR>/logs/cline.log)CLINE_LOG_NAME - Logger name embedded in runtime log records--key takes precedence over environment variables.
See DEVELOPMENT.md for local development setup, monorepo structure, and TUI architecture. See DISTRIBUTION.md for how the CLI is packaged and distributed.