The Concentrate CLI (
cn) is in beta. It works on macOS and Linux. Report anything that doesn’t work to support@concentrate.ai.cn starts your coding tools through Concentrate. It sets up each tool’s provider, models, and prices for you, so you can switch models without editing config files. The source is on GitHub.
Reasons to Use the Concentrate CLI
Reasons to Use the Concentrate CLI
- One command per tool —
cn claude,cn codex,cn opencode, andcn pistart each tool on Concentrate. - Your settings stay yours — Launching through
cndoesn’t change the tool’s own settings or subscription login. - Live model catalog — New models appear without updating
cn. - Prices and caching set up for you — OpenCode and pi show cost estimates from Concentrate’s prices, and Claude models use prompt caching.
- Usage analytics — Review requests, models, tokens, and costs in your dashboard.
Supported tools
Quick Start
View prerequisites (before you begin)
View prerequisites (before you begin)
- macOS or Linux
- Node.js 18.18 or newer
- A Concentrate API key from concentrate.ai/api-keys, with credits on the account
- The coding tools you want to use, installed and on your
PATH
1
Install the CLI
cn in ~/.local/bin. If that folder isn’t on your PATH, the installer prints the line to add to your shell profile. Open a new terminal afterward.2
Save your API key
cn to open the launcher, which asks for your key the first time. If CONCENTRATE_API_KEY is set in your environment, cn <tool> can use it without a saved key.3
Check your setup
cn doctor lists your installed tools and confirms your key. Run cn doctor <tool>, such as cn doctor pi, to send a live test request through that tool’s route.4
Start a tool
claude with codex, opencode, or pi. Add --model <id> to pick a model for this session, and put the tool’s own arguments after --:cn use your Concentrate API key and are billed at API rates. Subscription logins you already have in these tools stay saved and aren’t used while you run through cn.
Costs shown inside a coding tool are estimates. Your dashboard always shows what you’re actually billed.
Choose Models
cn lists each model once and Concentrate picks the provider.
cn <tool> within an hour. You don’t need to update cn to use them.
Use a Tool’s Normal Command
cn configure saves Concentrate in the tool’s own settings, so you can run claude, codex, opencode, or pi directly:
cn setup or cn key; a key set only in CONCENTRATE_API_KEY isn’t enough. Restart the tool afterward. To switch back, run cn reset <tool>. It restores your earlier settings and keeps changes you made since.
- Codex, OpenCode, and pi keep a copy of your key in their own settings, readable only by you. Claude Code gets the key from
cnwhen it starts. - Configured tools keep a copy of the model list. Run
cn refreshto add new models and prices.
Resume a Conversation
Run the resume command from the project folder where the conversation started:--model <id> to use another one, and choose a model whose context window fits the conversation.
You can also resume a conversation after reaching a subscription’s usage limit. New requests then go through Concentrate at API rates, and your subscription login stays saved.
Keep cn Up to Date
cn checks for a new version once a day and offers it the next time you start cn. You can also update at any time:
cn also refreshes the tools you configured. Set CN_NO_UPDATE_CHECK=1 to turn off the update prompt.
Tool Notes
Claude Code
Claude Code
- Use Claude models or any other model in the Concentrate catalog.
- Auto mode safety checks: with Claude models, the checks that review actions in auto mode are free. With other models, those checks run on the model you’re using and are charged at that model’s price. Set
CLAUDE_CODE_AUTO_MODE_MODELto use a different model for them. - Context window, output limits, and reasoning effort follow the model you pick, including when you switch models in a session. This needs Claude Code 2.1.287 or newer.
cn claudedoesn’t change your regular Claude Code settings, even if you switch models inside the session.- Claude.ai connectors belong to a subscription login, so they’re off while you run through
cn. - Claude Code estimates cost from its own price list, so
/costcan be wrong for non-Claude models. Your dashboard shows the actual charges.
Codex
Codex
- Codex works with OpenAI models for now. Pick one with
cn model codex. cndoesn’t change your Codex login or default model. Runcodexfor your ChatGPT subscription andcn codexfor Concentrate.- The first time you run
cn codex, it offers to set up plaincodex resumeso it can reopen conversations started throughcn. This adds only the Concentrate provider. Undo it withcn reset codex. cn codexstarts Codex without its shared background server, so closed conversations don’t show up as open elsewhere.
OpenCode and pi
OpenCode and pi
- Both tools show cost estimates based on Concentrate’s prices. They’re estimates: a model can be offered by several providers at different prices, so a session’s estimate can differ from what you’re billed. Your dashboard always shows the actual charges.
cn pikeeps your pi extensions, skills, and MCP configuration.cn piandcn configure pineed pi 0.77 or newer. Check withpi --versionand update withpi update self.
Cursor (work in progress)
Cursor (work in progress)
- Quit Cursor completely before running
cn configure cursororcn reset cursor, and open it once beforehand so its settings exist. - This sets up the Cursor desktop editor, not the Cursor command-line tool. Tab completions keep using Cursor’s own models.
- Cursor stores your key and sends requests through Cursor’s servers before they reach Concentrate.
- Setup needs
sqlite3, which is included with macOS.
Your Key and Privacy
cnstores your key in~/.config/concentrate-cli/, readable only by your user. SetCN_CONFIG_HOMEto use another folder.- The key is never passed on the command line, where other programs could read it.
cn keyreplaces the saved key and updates the copies in configured tools.cn logoutremoves the key and those copies.
Command Reference
Run
cn --help for every option.
Remove the CLI
Runcn reset <tool> for each tool you configured, then clear what cn saved and delete it:
cn reset --yes keeps saved pi conversations. Add --sessions to remove them too.
Troubleshooting
cn: command not found
cn: command not found
Add
~/.local/bin to your PATH using the line the installer printed, then open a new terminal.Node.js 18.18+ is required
Node.js 18.18+ is required
Install a current Node.js release, then run the installer again.
No API key found, or the key is rejected (401)
No API key found, or the key is rejected (401)
Run
cn setup to save a key, or cn key to replace one. Check that it matches a key at concentrate.ai/api-keys. A 402 response means the account needs credits.New models are missing in a configured tool
New models are missing in a configured tool
Tools set up with
cn configure keep a copy of the model list. Run cn refresh. cn <tool> always uses the current list.cn needs pi 0.77 or newer
cn needs pi 0.77 or newer
Run
pi update self, then start cn pi again.Codex is limited to OpenAI models
Codex is limited to OpenAI models
Pick a
gpt-* model with cn model codex.Something else is wrong
Something else is wrong
Run
cn --version and cn doctor, then email the output to support@concentrate.ai.Next Steps
Available Models
Browse the model catalog.
Prompt Caching
Learn how caching lowers the cost of long sessions.

