> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/cline/cline/llms.txt
> Use this file to discover all available pages before exploring further.

# Cline CLI

> Run the same Cline AI coding agent from your terminal — interactive TUI for hands-on development, headless mode for CI/CD and automation.

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.

<Tip>
  Ready to get started? See [Installation](/cline-cli/installation) to install Cline CLI and configure your provider in a few minutes.
</Tip>

## Two modes of operation

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

<CardGroup cols={2}>
  <Card title="Interactive mode" icon="terminal" href="/cline-cli/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.
  </Card>

  <Card title="Headless mode" icon="robot" href="/cline-cli/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.
  </Card>
</CardGroup>

### 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.

```bash theme={null}
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.

```bash theme={null}
# 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"
```

<Warning>
  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.
</Warning>

### Mode detection reference

| Invocation                 | Mode        | Reason                      |
| -------------------------- | ----------- | --------------------------- |
| `cline`                    | Interactive | No arguments, TTY connected |
| `cline "task"`             | Interactive | TTY connected               |
| `cline -y "task"`          | Headless    | `--yolo` flag               |
| `cline --json "task"`      | Headless    | `--json` flag               |
| `cat file \| cline "task"` | Headless    | stdin is piped              |
| `cline "task" > out.txt`   | Headless    | stdout 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 extension         | Cline CLI                      |
| ------------------ | ------------------------- | ------------------------------ |
| Interface          | Sidebar panel in VS Code  | Terminal (TUI or plain text)   |
| File context       | Open editors, workspace   | `@file` mentions, piped stdin  |
| Automation         | Manual                    | Headless mode, shell scripting |
| CI/CD use          | Not suitable              | First-class support            |
| Editor integration | VS Code only              | Any ACP-compatible editor      |
| MCP servers        | `cline_mcp_settings.json` | Same file, same format         |

## What you can do with Cline CLI

### Automated code maintenance

```bash theme={null}
# 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

```bash theme={null}
# 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

```bash theme={null}
# 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:

| Provider                            | Provider ID     |
| ----------------------------------- | --------------- |
| Anthropic (Claude)                  | `anthropic`     |
| OpenAI (GPT-4o, GPT-4)              | `openai-native` |
| OpenAI Codex (ChatGPT subscription) | `openai-codex`  |
| OpenRouter                          | `openrouter`    |
| AWS Bedrock                         | `bedrock`       |
| Google Gemini                       | `gemini`        |
| X AI (Grok)                         | `xai`           |
| Cerebras                            | `cerebras`      |
| DeepSeek                            | `deepseek`      |
| Moonshot (Kimi)                     | `moonshot`      |
| Ollama (local)                      | `ollama`        |
| LM Studio (local)                   | `lmstudio`      |
| OpenAI-compatible                   | `openai`        |

Run `cline auth` to configure your provider interactively, or use flags for scripted setup:

```bash theme={null}
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)](/mcp/mcp-overview) 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:

```bash theme={null}
# 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

| Feature                 | Interactive mode  | Headless mode     |
| ----------------------- | ----------------- | ----------------- |
| Conversational chat     | Yes               | No                |
| File mentions (`@`)     | Yes               | Yes (inline)      |
| Slash commands (`/`)    | Yes               | No                |
| Settings panel          | Yes               | `cline config`    |
| Plan / Act toggle       | Yes (`Tab`)       | `-p` / `-a` flags |
| Auto-approve            | Yes (`Shift+Tab`) | `-y` flag         |
| Session summary on exit | Yes               | No                |
| JSON output             | No                | `--json` flag     |
| Piped stdin             | No                | Yes               |
| MCP servers             | Yes               | Yes               |

## Next steps

<CardGroup cols={2}>
  <Card title="Installation" 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 TUI with keyboard shortcuts and slash commands.
  </Card>

  <Card title="Headless mode" icon="robot" href="/cline-cli/headless-mode">
    Run Cline autonomously in scripts, CI/CD, and automated workflows.
  </Card>

  <Card title="CLI reference" icon="book" href="/cline-cli/cli-reference">
    Complete documentation for all commands, flags, and options.
  </Card>
</CardGroup>
