Back to Cline

Overview

docs/cline-cli/overview.mdx

3.82.09.1 KB
Original Source

What is Cline CLI?

Cline CLI brings the full power of Cline to your terminal. Whether you prefer an interactive experience or automated workflows for CI/CD pipelines, the CLI adapts to your needs.

The CLI supports macOS, Linux, and Windows, and works with all the same AI providers as the VS Code extension.

<Tip> Ready to get started? Check out the [installation guide](/cline-cli/installation) to install Cline CLI and run your first task. </Tip>

Two Ways to Use Cline CLI

<Columns cols={2}> <Card title="Interactive Mode" icon="terminal" href="/cline-cli/interactive-mode"> **For hands-on development.** Launch `cline` in your terminal and collaborate with Cline in real-time — chat, review plans, approve actions, and iterate on tasks with a rich visual interface. </Card> <Card title="Headless Mode" icon="robot" href="/cline-cli/three-core-flows"> **For automation & CI/CD.** Run `cline -y "task"` to let Cline work autonomously — no interaction needed. Pipe input/output, get JSON results, and chain commands in scripts and pipelines. </Card> </Columns>

The CLI operates in two distinct modes, automatically selecting the appropriate one based on how you invoke it:

Interactive Mode

Interactive mode is designed for hands-on development sessions where you want to collaborate with Cline in real-time. It provides a rich terminal interface that feels like chatting with an AI assistant.

When it activates: Running cline without arguments, or when stdin is a TTY (terminal).

bash
cline

Key features:

  • Real-time conversation - Type messages, see Cline's responses, and iterate on tasks
  • Visual feedback - Animated welcome screen, syntax-highlighted code, and progress indicators
  • File mentions with @ - Reference workspace files with fuzzy search autocomplete
  • Slash commands with / - Quick access to /settings, /history, /models, and workflows
  • Keyboard shortcuts - Tab to toggle Plan/Act, Shift+Tab for auto-approve all
  • Session summaries - See tasks completed, files modified, and token usage on exit
  • Settings panel - Configure providers, models, and features without leaving the CLI

Interactive mode keeps you in control. You review Cline's plan, approve or modify actions, and guide the conversation.

Learn more about interactive mode →

Headless Mode (Non-Interactive)

Headless mode is designed for automation, scripting, and CI/CD pipelines where human interaction isn't possible or desired.

When it activates: Using the -y/--yolo flag, --json flag, piping input/output, or when stdin is not a TTY.

bash
# Headless with auto-approval (YOLO mode)
cline -y "Run tests and fix any failures"

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

# Headless via piped input
cat README.md | cline "Summarize this document"

# Chain multiple headless commands
git diff | cline -y "explain these changes" | cline -y "write a commit message"

Key features:

  • No visual interface - Clean text or JSON output suitable for scripting
  • Automatic execution - With -y, Cline approves all actions and runs autonomously
  • Process control - Exits automatically when the task completes
  • Piped workflows - Read from stdin, write to stdout, chain with other commands
  • Machine-readable output - Use --json to get structured output for parsing
<Warning> Headless mode with `-y` gives Cline full autonomy. Run on a clean git branch so you can easily revert changes if needed. </Warning>

Mode Detection Summary

Cline automatically detects which mode to use based on your invocation. This table shows how different command patterns trigger each mode, helping you predict behavior in scripts and interactive sessions.

InvocationModeReason
clineInteractiveNo arguments, TTY connected
cline "task"InteractiveTTY connected
cline -y "task"HeadlessYOLO flag forces headless
cline --json "task"HeadlessJSON flag forces headless
cat file | cline "task"Headlessstdin is piped
cline "task" > output.txtHeadlessstdout is redirected

Learn more about headless mode →

Supported Model Providers

Cline CLI supports all providers available in the VS Code extension:

  • Anthropic (Claude)
  • OpenAI (GPT-4o, GPT-4)
  • OpenAI Codex (ChatGPT subscription)
  • OpenRouter
  • AWS Bedrock
  • Google Gemini
  • X AI (Grok)
  • Cerebras
  • DeepSeek
  • Ollama (local models)
  • LM Studio (local models)
  • OpenAI Compatible (any compatible API)

