# How to use Cline CLI: a step-by-step guide to Cline in the terminal

URL: https://agentvera.dev/en/blog/how-to-use-cline-cli/ · Published: 2026-11-15

How to use Cline CLI: install with npm, sign in or bring your own key, switch Plan and Act, run headless with --json, resume sessions and add rules and MCP.

**In short:**

- Install with npm install -g cline, run cline auth to sign in to a Cline account or add your own provider key, then run cline in a project and describe the task. Tab switches between Plan and Act.
- Approvals are off by default: --auto-approve is true, and one-shot or piped runs use yolo mode. Pass --auto-approve false when you want Cline to ask before each tool.
- The CLI is free; you pay for inference with Cline credits, ClinePass ($9.99 a month as of November 2026) or your own API keys. Rules go in .clinerules/ or AGENTS.md, MCP servers in cline_mcp_settings.json.

To use Cline CLI, you install it with `npm install -g cline`, run `cline auth` to sign in or add a provider key, then run `cline` inside a project and describe the task. **Unlike most coding CLIs, Cline approves its own tool calls by default, so pass `--auto-approve false` on a repository you care about.**

This guide covers Cline CLI 3.0 as of November 2026 (version 3.0.74): install, sign-in, Plan and Act, approvals, headless runs with `--json`, sessions, models, rules, MCP and what it costs.

## What Cline CLI is

