← 返回命令列表

Linux command

cline 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start an interactive session

cline

Run a task with a prompt

cline "[fix the login bug]"

Run in fully autonomous mode

cline -y "[refactor auth module]"

Set up authentication

cline auth -p [anthropic] -k [sk-ant-api-xxxxx]

Run in plan mode

cline -p "[add unit tests for auth]"

Pipe context

cat [error.log] | cline -y "[explain these errors]"

说明

cline is an AI coding agent that works in the terminal, supporting multiple AI model providers including OpenAI, Anthropic, Google, AWS Bedrock, Ollama, and any OpenAI-compatible API. It can read and write files, execute terminal commands, and perform multi-step development tasks autonomously. The tool operates in two main modes: interactive mode (default when running in a terminal) and headless mode (activated with -y/--yolo or when piping input/output). Headless mode is designed for automation, CI/CD pipelines, and scripting. Cline began as a VS Code extension and expanded to include a CLI interface, making it accessible from any terminal environment. It uses a model-agnostic architecture, allowing users to choose their preferred AI backend. The --acp flag enables the Agent Client Protocol for integration with editors like JetBrains, Zed, Neovim, and Emacs.

参数

-y, --yolo
Run in fully autonomous mode with no interactive UI. Output streams to stdout.
-a, --act
Run in act mode (execute changes directly).
-p, --plan
Run in plan mode (preview changes before acting).
-m, --model _MODEL_
Specify the model to use.
-i, --images _PATHS_
Attach image files to the prompt.
--json
Stream structured JSON output for programmatic consumption.
--thinking
Enable extended thinking mode.
--timeout _SECONDS_
Set a timeout for the task.
--continue
Continue the most recent task.
--acp
Run as an ACP (Agent Client Protocol) compliant agent for editor integration.
--config _PATH_
Custom configuration directory.
-c, --cwd _PATH_
Set the working directory.
-v, --verbose
Show detailed output.
--help
Display help information.

FAQ

What is the cline command used for?

cline is an AI coding agent that works in the terminal, supporting multiple AI model providers including OpenAI, Anthropic, Google, AWS Bedrock, Ollama, and any OpenAI-compatible API. It can read and write files, execute terminal commands, and perform multi-step development tasks autonomously. The tool operates in two main modes: interactive mode (default when running in a terminal) and headless mode (activated with -y/--yolo or when piping input/output). Headless mode is designed for automation, CI/CD pipelines, and scripting. Cline began as a VS Code extension and expanded to include a CLI interface, making it accessible from any terminal environment. It uses a model-agnostic architecture, allowing users to choose their preferred AI backend. The --acp flag enables the Agent Client Protocol for integration with editors like JetBrains, Zed, Neovim, and Emacs.

How do I run a basic cline example?

Run `cline` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -y, --yolo do in cline?

Run in fully autonomous mode with no interactive UI. Output streams to stdout.