Skip to main content
Cline CLI brings the full power of the Cline coding agent to your terminal. It’s the same AI that powers the VS Code extension — capable of reading and editing files, running shell commands, using a browser, and calling MCP tools — exposed as a command-line tool. The CLI runs on macOS, Linux, and Windows and supports every AI provider available in the VS Code extension.
Ready to get started? See Installation to install Cline CLI and configure your provider in a few minutes.

Two modes of operation

Cline CLI automatically selects the right mode based on how you invoke it.

Interactive mode

Launch cline to open a rich terminal UI. Chat with the agent, review plans, approve actions, and iterate — all without leaving your terminal.

Headless mode

Run cline -y "task" to let Cline work autonomously. Pipe input and output, get JSON results, and integrate with CI/CD pipelines and shell scripts.

Interactive mode

Interactive mode is for hands-on development sessions. It provides a full terminal UI with streaming output, keyboard shortcuts, and a conversational interface. Activates when: you run cline with no arguments, or with a prompt while stdin is a TTY.
cline
Key capabilities:
  • Real-time conversation with back-and-forth iteration
  • File mentions with @ and fuzzy-search autocomplete
  • Slash commands (/settings, /history, /models, /help)
  • Tab to toggle Plan / Act mode; Shift+Tab to enable auto-approve
  • Session summary on exit showing files modified, commands run, and token usage
  • Settings panel for configuring providers, models, and auto-approve rules

Headless mode

Headless mode is for automation, scripting, and CI/CD pipelines where no human is present. Cline runs the task, writes clean text or JSON output, and exits. Activates when: the -y/--yolo flag is set, --json is passed, stdin is piped, or stdout is redirected.
# Fully autonomous — auto-approves all actions
cline -y "Run the test suite and fix any failures"

# JSON output for scripting
cline --json "List all TODO comments" | jq '.text'

# Piped input
cat README.md | cline "Summarize this document"

# Chained commands
git diff | cline -y "explain these changes" | cline -y "write a commit message"
The -y/--yolo flag gives Cline full autonomy — it approves all file writes and command executions without prompting. Always run on a clean git branch so you can revert if needed.

Mode detection reference

InvocationModeReason
clineInteractiveNo arguments, TTY connected
cline "task"InteractiveTTY connected
cline -y "task"Headless--yolo flag
cline --json "task"Headless--json flag
cat file | cline "task"Headlessstdin is piped
cline "task" > out.txtHeadlessstdout is redirected

How it differs from the VS Code extension

The CLI and the VS Code extension share the same underlying agent — same models, same tools, same MCP server support, same rules and workflow files. The differences are in the interface:
VS Code extensionCline CLI
InterfaceSidebar panel in VS CodeTerminal (TUI or plain text)
File contextOpen editors, workspace@file mentions, piped stdin
AutomationManualHeadless mode, shell scripting
CI/CD useNot suitableFirst-class support
Editor integrationVS Code onlyAny ACP-compatible editor
MCP serverscline_mcp_settings.jsonSame file, same format

What you can do with Cline CLI

Automated code maintenance

# Fix linting errors across the source directory
cline -y "Fix all ESLint errors in src/"

# Migrate deprecated APIs
cline -y "Update all deprecated React lifecycle methods"

# Update vulnerable dependencies
cline -y "Update dependencies with known vulnerabilities"

CI/CD integration

# Review a pull request diff
git diff origin/main...HEAD | cline -y "Review these changes for bugs and security issues"

# Generate release notes from git log
git log --oneline v1.0..v1.1 | cline -y "Write release notes"

# Run tests and fix failures (10-minute timeout)
cline -y --timeout 600 "Run tests and fix any failures"

Shell pipelines

# Pipe a GitHub PR diff directly to Cline
gh pr diff 123 | cline -y "Review this PR"

# Parse structured output with jq
cline --json "List all TODO comments" | jq '.text'

# Multi-step chained workflow
git diff | cline -y "explain" | cline -y "write a haiku about these changes"

Supported providers

Cline CLI supports all providers available in the VS Code extension:
ProviderProvider ID
Anthropic (Claude)anthropic
OpenAI (GPT-4o, GPT-4)openai-native
OpenAI Codex (ChatGPT subscription)openai-codex
OpenRouteropenrouter
AWS Bedrockbedrock
Google Geminigemini
X AI (Grok)xai
Cerebrascerebras
DeepSeekdeepseek
Moonshot (Kimi)moonshot
Ollama (local)ollama
LM Studio (local)lmstudio
OpenAI-compatibleopenai
Run cline auth to configure your provider interactively, or use flags for scripted setup:
cline auth -p anthropic -k sk-ant-api-xxxxx -m claude-sonnet-4-5-20250929

MCP server support

Cline CLI supports MCP (Model Context Protocol) servers — the same extensibility system used in the VS Code extension. MCP servers give Cline access to external tools and data sources such as databases, APIs, and browser automation. Configure MCP servers in ~/.cline/data/settings/cline_mcp_settings.json, or add them from the CLI:
# STDIO server
cline mcp add my-server -- node /path/to/server.js

# Remote HTTP server
cline mcp add linear https://mcp.linear.app/mcp --type http

Features at a glance

FeatureInteractive modeHeadless mode
Conversational chatYesNo
File mentions (@)YesYes (inline)
Slash commands (/)YesNo
Settings panelYescline config
Plan / Act toggleYes (Tab)-p / -a flags
Auto-approveYes (Shift+Tab)-y flag
Session summary on exitYesNo
JSON outputNo--json flag
Piped stdinNoYes
MCP serversYesYes

Next steps

Installation

Install Cline CLI and authenticate with your preferred provider.

Interactive mode

Master the TUI with keyboard shortcuts and slash commands.

Headless mode

Run Cline autonomously in scripts, CI/CD, and automated workflows.

CLI reference

Complete documentation for all commands, flags, and options.

Build docs developers (and LLMs) love