Quickstart
Copy page
Continue CLI (
cn) is a terminal-based coding agent. It can edit files, run commands, and work through multi-step tasks -- the same agent that powers the Continue IDE extensions, running in your terminal.
curl -fsSL https://raw.githubusercontent.com/continuedev/continue/main/extensions/cli/scripts/install.sh | bash
Verify the installation:
cn --version
- Node.js 20+ -- needed for the npm install path. The shell installer bundles its own runtime.
- A Continue account, or an Anthropic API key.
cd your-project
cn
On first launch you'll be asked to log in with
Continue or enter an Anthropic API key. After that, you're in a session and can start typing.
cn login
This opens your browser to authenticate with
Continue . Once authenticated,
cn can use your configured assistants, models, and MCP servers from the platform.
For automation environments where there's no browser, set the
CONTINUE_API_KEY environment variable:
export CONTINUE_API_KEY=your-key-here
cn -p "your prompt"
If you don't want to use Continue, you can use an Anthropic API key directly. On first launch,
cn will prompt you to choose between logging in with Continue or entering an Anthropic API key.
TUI mode -- run
cn to start an interactive session. You type messages, reference files with
@, approve tool calls, and iterate with the agent. This is the default.
Headless mode -- run
cn -p "your prompt" for single-shot automation. The agent runs to completion and prints its response to stdout. Use this in scripts, CI/CD, and git hooks.
| Flag | Effect |
-p "prompt" | Headless mode -- run prompt and exit |
--config <path or slug> | Use a specific config file or assistant |
--resume | Resume the most recent session |
--auto | Allow all tools without prompting |
--readonly | Plan mode -- read-only tools only |
--allow <tool> | Allow a specific tool (repeatable) |
--exclude <tool> | Exclude a specific tool (repeatable) |
--rule <rule> | Add a rule -- file path or string (repeatable) |
--mcp <slug> | Add an MCP server by slug (repeatable) |
--model <slug> | Add a model by slug (repeatable) |
--agent <slug> | Load an agent file by slug |
--verbose | Enable verbose logging |
Run
cn --help for the full list.
Troubleshooting TUI Mode