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:
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

Expected output:

Authenticate

Run the authentication wizard to configure your AI provider:
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:
Auth flags:
The flag-based setup is ideal for CI/CD environments, automated machine provisioning, or configuring multiple machines with the same provider.

Supported providers

Verify your setup

Confirm everything is working end-to-end:
If Cline responds, your installation and authentication are complete. To inspect your current configuration:

Quick start

Choose how you want to work: Interactive mode — open the TUI for hands-on development:
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:

Updating

Update to the latest version:
Or update via npm directly:

Troubleshooting

The npm global binary directory may not be in your PATH.
  1. Find the global bin path:
  2. Add it to your shell configuration (.bashrc, .zshrc, etc.):
  3. Reload your shell:
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:
To also remove configuration and task history:

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.