Prerequisites
Cline CLI requires Node.js 20 or higher. Node.js 22 is recommended. Check your current version:Install Cline CLI
- npm (recommended)
- From source
Install globally via npm:To install a specific version:
Verify the installation
Authenticate
Run the authentication wizard to configure your AI provider:Option 1: Sign in with Cline (recommended)
Select Sign in with Cline to authenticate via OAuth using your Cline account. Your browser opens automatically to complete the sign-in flow.Option 2: Sign in with ChatGPT subscription
If you have a ChatGPT Plus or Pro subscription, select Sign in with ChatGPT Subscription. This uses OpenAI Codex OAuth to authenticate with your existing subscription — no separate API key needed.Option 3: Import from an existing tool
Cline can import credentials from other AI CLI tools:- Import from Codex CLI — reads from
~/.codex/auth.json - Import from OpenCode — reads from
~/.local/share/opencode/auth.json
Option 4: Bring your own API key
Select Bring your own API key to configure any supported provider manually. You can also skip the wizard entirely and pass flags directly:| Flag | Description |
|---|---|
-p, --provider <id> | Provider ID (e.g., anthropic, openai-native, openrouter) |
-k, --apikey <key> | Your API key |
-m, --modelid <id> | Model ID (e.g., claude-sonnet-4-5-20250929, gpt-4o) |
-b, --baseurl <url> | Base URL for OpenAI-compatible providers |
Supported providers
| Provider | Provider ID | Notes |
|---|---|---|
| Anthropic | anthropic | Direct Claude API access |
| OpenAI | openai-native | GPT-4o, GPT-4, and others |
| OpenAI Codex | openai-codex | ChatGPT subscription via OAuth |
| OpenRouter | openrouter | Access multiple providers through one key |
| AWS Bedrock | bedrock | Claude via AWS; requires AWS credentials |
| Google Gemini | gemini | Gemini Pro and others |
| X AI (Grok) | xai | Grok models |
| Cerebras | cerebras | Fast inference |
| DeepSeek | deepseek | DeepSeek models |
| Moonshot | moonshot | Kimi models |
| Ollama | ollama | Local models |
| LM Studio | lmstudio | Local models |
| OpenAI-compatible | openai | Any OpenAI-compatible API |
Verify your setup
Confirm everything is working end-to-end:Quick start
Choose how you want to work: Interactive mode — open the TUI for hands-on development:Tab to toggle Plan/Act mode, Shift+Tab to enable auto-approve, and /help to see available slash commands.
Headless mode — run a task autonomously:
Updating
Update to the latest version:Troubleshooting
'cline' command not found after installation
'cline' command not found after installation
The npm global binary directory may not be in your
PATH.- Find the global bin path:
- Add it to your shell configuration (
.bashrc,.zshrc, etc.): - Reload your shell:
Permission errors during installation
Permission errors during installation
If you see
EACCES errors when running npm install -g cline, the recommended fix is to use a Node.js version manager (nvm, fnm, or Volta). These install Node into your home directory, eliminating permission problems.Alternatively, follow the npm guide on fixing permission errors.Browser doesn't open during OAuth
Browser doesn't open during OAuth
- Copy the URL printed in the terminal.
- Paste it into your browser manually.
- Complete the sign-in flow.
- Return to the terminal — it will detect the completed auth automatically.
API key rejected
API key rejected
- Verify the key is correct and hasn’t been revoked.
- Confirm you selected the right provider ID.
- Check that your API account has the required permissions or credits.
- Anthropic: keys start with
sk-ant- - OpenAI: keys start with
sk- - AWS Bedrock: requires AWS credentials configured separately — see AWS Bedrock setup
Uninstalling
Remove the CLI binary:Next steps
Interactive mode
Learn keyboard shortcuts, slash commands, and file mentions.
Headless mode
Run Cline autonomously in scripts and CI/CD pipelines.
CLI reference
Complete documentation for all commands and flags.