What is the Cline CLI?
Cline CLI is a command-line interface for the Cline AI coding assistant. It brings the same powerful AI capabilities from the VS Code extension directly to your terminal, allowing you to automate coding tasks, debug issues, and build features without leaving the command line. Cline is an autonomous AI agent that can:- Read and write files across your projects
- Execute terminal commands (with your approval)
- Use a headless browser for web testing
- Explore large codebases and understand context
- Handle complex multi-step software development tasks
The CLI shares the same core codebase as the VS Code extension, ensuring feature parity and consistent behavior.
Installation
Prerequisites
- Node.js 20.x or later
- npm, yarn, or pnpm package manager
Install via npm
Install via Homebrew (macOS/Linux)
Verify Installation
Quick Start
1. Authenticate
Before using Cline, you need to configure an API provider and model:2. Run Your First Task
3. View Task History
Modes of Operation
Cline CLI operates in different modes depending on how you invoke it:Interactive Mode
When you runcline without arguments or with stdin as a TTY, it launches an interactive terminal UI where you can:
- Type your tasks and see real-time responses
- Review and approve actions before they execute
- View conversation history and context
- Switch between Plan and Act modes
Plain Text Mode
Activated automatically when:- stdin is piped from another command
- Output is redirected to a file
--jsonor--yoloflags are used
JSON Output Mode
Use--json to get structured output that can be parsed programmatically:
type: “ask” or “say”text: message contentts: Unix timestamp in millisecondsreasoning: optional reasoning textimages: optional list of image URIsfiles: optional list of file paths
Agent Behavior
Cline operates in two primary modes:Act Mode (Default)
Cline actively uses tools to accomplish tasks:- Read and write files
- Execute terminal commands
- Use a headless browser
- Search and analyze codebases
- Install dependencies
- Run tests and debuggers
Plan Mode
Cline gathers information and creates a detailed plan before implementation:- Explores the codebase structure
- Asks clarifying questions
- Presents a strategy for user approval
- Switches to Act Mode when ready
Configuration
Cline stores its data in~/.cline/data/ by default:
Custom Configuration Directory
Override the default location using the--config option or CLINE_DIR environment variable:
Working Directory
By default, Cline operates in your current working directory. You can specify a different directory:Environment Variables
CLINE_DIR
Override the default configuration directory:CLINE_COMMAND_PERMISSIONS
Restrict which shell commands Cline can execute using JSON configuration:allow(array): Glob patterns for allowed commands. If set, only matching commands are permitted.deny(array): Glob patterns for denied commands. Deny rules take precedence over allow rules.allowRedirects(boolean): Whether to allow shell redirects (>,>>,<). Defaults to false.
Next Steps
Commands
Explore all available CLI commands and their usage
Options
Learn about global options and configuration flags
Need help? Run
cline --help to see available commands, or visit our GitHub repository for issues and discussions.