Cmd Provider
Command Code provider + plugin for opencode
112
+57 in 30 days
6,508
1.4k in 7 days
69.8
Multi-signal model
22 hours ago
2026-10-04
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-cmd-provider@2.2.1"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-cmd-provider@2.2.1"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-cmd-providerOpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
Use your Command Code plan inside OpenCode.
This plugin connects OpenCode to Command Code and adds every Command Code model to the model picker, so you can use your Go, GOAT, Pro, Max 10×, Max 20×, Provider, Team, or Enterprise plan from OpenCode. It also adds the Rates & usage panel — a Command Code section in the session sidebar — with your plan's allowances, benchmarks, current deals, and live usage.
Disclaimer: This is an unofficial, community-maintained integration. It is not affiliated with, endorsed by, or supported by Command Code. You need your own Command Code account, and Command Code's terms, availability, and pricing apply.
Before you start
- OpenCode installed — opencode.ai.
- A Command Code account and API key — commandcode.ai.
Not sure which OpenCode version you have? Run:
opencode --version
- Prints
1.18.x(or lower) → follow Install on OpenCode v1. - Prints
2.0.x→ follow Install on OpenCode v2.
Install on OpenCode v1
opencode plugin opencode-cmd-provider
Run it inside the project where you want the plugin, or add --global to make
it available in every project:
opencode plugin opencode-cmd-provider --global
That one command adds the plugin to your OpenCode configuration, registers Command Code and all of its models, and adds the sidebar section. Restart OpenCode when it finishes.
Install on OpenCode v2
OpenCode v2 uses a different command — note the add:
opencode plugin add opencode-cmd-provider
This adds the plugin to your global OpenCode configuration, so it works in every project, registers Command Code and all of its models, and adds the sidebar section. Restart OpenCode when it finishes.
If an install command fails on your machine, you can add the plugin to your configuration by hand — see Installation mechanics in the technical reference.
Connect your Command Code account
OpenCode v1: sign in from the browser
In OpenCode, run:
/connect
Select Command Code in the provider list, then pick how to sign in:
- Command Code — the browser flow. Finish the sign-in in your browser; the key is stored by OpenCode and reused from then on. Take your time: the plugin waits up to five minutes for the browser to hand the key back, so there is no rush picking an organization or approving access.
- Command Code API key — paste the key the Command Code studio shows you.
Use this when the browser cannot reach OpenCode's
localhostcallback, for example when OpenCode runs on a remote host.
OpenCode v2: use your API key
OpenCode v2 has no browser sign-in for Command Code. Set your API key before starting OpenCode:
export COMMANDCODE_API_KEY="user_..."
Or run /connect inside OpenCode and paste the key when asked.
Already signed in with the Command Code CLI?
OpenCode reuses an existing Command Code CLI login automatically, so you may not need to connect at all.
Start using it
- Pick a model: run
/modelsand choose any entry starting with[CMD], for example[CMD] Claude Sonnet 5. - Start chatting. Your Command Code plan handles the requests.
Prefer the command line? Run a single prompt without the interactive interface:
opencode run --model commandcode/claude-sonnet-5 "hello"
What you get
The Rates & usage panel
While a session uses a [CMD] model, the sidebar shows the Rates & usage
panel (titled Command Code) for that model, split into segments:
- tier and status
- an Allowance section listing the Go, GOAT, Pro, Max 10×, Max 20× and Team Pro monthly allowances
- a Rates section with the published rate bands — peak/off-peak for time-of-day pricing (DeepSeek) and context-window tiers (OpenAI, Grok, Qwen) — each band showing input, output, cache-read and cache-write rates per million tokens, plus the peak windows; a model with no published band shows its actual per-million price instead
- an Other Information section with benchmark scores (intelligence,
tokens/second), current deals and
was/nowrates - a Usage section with live 5-hour, weekly and monthly usage plus the current cycle's requests, tokens and spend, read from the account you're connected with and refreshed as you work (never polled)
Every row is always shown: when a model has nothing for a row, its value reads
N/A instead of the row disappearing.
Don't need every segment? Type /cmd-rates-usage in the prompt — or run Show,
hide and reorder sidebar content from the command palette (ctrl+p) —
then: press space to show or hide the selected segment, shift+↑/↓ to move it,
r to restore the default layout. Your choices are remembered per machine.
The blank line between segments is kept, and with every segment hidden the
whole section disappears.
Toggle the sidebar with ctrl+x b. Switch to a model that isn't from Command
Code and the section disappears — there is nothing to show for other providers.
Plan and deal summaries
Ask OpenCode something like "Which Command Code plan am I on?" or "How many
requests does my Command Code plan cover this month?" and it uses the built-in
cmd_plan_summary tool: the plan and account the current credential resolves
to (or the plan you pinned), its allowances and the current deals, turned into
an estimate. If you want to force a plan, add it to the question (for example
plan=pro) — a plan pinned that way is marked (pinned) in the header, so it
never reads as a plan that was detected.
The summary always says where the credential came from — your OpenCode
connection, COMMANDCODE_API_KEY, a legacy Command Code auth file, or the plan
you pinned — and names the account it answered for when the API reports one. So
an answer that came from a different account than the one you signed in with is
visible instead of silent.
Everyday details
- Reasoning models show their effort levels in OpenCode, so you can pick how hard the model should think.
- Vision models accept image input; text-only models will tell you instead of silently ignoring the image.
- Costs shown in OpenCode are estimates from Command Code's published
pricing, and some models show
$0because no price is published for them. Check the current Command Code pricing before relying on the numbers. - Transient failures are retried. A dropped connection or a temporary server error is replayed a couple of times before OpenCode sees a failure, so a blip does not end your turn. Permanent answers — a usage-window limit, a rejected request — come straight back as errors, and a turn that already streamed text is never replayed.
Keep it up to date
A new release only reaches you after OpenCode refreshes its cached copy of the plugin.
OpenCode v2:
opencode plugin update
OpenCode v1: delete the cached copy and restart OpenCode:
rm -rf ~/.cache/opencode/packages/opencode-cmd-provider*
The first start after an update takes a little longer because the plugin is downloaded again. You never need to sign in again.
New Command Code models come with plugin updates, so if a model is missing from
/models, updating is the fix.
Uninstall
OpenCode v2:
opencode plugin remove opencode-cmd-provider
OpenCode v1: remove opencode-cmd-provider from the plugin list in your
opencode.json (and from tui.json if it is listed there).
Then remove the cached copy to free the space:
rm -rf ~/.cache/opencode/packages/opencode-cmd-provider*
The provider and models this plugin registered disappear with it; there is nothing else to clean up.
Troubleshooting
| What you see | What to try |
|---|---|
No [CMD] models in /models |
Check that your API key is set (or that /connect succeeded), restart OpenCode, and update the plugin if your install is old. |
| The sidebar has no Command Code section | Make sure the session uses a [CMD] model, and press ctrl+x b — the sidebar may be hidden. |
| Browser sign-in fails (v1) | Run /connect again and pick Command Code API key to paste one, or set COMMANDCODE_API_KEY and restart OpenCode. |
A model shows $0 cost |
No published price for that model, so the estimate is 0. See Command Code pricing. |
Command Code rejected this plugin as out of date |
Command Code refuses the version your install reports. Update the plugin — see Keep it up to date. |
| Something else | See the technical reference or open an issue. |
Learn more
- Technical reference — how the plugin works, where the
model and deals data comes from, and the decisions behind it. Jump straight to
a section:
- Hosts and entry points — which OpenCode processes load the plugin and what each one registers
- Installation mechanics and caching — where an install lands, how updates work, and why nothing updates by itself
- Model discovery and offline behaviour — bundled model lists, the
[CMD]name prefix, and mixing in your own model entries - Generated catalogs — the model, capability, and deals data files and how they are refreshed
- Rates & usage — the sidebar panel: where allowances, benchmarks, rates, and deals come from, and what happens when they are unavailable
- Reasoning support — how thinking-effort levels reach the model
- Image input — which models accept images
- Claude prompt caching — how repeated Claude turns reuse a cached prefix instead of re-billing it
- Pricing display — why some models show
$0in OpenCode - Environment variables — credentials, plan pinning, and test/mock overrides
- Development and testing — build, test, and end-to-end commands
- Troubleshooting — deeper fixes when the table above is not enough
- Design records — every design decision, one line each
- CHANGELOG.md — what changed in each release.
- CONTRIBUTING.md and RELEASE.md — for contributors and maintainers.
Credits
Inspired by pi-commandcode-provider.
License
MIT
Similar plugins
Commandcode
@brainervirus/opencode-commandcode
Command Code API provider for opencode — use Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM, MiniMax, and Step models via Command Code
Commandcode
@herouucn/opencode-commandcode
Inject Command Code API provider into opencode — access Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM, MiniMax & Step via unified Command Code API. / 将 Command Code API provider 注入 opencode —— 通过统一的 Command Code API 使用 Claude、GPT、Gemini、DeepSeek、Qwen、Kim
Commandcode Provider
@yusuf.ameri/opencode-commandcode-provider
Command Code provider for OpenCode using the official Provider API. Dynamic model discovery, no manual syncs.