During setup, authenticate with cline auth to configure your preferred provider. See setup guide →

What You Can Build

Automated Code Maintenance

Keep your codebase healthy with automated fixes. Cline scans for issues and applies corrections across multiple files.

bash
cline -y "Fix all ESLint errors in src/"

Finds and fixes linting violations throughout your source directory.

bash
cline -y "Update all deprecated React lifecycle methods"

Migrates legacy code patterns to modern equivalents (e.g., componentWillMountuseEffect).

bash
cline -y "Update dependencies with known vulnerabilities"

Identifies outdated packages with security issues and updates them to safe versions.

CI/CD Integration

Integrate Cline into your continuous integration pipelines for automated code review and documentation.

bash
git diff origin/main | cline -y "Review these changes for issues"

Pipes your PR diff to Cline for automated code review, catching bugs and style issues before merge.

bash
git log --oneline v1.0..v1.1 | cline -y "Write release notes"

Generates human-readable release notes from your commit history between two tags.

bash
cline -y "Run tests and fix failures" --timeout 600

Executes your test suite, analyzes failures, and attempts fixes with a 10-minute timeout.

Development Workflows

From quick edits to complex refactors, Cline adapts to your workflow.

bash
cline

Launches interactive mode for exploratory development and back-and-forth collaboration.

bash
cline "Refactor this function to use async/await"

Executes a focused task directly from the command line with approval prompts at key steps.

bash
cline "Based on @src/api.ts, add error handling to all endpoints"

Uses file mentions (@) to give Cline context about specific files in your workspace.

Custom Shell Pipelines

Chain Cline with other CLI tools to build powerful automation workflows.

bash
gh pr diff 123 | cline -y "Review this PR"

Fetches a GitHub PR diff and pipes it directly to Cline for review.

bash
cline --json "List all TODO comments" | jq '.text'

Outputs structured JSON that you can process with tools like jq for scripting.

bash
git diff | cline -y "explain" | cline -y "write a haiku about these changes"

Chains multiple Cline invocations together for creative multi-step workflows.

Features at a Glance

FeatureInteractive ModeNon-Interactive Mode
Interactive chat-
File mentions (@)✓ (inline)
Slash commands (/)-
Settings panelcline config
Plan/Act toggle✓ (Tab)-p / -a flags
Auto-approve✓ (Shift+Tab)-y flag
Session summary-
JSON output---json
Piped input-
MCP servers

MCP Server Support

Cline CLI supports MCP (Model Context Protocol) servers, the same extensibility system available in the VS Code extension. MCP servers give Cline access to external tools and data sources, from databases and APIs to browser automation and project management.

To use MCP servers with the CLI, add your server configuration to ~/.cline/data/settings/cline_mcp_settings.json. The format is identical to the VS Code extension.

Configure MCP servers for the CLI →

Learn More

<Columns cols={2}> <Card title="Installation & Setup" icon="download" href="/cline-cli/installation"> Install Cline CLI and authenticate with your preferred provider. </Card> <Card title="Interactive Mode" icon="terminal" href="/cline-cli/interactive-mode"> Master the interactive CLI with keyboard shortcuts and slash commands. </Card> <Card title="Headless Mode" icon="robot" href="/cline-cli/three-core-flows"> Run Cline autonomously in scripts, CI/CD pipelines, and automated workflows. </Card> <Card title="Configuration" icon="gear" href="/cline-cli/configuration"> Configure settings, rules, workflows, and environment variables. </Card> <Card title="Use in Other Editors" icon="code" href="/cline-cli/acp-editor-integrations"> Run Cline as an ACP agent in JetBrains, Neovim, Zed, and more. </Card> <Card title="CLI Samples" icon="flask" href="/cline-cli/samples/overview"> Real-world examples of headless workflows and automation patterns. </Card> </Columns>