@humaiz/opencode-cmdsync
v0.1.0
Published
OpenCode provider plugin that exposes the current Command Code GOAT model catalog.
Maintainers
Readme
CmdSync
OpenCode provider plugin that exposes the current Command Code GOAT model catalog as a first-class provider without overwriting your existing provider settings.
Results in the OpenCode model picker:
CommandCode GOAT
DeepSeek V4.1 FlashSelected ID remains commandcode/deepseek/deepseek-v4.1-flash.
What it does
- Registers provider
commandcodenamedCommandCode GOAT. - Intersects the live Command Code roster with the official GOAT plan catalog
and exposes models whose
minPlanNameisGoorGOAT, plus any model that is free (a free deal or $0 input/output cost). - Uses Command Code's live roster and GOAT catalog for membership, official display names, context windows, GOAT availability, pricing, and labels.
- Generates picker labels from GOAT metadata:
[FREE]for zero-cost models and[NEW]for seven days after Command Code'slaunchedAtdate. Official(latest)wording is preserved exactly; CmdSync never guesses a latest tag. - Starts from a packaged 50-model GOAT catalog when no local cache exists, so the picker is usable on the first offline launch. Catalog and technical-data refreshes always run in the background; they never delay OpenCode startup. A refreshed catalog takes effect on the next OpenCode restart.
- Uses
models.devas a model-level technical fallback, never as a roster or plan source. Matching provider records are grouped by Command Code model identity; the originating lab record wins when available, otherwise CmdSync uses only consensus values for output limits, modalities, reasoning controls, tool calling, and temperature. Explicit Command Code capability flags still win. The live source is cached and revalidated with ETags; a GOAT-scoped snapshot ships for first-run/offline fallback. - Non-destructive merge: preserves your model
options,variants, and provider headers; never touches other providers. - Writes a bounded, redacted backend log to
~/.cache/opencode/commandcode-goat.logfor startup and refresh diagnostics.
Installation
Add the package to your OpenCode config:
{
"plugin": ["@humaiz/opencode-cmdsync"]
}OpenCode installs npm plugins automatically at startup. Restart OpenCode after installing or after a catalog refresh, since the model list is resolved during startup.
Local development instead of the published package:
{
"plugin": ["file:C:/Dev/Tools/OpenCode-Plugins/CommandCode-ModelsIntegration"]
}Connecting your Command Code API key
The model list loads without a key (it is public). On first use, OpenCode's standard Connect flow asks for the user's own Command Code key. Users add it one of three ways:
Desktop: open the model picker, choose CommandCode GOAT, then Connect. The dialog offers API key (paste) and Browser (opens the Command Code login page and transfers the key automatically).
TUI: run /connect, select CommandCode GOAT, then pick the API key or
browser method.
Headless / CI: set an environment variable instead of connecting:
export COMMAND_CODE_API_KEY=your-keyKeys are stored by OpenCode in ~/.local/share/opencode/auth.json; CmdSync
never writes them to disk or into its catalog cache.
Environment variables
| Variable | Purpose |
| --- | --- |
| COMMANDCODE_API_BASE | Override the provider API base URL |
| COMMANDCODE_MODELS_URL | Override the live roster URL |
| COMMANDCODE_GOAT_URL | Override the GOAT catalog URL |
| COMMANDCODE_MODELS_CACHE | Override the cache path |
| COMMANDCODE_MODELS_DEV_URL | Override the models.dev URL |
| COMMANDCODE_MODELS_DEV_CACHE | Override the models.dev capability cache path |
| COMMAND_CODE_API_KEY / COMMANDCODE_API_KEY | API-key fallback |
| CMD_ZDR=1 / COMMANDCODE_ZDR=1 | Send the zero-data-retention header |
Tests
npm test
npm run snapshot:capabilitiesUnit tests run fully offline against embedded fixtures.
Notes
- v1 does not render a custom picker or patch OpenCode Desktop. Model icons are
not rendered by Desktop today;
assets/commandcode.svgis packaged for future use. - Reasoning variants are only generated from a safely matched effort record.
Toggle-only and token-budget models remain reasoning-capable without an
invented selector; OpenCode renders their native
None/Thinkingcontrol. - An unknown output limit is omitted. CmdSync never substitutes a universal token cap for model-specific data.
- The npm package is a bootstrap only. Every installation refreshes and owns its local catalog cache; publishing a newer package only updates that initial offline baseline for future installations.
