Continue CLI (cn) Cheatsheet - Terminal Open-source Coding Agent
Continue CLI's distinguishing feature is not the terminal interface itself but that it shares one agent engine and one configuration with Continue's VS Code and JetBrains extensions: the model you chose, the rules you wrote and the MCP servers you attached all apply in the terminal, so moving to the command line does not mean configuring everything a second time. Whether to adopt it therefore depends on whether your day actually moves between IDE and terminal - if both need assistance, being same-source is worth far more than the cost of yet another standalone agent. Three things need doing once authentication is settled, which comes first because headless environments need an environment variable rather than an interactive login; second, context should be named explicitly rather than by scanning, since pointing at exact files is both faster and more accurate than walking a whole directory; third, separate generating a plan from changing your files. This sheet covers installation and auth, the TUI, headless mode, and threads and configuration.
Install & Auth 5
curl -fsSL https://raw.githubusercontent.com/continuedev/continue/main/extensions/cli/scripts/install.sh | bashcn --versioncn logincn logoutexport CONTINUE_API_KEY=...Interactive (TUI) 5
cn@src/auth/middleware.ts why does it reject valid tokens/clear/compact/whoamiHeadless (scripts/CI) 5
cn -p "add tests for the auth module"cn -p "..." --autocn -p "..." --readonlycn -p "..." --config ./my-config.yamlcn -p "..." --verboseThreads & Config 5
cn --resume/resumecn --model <slug>cn --mcp <slug>cn --agent <slug>Tips 5
cn TUI shares the agent with IDE pluginsCI: -p + CONTINUE_API_KEY@-reference feeds precise context--readonly to plan first--rule injects rulesTips
- 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 withCONTINUE_API_KEYto automate in browser-less envs.@file/dirfeeds precise context — more accurate and cheaper than a full-project scan; use--readonlyto plan before big changes.--rulerepeatedly injects constraints (e.g. "use TypeScript strict mode");--mcp/--agentattach external capabilities and custom agents.
FAQ
How do I run cn in CI?
Use -p for a single run that prints and exits, with CONTINUE_API_KEY for headless authentication so it does not depend on a local login. Before a large change, run once with --readonly to get a plan and confirm the approach before letting it write. Add --auto only when you genuinely want unattended approval of every tool call.
Is @-referencing files better than letting it scan the project?
Yes. @src/auth/middleware.ts feeds exactly that file into context — precise and cheap in tokens — whereas a full-project scan is slow, pulls in a lot of irrelevant content, and can lead it to advise based on code that has nothing to do with the task. When cross-file understanding is needed, reference the few key entry files rather than the whole directory.
Can cn share configuration with the Continue IDE plugins?
Yes. They share the same agent engine, so model selection, MCP servers and assistant configuration carry over. Habits built up in the TUI continue to work in the IDE, which keeps switching cost low. For the same reason, a configuration you have validated locally can be committed to a config file that both sides read, preventing the two from drifting apart.
How do I attach MCP servers and custom agents in Continue?
cn --mcp <slug> mounts an MCP server so the agent can call external tools, and cn --agent <slug> loads a custom agent file with predefined prompts and flow. These configurations are shared with the Continue IDE plugins, so setting them up once serves both. Before CI, verify with readonly mode and only then allow unattended approval.
How do I inject a rule repeatedly inside cn?
Use the --rule flag, for example cn --rule "use TypeScript strict mode", which injects the constraint so it stays in effect across turns instead of being repeated in every prompt. Compared with a system prompt, rules are finer-grained and suit checkable requirements such as language choice or code style.
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