Skip to main content
This guide walks through installing Cline CLI, verifying the installation, and authenticating with an AI provider.

Prerequisites

Cline CLI requires Node.js 20 or higher. Node.js 22 is recommended. Check your current version:
node --version
If you need to install or upgrade Node.js, download it from nodejs.org or use a version manager like nvm or fnm.

Install Cline CLI

Verify the installation

cline version
Expected output:
Cline CLI version: 2.11.0

Authenticate

Run the authentication wizard to configure your AI provider:
cline auth
The wizard presents several options. Choose the one that matches your setup. 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:
# Anthropic (Claude)
cline auth -p anthropic -k sk-ant-api-xxxxx -m claude-sonnet-4-5-20250929

# OpenAI
cline auth -p openai-native -k sk-xxxxx -m gpt-4o

# OpenRouter
cline auth -p openrouter -k sk-or-xxxxx -m anthropic/claude-sonnet-4-5-20250929

# Moonshot (Kimi)
cline auth -p moonshot -k sk-xxxxx -m kimi-k2.5

# OpenAI-compatible provider with custom base URL
cline auth -p openai -k your-api-key -b https://api.example.com/v1
Auth flags:
FlagDescription
-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
The flag-based setup is ideal for CI/CD environments, automated machine provisioning, or configuring multiple machines with the same provider.

Supported providers

ProviderProvider IDNotes
AnthropicanthropicDirect Claude API access
OpenAIopenai-nativeGPT-4o, GPT-4, and others
OpenAI Codexopenai-codexChatGPT subscription via OAuth
OpenRouteropenrouterAccess multiple providers through one key
AWS BedrockbedrockClaude via AWS; requires AWS credentials
Google GeminigeminiGemini Pro and others
X AI (Grok)xaiGrok models
CerebrascerebrasFast inference
DeepSeekdeepseekDeepSeek models
MoonshotmoonshotKimi models
OllamaollamaLocal models
LM StudiolmstudioLocal models
OpenAI-compatibleopenaiAny OpenAI-compatible API

Verify your setup

Confirm everything is working end-to-end:
cline "What is 2 + 2?"
If Cline responds, your installation and authentication are complete. To inspect your current configuration:
cline config

Quick start

Choose how you want to work: Interactive mode — open the TUI for hands-on development:
cline
Type your task and press Enter. Use 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:
cline -y "Add error handling to utils.js"

Updating

Update to the latest version:
cline update
Or update via npm directly:
npm update -g cline

Troubleshooting

The npm global binary directory may not be in your PATH.
  1. Find the global bin path:
    npm bin -g
    
  2. Add it to your shell configuration (.bashrc, .zshrc, etc.):
    export PATH="$PATH:$(npm bin -g)"
    
  3. Reload your shell:
    source ~/.zshrc  # or ~/.bashrc
    
Using a version manager like nvm, fnm, or Volta avoids this issue entirely — they manage PATH automatically.
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.
  1. Copy the URL printed in the terminal.
  2. Paste it into your browser manually.
  3. Complete the sign-in flow.
  4. Return to the terminal — it will detect the completed auth automatically.
  1. Verify the key is correct and hasn’t been revoked.
  2. Confirm you selected the right provider ID.
  3. Check that your API account has the required permissions or credits.
Provider-specific notes:
  • 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:
npm uninstall -g cline
To also remove configuration and task history:
rm -rf ~/.cline

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.