opencommand-plugin
v0.0.5
Published
OpenCommand - CommandCode API Plugin for OpenCode
Maintainers
Readme
OpenCommand Plugin
OpenCode plugin for CommandCode. It starts the local OpenCommand proxy, stores CommandCode auth locally, registers the opencommand provider, and loads the right model list for the active CommandCode plan.
Features
- Starts/stops the Go proxy automatically.
- Uses a dynamic local port and exposes
http://localhost:<port>/v1to OpenCode. - Stores the CommandCode API token locally in
~/.opencommand/opencommand-secrets.json. - Supports
COMMAND_CODE_TOKENandCOMMANDCODE_API_KEYenvironment overrides. - Attempts local browser cookie discovery for CommandCode Studio usage scraping.
- Registers OpenCode provider
opencommandusing@ai-sdk/openai-compatible. - Detects the active CommandCode plan and registers the matching OpenCode model list.
Auth
Primary token key:
{
"opencommand.command_code_token": "user_xxx..."
}Do not put this token in synced opencode.jsonc.
Models in v0.0.4
The proxy detects the active CommandCode subscription through /alpha/billing/subscriptions and filters models:
- Go: open-source models only.
- Pro: open-source + premium, excluding Opus.
- Max / Ultra / Teams Pro: open-source + premium including Opus.
If detection fails, the plugin falls back to the local proxy model endpoint and then to the Go/open-source model list.
Build
npm ci
npm run buildTest
npm test -- --runInBandv0.0.5 OpenCode loading fix
[email protected] publishes an explicit ESM wrapper at bin/opencode-plugin.js and should be pinned in opencode.jsonc as [email protected] (or newer). This avoids stale @latest cache entries and ensures OpenCode sees the plugin default export as a function.
