Continue CLI (cn) Cheatsheet - Terminal Open-source Coding Agent
Continue CLI (command `cn`) is an open-source terminal coding agent sharing the engine with the Continue VS Code/JetBrains extensions, for developers who want a consistent AI-coding experience across editors and the terminal and prefer keyboard/script-driven work. Being same-engine means context and config from the plugins apply in the terminal too. This sheet covers install, interactive/headless modes, login, and thread resume.
Install & Auth 5
curl -fsSL https://raw.githubusercontent.com/continuedev/continue/main/extensions/cli/scripts/install.sh | bashInstall cn via official script
cn --versionShow installed version
cn loginBrowser sign-in (assistants/MCP/models)
cn logoutSign out of the session
export CONTINUE_API_KEY=...Headless/CI auth via API key
Interactive (TUI) 5
cnStart an interactive session in the project dir
@src/auth/middleware.ts why does it reject valid tokens@-reference files/dirs as context
/clearClear conversation history
/compactCompact chat to free context
/whoamiShow current signed-in identity
Headless (scripts/CI) 5
cn -p "add tests for the auth module"-p runs once and exits after printing
cn -p "..." --autoAuto-approve all tool calls (no prompt)
cn -p "..." --readonlyRead-only plan mode, no file changes
cn -p "..." --config ./my-config.yamlRun with a specific config file
cn -p "..." --verboseVerbose logging
Threads & Config 5
cn --resumeResume the most recent session
/resumeReopen history from the picker in-session
cn --model <slug>Specify a model at launch
cn --mcp <slug>Attach a named MCP server
cn --agent <slug>Load a named agent file
Tips 5
cn TUI shares the agent with IDE pluginsConfig/habits carry over
CI: -p + CONTINUE_API_KEYHeadless env needs no login state
@-reference feeds precise contextMore accurate/cheaper than full-project scan
--readonly to plan firstPlan before big changes
--rule injects rulescn --rule "use TS strict mode" persists
Tips
- Continue CLI (command `cn`) shares the same agent as the Continue VS Code/JetBrains extensions — reuse your IDE models/MCP/rules in the terminal.
- `cn -p "..."` is headless: it prints and exits, ideal for scripts/CI; pair with `CONTINUE_API_KEY` to automate in browser-less envs.
- `@file/dir` feeds precise context — more accurate and cheaper than a full-project scan; use `--readonly` to plan before big changes.
- `--rule` repeatedly injects constraints (e.g. "use TypeScript strict mode"); `--mcp`/`--agent` attach external capabilities and custom agents.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Aug 23, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us