Skip to content
    ↑↓ select↵ openesc close
    rashidrazak

    Cmd Provider

    opencode-cmd-provider·v2.2.1·Tools & Commands

    Command Code provider + plugin for opencode

    GitHub stars

    112

    +57 in 30 days

    Monthly installs

    6,508

    1.4k in 7 days

    Composite score

    69.8

    Multi-signal model

    Last commit

    22 hours ago

    2026-10-04

    Install and configure

    opencode.json

    Writes 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"]
    }

    OpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.

    CI npm

    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

    Not sure which OpenCode version you have? Run:

    opencode --version
    

    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 localhost callback, 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

    1. Pick a model: run /models and choose any entry starting with [CMD], for example [CMD] Claude Sonnet 5.
    2. 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/now rates
    • 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 $0 because 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

    Credits

    Inspired by pi-commandcode-provider.

    License

    MIT

    Similar plugins