[Cline](https://cline.bot "Cline") started as a VS Code extension and is one of the most used open coding agents. Cline CLI brings the same agent to the terminal. Version 3.0, released in May 2026, was a rewrite on Cline’s new SDK with a new terminal interface, so guides written for the 2.x CLI are out of date.

Cline is model-agnostic. You can use a Cline account with credits, a ClinePass subscription, or your own key for Anthropic, OpenAI, Gemini, OpenRouter, Bedrock, Vertex, DeepSeek, a local model through Ollama or LM Studio, and more than thirty other providers.

## Step 1: install the CLI

```bash
npm install -g cline
```

That is the only official install method. Prebuilt binaries ship for macOS, Linux and Windows on both arm64 and x64; use Node 22 to be safe, since the docs and the package disagree on the minimum version. Update later with `cline update`. If you want the newest build, `npm install -g cline@nightly` installs the nightly channel.

## Step 2: sign in or add a key

```bash
cline auth
```

This opens an interactive setup. `cline auth cline` signs in to a Cline account in the browser. To set a provider without prompts, for example on a server:

```bash
cline auth -p anthropic -k "$ANTHROPIC_API_KEY" -m claude-sonnet-5-5
```

Cline also reads keys from the environment (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `OPENROUTER_API_KEY`, `CLINE_API_KEY` and others). Saved credentials go to `~/.cline/data/settings/providers.json`.

## Step 3: work in the interactive view

```bash
cd my-project
cline
```

Describe the task in plain words, or start with one: `cline -i "add tests for the price formatter"`. Useful keys and commands:

- `Tab` switches between **Plan** and **Act**. Plan mode reads and discusses but cannot edit files; Act mode, the default, makes the changes. `cline -p` starts in Plan.
- `Shift+Tab` turns auto-approve on or off.
- `@file` adds a file (or an image) to the message.
- `/model` and `/settings` change the setup; `/mcp` manages servers; `/compact` shortens a long conversation; `/undo` reverts the last change; `/history` opens past sessions.
- `Ctrl+C` stops the current turn; press it twice, or `Ctrl+D`, to exit.

A good habit for bigger tasks: start in Plan, agree on the steps, then switch to Act.

## Step 4: decide how much Cline may do on its own

This is the setting that surprises people most. In Cline CLI:

| Situation | What happens |
|---|---|
| `cline` (interactive) | `--auto-approve` is on unless you turn it off |
| `cline --auto-approve false` | Asks `Approve tool …? [y/N]` before each tool |
| `cline "task"` (one-shot) or piped input | Runs in yolo mode |
| `cline -y` | Yolo mode; Cline’s own help calls it dangerous outside a sandbox |

There is no allow or deny list for shell commands. To block a command, add a `PreToolUse` hook (Step 7). On a real repository, start with `--auto-approve false` or work on a clean branch so every change is easy to throw away.

## Step 5: headless runs and CI

Cline runs without the interactive view when you pass `--json`, pipe something in, or redirect its output:

```bash
git diff | cline "review this diff for bugs"
cline --json "summarize the changes on this branch" | jq -r 'select(.type=="run_result") | .text'
```

`--json` prints one JSON event per line and ends with a `run_result` that holds the final text, the finish reason and the token usage. Other flags worth knowing: `-c` sets the working folder, `--worktree` runs in a git worktree, `-t` sets a timeout in seconds and `--data-dir` keeps state in an isolated folder.

In CI, install with npm, run `cline auth` with a key from the secrets store, then run the task. Remember that one-shot runs approve everything, so give the job only the permissions it needs.

## Step 6: sessions and models

`cline history` lists past sessions in a picker where you can resume or delete them. To reopen one directly:

```bash
cline history --json --limit 10
cline --id <session-id>
```

Sessions live in `~/.cline/data/sessions/`. `cline history export <session-id> -o session.html` saves one as a page.

To pick a model for one run, use `-P` for the provider and `-m` for the model; `--thinking` takes `none`, `low`, `medium`, `high` or `xhigh`. In the interactive view, use `/model`. With a Cline account and no model chosen, the default is Claude Sonnet 5.5 as of version 3.0.73.

## Step 7: rules, hooks and MCP servers

**Rules.** Put project rules in `.clinerules/` or `.cline/rules/`, and global ones in `~/.cline/rules`. Cline also reads `AGENTS.md` at the project root, so a file you already keep for Codex or other agents works as is. Our guide to [CLAUDE.md and AGENTS.md](/en/blog/claude-md-agents-md/ "CLAUDE.md and AGENTS.md") covers what to put in it.

**Skills and hooks.** Skills live in `.cline/skills/` or `.agents/skills/` and run as `/skill-name`; `cline skill add <owner/repo>` installs one. Hooks are executable scripts named after the event, such as `.cline/hooks/PreToolUse.sh`, and are the way to block risky commands.

**MCP.** Add servers from the command line:

```bash
cline mcp add memory --yes -- npx -y @modelcontextprotocol/server-memory
cline mcp add docs https://example.com/mcp --transport http --yes
```

They are saved under `mcpServers` in `~/.cline/data/settings/cline_mcp_settings.json`. `cline mcp` opens a menu, and `cline mcp remove <name>` deletes one.

## What Cline CLI costs (as of November 2026)

| Option | Price | Notes |
|---|---|---|
| Cline CLI | Free | The tool itself |
| Cline credits | Pay as you go | Bought on app.cline.bot; some free models with a small quota |
| ClinePass | $9.99/month | Higher limits on selected open models |
| Your own key | Your provider’s price | Anthropic, OpenAI, OpenRouter, local models and more |
| Enterprise | Custom | SSO, SLA, role-based access, central billing |

Check [Cline’s pricing page](https://cline.bot/pricing "Cline pricing") before you decide.

## Common pitfalls

- **Auto-approve on by default.** Turn it off with `--auto-approve false` until you trust the setup.
- **Following 2.x guides.** The 3.0 rewrite changed commands and flags. When in doubt, run `cline --help` for your version; a few flags, such as `-y`, are missing from the online reference.
- **Headless OAuth.** OAuth providers never open a browser in headless runs. Run `cline auth <provider>` once on that machine first.
- **Stuck background processes.** `cline doctor` checks the setup, and `cline doctor fix` stops stale processes.
- **`.clineignore` is on its way out.** Use a `PreToolUse` hook to keep Cline away from files.

## Running Cline CLI next to other CLIs in AgentVera

If Cline is the only agent you use, its own interface may be all you need. It gets harder when Cline runs next to Claude Code, Codex or Gemini CLI on the same project. [AgentVera](/en/ "AgentVera") is a desktop app that runs these CLIs side by side in real terminals, with your own installs and keys. [Cline support](/en/agents/cline/ "Cline CLI in AgentVera") works like this:

- **One session per agent.** AgentVera finds the session Cline creates through `cline history --json` and reopens it with `cline --id <id>` on later launches, so the conversation survives an app restart.
- **Model and effort.** The model you pick is passed with `--model` and the effort level with `--thinking`.
- **An account per agent.** Under Settings → Accounts you can add Anthropic, OpenAI or OpenRouter keys; each Cline account gets its own providers file, and everything else stays shared.
- **MCP and tokens.** Servers from AgentVera’s [MCP manager](/en/features/mcp-manager/ "MCP manager") reach Cline through its MCP settings file, and AgentVera reads Cline’s token usage for [token budgets](/en/features/token-budgets/ "Token budgets").
- **Panes and review.** Run Cline in the [workspace](/en/features/workspace/ "Workspace") grid next to other agents and check their changes with [code review](/en/features/code-review/ "Code review").

The free plan runs 2 agents at once and includes MCP, Git, Docker, SSH, code review and token savings. Pro is $9.99 a month and has no agent limit; if you have never had a trial, your first sign-in to the app turns on Pro for 7 days with no card. To try it, [download AgentVera](/en/download/ "Download AgentVera").

## Wrapping up

Cline CLI takes three commands to start: `npm install -g cline`, `cline auth` and `cline`. The choices that matter come right after: turn auto-approve off on real work, plan before you act on bigger tasks, keep the project’s rules in `AGENTS.md` or `.clinerules/`, and give one-shot CI runs only the access they need.

Sources: [Cline CLI reference](https://docs.cline.bot/cli/cli-reference "Cline CLI reference"), [CLI overview](https://docs.cline.bot/usage/cli-overview "Cline CLI overview"), [authorizing](https://docs.cline.bot/getting-started/authorizing-with-cline "Authorizing with Cline"), [Cline rules](https://docs.cline.bot/customization/cline-rules "Cline rules"), [MCP](https://docs.cline.bot/mcp/mcp-overview "Cline MCP"), [CLI changelog](https://github.com/cline/cline/blob/main/apps/cli/CHANGELOG.md "Cline CLI changelog").

## Frequently asked questions

**Is Cline CLI free?** The CLI itself costs nothing. You pay for the model: Cline credits bought on app.cline.bot, a ClinePass subscription ($9.99 a month as of November 2026, for selected open models), or your own API key from Anthropic, OpenAI, OpenRouter and many other providers. Some free models come with a small quota.

**Does Cline CLI ask before it edits files?** Not by default. --auto-approve defaults to true, and a one-shot run such as cline "task" runs in yolo mode. Start with --auto-approve false to get a yes/no prompt for each tool, or toggle auto-approve with Shift+Tab in the interactive view.

**How do I resume a Cline CLI session?** Run cline history to pick a past session from a list, or cline --id <session-id> to reopen one directly. cline history --json lists sessions with their ids, which is handy in scripts.

**Does Cline CLI read AGENTS.md?** Yes. Besides its own rules folders (.clinerules/ or .cline/rules/ in the project, ~/.cline/rules globally), Cline reads AGENTS.md at the project root, and also .cursorrules and .windsurfrules.

**Can I use my Claude Code or ChatGPT subscription with Cline CLI?** Cline lists a Claude Code provider and a ChatGPT (openai-codex) sign-in among its providers. Check the provider’s own terms before you use a subscription through another tool.

---

**About AgentVera.** AgentVera is a desktop app for macOS, Windows and Linux, built by Solviera Teknoloji. It runs 18 AI coding agents (Claude Code, Codex, Gemini CLI, Copilot, Cursor, Antigravity, opencode, Hermes, Qwen Code, Kimi Code, Kiro, Amp, Droid, Goose, Vibe, Crush, Aider, Cline) side by side, per project, in real terminals with the user's own CLI installs and logins. The free plan runs 2 agents at once. Download: https://agentvera.dev/en/download/ · Pricing: https://agentvera.dev/en/pricing/
