npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@npv12/opencode-cmd-provider

v2.0.1

Published

Command Code provider plugin for OpenCode V2

Downloads

107

Readme

opencode-cmd-provider

CI npm

A provider and plugin for OpenCode that connects to the Command Code Provider API. This enables you to use ALL Command Code plans — Go, GOAT, Pro, Max 10×, Max 20×, Provider, Team, and Enterprise — with OpenCode.

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 API key or subscription. Command Code's terms, availability, and pricing apply.

Install

opencode plugin @npv12/opencode-cmd-provider

Update an existing install:

opencode plugin @npv12/opencode-cmd-provider --force

Install globally (available in every project):

opencode plugin @npv12/opencode-cmd-provider --global

Manual config also works:

// opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@npv12/opencode-cmd-provider"],
}

Then authenticate:

/connect

Select Command Code, paste your API key, and pick a model with /models.

Authentication

Browser login

Run /connect in OpenCode and select Command Code. Paste your API key when prompted.

Environment variable

export COMMANDCODE_API_KEY="user_..."

Usage

Pick a model with /models, or run non-interactively:

opencode run --model commandcode/claude-sonnet-5 "hello"

Model discovery and offline behavior

The plugin ships a bundled catalog and auto-registers every model into OpenCode's config at startup using the plain catalog name (e.g. Claude Sonnet 5). Model availability changes when the package is updated. You can still declare your own provider.commandcode entry; your declarations always win and the snapshot fills in only what's missing (whitelist/ blacklist on a declared entry filter the auto-registered models too).

  • Snapshot — src/catalog/snapshot.ts (model ids, names, context lengths) plus src/catalog/facts.ts (reasoning efforts, per-1M-token rates, input modalities). Regenerated from the live catalog via npm run refresh:snapshot.

Run npm run refresh to regenerate the snapshot (offline from fixtures).

Auto-registration adds no network latency to OpenCode startup — the snapshot is bundled, and the plugin never contacts the Command Code API to list models. The plugin works fully offline; model availability never depends on the catalog endpoint being reachable.

The following environment variables are intended for tests, local mocks, and compatible API endpoints:

| Variable | Purpose | | ---------------------------- | -------------------------------------- | | COMMANDCODE_API_BASE | Override the Command Code API base URL | | COMMANDCODE_FACTS_URL | Override the bundled models.md URL | | COMMANDCODE_MODALITIES_URL | Override the CLI bundle URL |

Reasoning support

Reasoning metadata is enriched only for models whose Command Code effort support is known. Supported levels are sent as the documented reasoning_effort request field; off, unsupported levels, and newly discovered models without metadata do not add reasoning fields to the request. No prompt instructions are injected.

Reasoning blocks from completed assistant turns are not replayed to Command Code in later requests; only the user-visible text and completed tool calls are sent back as history. This prevents prior private reasoning traces from interfering with reasoning on follow-up turns.

Image input

Image input is advertised only for models marked with the image input modality in the Command Code CLI bundle. The release-time refresh generates this map into src/catalog/facts.ts; unknown models default to text-only until their upstream metadata is reviewed.

For vision-capable models, image blocks from user messages and tool results are forwarded in Command Code's data-URL wire format. Text-only models reject image content before making a network request instead of silently dropping it.

Pricing display

The Command Code Provider API does not currently include prices in its model catalog. This provider generates a table from the bundled models.md catalog so OpenCode can display estimated request costs.

Models missing from that table display zero cost in OpenCode. This does not mean Command Code will bill the request at zero. Check the current Command Code pricing before relying on the displayed value.

Update and remove

Update the installed package, or remove it from the plugin array in your opencode.json (the auto-registered provider.commandcode entry is injected by the plugin, so there is no config block to remove). The npm package is cached under OpenCode's plugin cache (~/.cache/opencode/packages/); remove the cached directory to fully uninstall.

Development

Build, then run the full suite:

npm install
npm run build
npm test
npm run format:check

The headless end-to-end test runs the real OpenCode CLI against a mock Command Code server through the built package:

npm run build && npm run test:e2e

See CONTRIBUTING.md for local setup and tests. See RELEASE.md for the release process.

Credits

Inspired by pi-commandcode-provider.

License

MIT