Cline CLI: the Cline Agent in the Terminal with Your Own Model Provider
Cline works outside the editor too. The console version installs via npm, takes tasks from arguments and pipes, and connects to any compatible provider.
5 min · · агенты · автоматизация
Cline is known as an editor extension, but it also has a console version. Cline CLI runs the same agent in the terminal: you can hold a dialogue, send a one-off task as an argument or take data through a pipe from another command. Below we cover installation, connecting your own provider and safe ways to run tasks without an editor.
An important caveat: Cline's documentation changes quickly, and what follows is the set of flags from the current reference at the time of writing. Check the output of cline --help in your version before relying on it.
What Cline CLI is
It is a console client that reads a project, edits files and runs commands using a model you choose. According to the documentation it supports:
- interactive mode: just
cline, or a terminal UI with the-iflag; - one-off tasks:
cline "your task"; - plan mode
-pand act mode (the default); - headless mode for scripts: triggered by
--json, piped input or redirected output; - MCP servers (
cline mcp), hooks and plugins, schedules (cline schedule).
Configuration lives in ~/.cline/ and is shared between the editor extension, the CLI and the SDK: rules, skills, provider settings. So what you set up for Cline in the IDE is picked up by the console client.
Installation
You need Node.js 20 or newer (22 recommended):
npm install -g cline
cline --versionDo not install the package with sudo: it is better to configure a user-level npm directory. Update with cline update or the --update flag.
Connecting your own provider
Run the setup wizard:
cline authChoose the provider that points to an OpenAI-compatible API and enter three values: Base URL, key and model id. For the Zukko gateway these are:
- Base URL:
https://api.zukko.pro/v1(clients on the OpenAI format use the address with/v1); - key:
fetch_...from the dashboard; - model: an id from
GET /v1/models, for exampleclaude-sonnet-5-5ordeepseek-v4.1-flash.
According to the reference, cline auth accepts options for non-interactive setup: provider, key, model id and base address (-b, --baseurl). The exact provider id for an OpenAI-compatible API depends on the version, so go through the interactive wizard once, look at the result in cline config and only then automate. Do not paste the key into the command-line history on a shared machine: the reference notes that provider keys are stored in ~/.cline/data/settings/providers.json, so restrict permissions on that directory.
Cline also has an Anthropic provider with a custom base address option. The general gateway rule: Anthropic-format providers take the address without /v1 (https://api.zukko.pro), OpenAI Compatible takes it with /v1. The option documented by Zukko for Cline is OpenAI Compatible; if you chose Anthropic and get a 404, check the address suffix first. More on choosing a format is in the Zukko documentation and in the article on connecting Cline.
Running tasks
A few typical scenarios:
## Interactive session
cline
## One-off task
cline "rewrite the parser module to use async/await"
## Plan first, no edits
cline -p "propose a plan for migrating to the new library version"
## Data through a pipe
git diff | cline "find possible regressions in these changes"
## Structured output for scripts
cline --json "list TODOs in the project" | jq -r 'select(.type == "run_result") | .text'The flags used most often: -m (model for this run), -P (provider), -c (working directory), -t (timeout in seconds), --thinking (reasoning level from none to xhigh).
Careful: auto-approve
The most important thing to know. The reference says that when launched with a task argument, Cline works in act mode with auto-approve enabled by default. That means file edits and commands run without questions. The behavior is controlled by the --auto-approve <true|false> flag:
cline --auto-approve false "update the dependencies and run the tests"For autonomous runs the documentation recommends a clean branch and a review of the result. In ACP mode (when Cline is embedded in an editor) the default is the opposite: nothing is approved automatically. The CLI has no allow or deny list for commands; to block commands the documentation suggests a PreToolUse hook.
A practical safety minimum: run the agent on a separate git branch, use a separate key with a limit for CI, and in interactive work use -p until you have reviewed the plan.
Cline CLI in CI and scripts
Headless mode suits automation: reviewing a diff on a pull request, analyzing why tests fail, generating a change summary. Cline's documentation has GitHub Actions examples. A general scheme looks like this:
git diff origin/main...HEAD | cline --auto-approve false --timeout 600 \
"check the changes for bugs and list what you find"Here --timeout 600 limits the task to ten minutes. Choosing a model for such routine work is a question of price. Prices as of October 18, 2026: deepseek-v4.1-flash costs $0.013 per 1M input tokens and $0.038 per 1M output, claude-sonnet-5-5 costs $0.4 and $2. Suppose a review receives 40,000 diff tokens and returns 3,000 tokens:
deepseek-v4.1-flash: 0.04 × 0.013 + 0.003 × 0.038 = 0.00052 + 0.000114 ≈ $0.0006;claude-sonnet-5-5: 0.04 × 0.4 + 0.003 × 2 = 0.016 + 0.006 = $0.022.
The price gap is obvious, but review quality depends on the task: judge by strength index (39 for deepseek-v4.1-flash, 48 for claude-sonnet-5-5) and test on your own diffs. The current price list: GET https://api.zukko.pro/v1/models or the Models page in the dashboard. Agents with a long context benefit from caching, but when Claude is called through the OpenAI format there is no cache discount: all input is billed at the input price. More on the calculation is in the article on the cost of an agent session.
Cline inside an editor via ACP
The same cline --acp runs Cline as an agent for editors that support the ACP protocol: Zed, JetBrains AI Assistant, Neovim, Emacs. The editor launches the command itself and talks to the agent over stdio. Credentials saved through cline auth are picked up automatically. It is a way to get Cline without a separate extension.
Diagnostics
cline doctordiagnoses the configuration,cline doctor logopens the log;- a 401 from the gateway means a wrong key or the wrong Base URL;
- 402 means insufficient balance, top up from $1;
- 403
model_not_allowed_for_keymeans the model is not on the key's list; - 404
model_not_foundmeans a typo in the model id.
Create a separate key for the CLI with a daily limit: that way a looping task runs into a ceiling. The balance is topped up via SBP (the payment page adds an 8.5% fee), a MasterCard card or cryptocurrency.
FAQ
How is Cline CLI different from the VS Code extension?
It is the same agent but in the terminal: no editor interface, and it can work in scripts and CI. The configuration (~/.cline/) is shared.
Does Cline CLI need an editor?
No. You need Node.js, the cline package and a configured provider.
How do I avoid unwanted edits in an autonomous run?
Pass --auto-approve false, run the task in -p mode, or work on a separate git branch and review the diff.
Which model should I choose for the CLI?
A cheap one for routine work and a stronger one for complex tasks. Compare by price, context and strength index and test on your own tasks.
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- An AI agent for job hunting: a résumé tailored to the job and cover lettersWe build a small tool: you give a vacancy text and a file with your real experience, and get a tailored résumé, a letter and a list of gaps. No invented skills.
- Skills in Codex: what they are and how to write your ownA Codex skill is a folder with SKILL.md that the agent loads by description or on your call. Structure, a pytest example, and how it differs from plugins and hooks.
- Vibe coding for Bitrix24: apps and handlers built with an agentHow to hand an agent a Bitrix24 app or handler without getting invented methods: project rules, webhooks, pagination, tests and a session cost.
- MCP in Open WebUI: giving models access to external toolsOpen WebUI can connect MCP servers and hand their tools to models. We cover step-by-step setup, the limits, and what it does to token usage when you work through a gateway.