| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Command Code API provider for opencode. Use Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM, MiniMax, Step, and other models through a single API key.
This plugin is for Command Code accounts with Provider API access. GOAT is the live-tested baseline; other API-enabled plans can use models their account is entitled to. The $1 Go plan has no Provider API access. The catalog follows the provider-wide model list, so a model appearing in OpenCode does not imply that every account can call it. See GOAT plan details and Provider API docs.
This package keeps a bundled model catalog current via CI. You do not need a local command-code CLI. Catalog patches publish automatically after a green PR merges to main.
Previously published as @brainervirus/commandcode-go-opencode-provider. Use this name instead.
This package is based on FanFan4204/opencode-commandcode-provider. That work started from brent-weatherall/opencode-commandcode-provider by Brent Weatherall. Thank you both — FanFan for the OpenCode provider this repo continues, and Brent for the original plugin, catalog extraction.
For published plugin versions, the six-hour CI schedule extracts the latest command-code npm bundle and refreshes callable models plus endpoint metadata, even when the CLI version is unchanged. It opens a catalog PR only when generated artifacts change; at startup the plugin loads those artifacts and registers them with OpenCode — never the other way around.
OpenCode V2:
{
"plugins": ["@brainervirus/opencode-commandcode"]
}OpenCode V1:
{
"plugin": ["@brainervirus/opencode-commandcode"]
}The bare package name is unpinned and resolves npm's latest release when OpenCode installs or updates it; adding @latest is unnecessary. OpenCode V2 checks for updates at startup but keeps an existing cached package. Apply a newer package with OpenCode's plugin-update action, then restart to load it. OpenCode V1 can refresh the global package with opencode plugin @brainervirus/opencode-commandcode --global --force.
file:// checkouts are not updated by npm; git pull after CI commits, or switch to the npm plugin line.
On OpenCode V2 the plugin registers the commandcode provider, its models, the native OpenCode runtime, and its API base URL through the V2 provider API. On V1 the server hook fills provider.commandcode defaults — npm: "@ai-sdk/openai-compatible" plus the Provider API baseURL; the plugin package itself is never the SDK npm field. Only add a manual provider entry if you need non-default transport options.
Set COMMANDCODE_API_KEY, or connect interactively. OpenCode V1 provides Command Code through /connect; OpenCode V2 registers key and environment methods for /connect and opencode auth login commandcode. V2 uses OpenCode's automatic provider activation and preserves an explicit activation setting. Connect before running a model; an explicit run while disconnected still returns an authorization error from the API.
/models
Catalog patches ship in new npm releases. OpenCode loads the version in its package cache; an update must be applied through the host before the new catalog appears. If a new model is missing after an announced sync, check the installed package version, apply the update, and restart OpenCode.
Optional, ~/.config/opencode/opencode-commandcode.json (legacy fallback name commandcode-go-opencode-provider.json still loads). Unknown keys are ignored; every field has a default.
| Key | Default | Effect |
|---|---|---|
| commandCodePackagePath | "" | Maintainer override: extract the catalog from a local command-code checkout instead of the bundle. Same as env COMMANDCODE_PACKAGE_PATH. |
| debugStartupLogs | false | Also mirror the startup summary to stderr. Default is quiet (startup.json only). |
| disableModelSync | false | Accepted for forward compatibility; currently has no effect. |
Maintainers only. OpenCode will scrape a local command-code install when COMMANDCODE_PACKAGE_PATH or commandCodePackagePath in ~/.config/opencode/opencode-commandcode.json is set.
git clone https://github.com/BrainerVirus/opencode-commandcode.git
cd opencode-commandcode
bun install
bun run check # oxlint + oxfmt --check + bun test tests/unit/ + tsc (the release gate)bun run sync -- --remote # refresh models.json + manifest.json + _version.txt from command-code@latest
bun run build # bundle src/entry.ts to dist/plugin.js
bun test tests/unit/ # unit suite (also via bun run test)
bun run test:integration # live-endpoint tests, not part of the gate
bun run verify:release-candidate # dry-run pack; manifest and package versions must match
bun run generate-readme # reports catalog counts only; README is hand-edited
bun run catalog:ci # entry used by the catalog-sync workflowEntry points: plugin.ts owns both config surfaces (V2 id/setup plus V1 server); index.ts re-exports the plugin plus the createCommandCode SDK factory; src/entry.ts is bundle glue for scripts/build-plugin.ts only — it produces dist/plugin.js.
CI (.github/workflows/catalog-sync.yml) checks every 6 hours for CLI catalog changes and provider availability/endpoint metadata changes; it opens a fix(catalog) PR only when generated files change. If extraction fails or the model-count safety floor is breached, it opens a catalog-break issue and leaves the last-good files intact. The PR auto-merges after check (test), check (typecheck), check (lint), check (format), and check (pack) are green. .github/workflows/release.yml then runs semantic-release (build + verified npm publish + GitHub Release + tag). Do not push to main.
The GitHub Actions secret name is NPMJS. It is mapped to both NPM_TOKEN and NODE_AUTH_TOKEN. Use an npm Automation token (bypasses 2FA). A login token from ~/.npmrc fails CI with EOTP. Catalog PRs get a real CI run when RELEASE_SYNC_TOKEN is a PAT; GITHUB_TOKEN can open the PR but GitHub will not start workflows from that event.
MIT — see LICENSE. Original copyright Brent Weatherall.
| Back | FazBrowse Home | New Git URL |