1
8,839
近 7 天 2k
46.7
生态多维模型
1 天前
2026-09-12
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@brainervirus/opencode-commandcode@0.7.62"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@brainervirus/opencode-commandcode@0.7.62"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D @brainervirus/opencode-commandcodeOpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
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 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.
Credits
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.
What this package adds
- Bundled
models.jsonis the default runtime catalog (no local CLI scrape). - CLI cost extraction can fail (as on
command-code@1.38.x) without dropping models. - Official docs fill missing costs; remaining paid gaps use models.dev as a reference. Command Code free SKUs stay
$0. - Vision vs text-only comes from the Command Code CLI catalog (
inputModalitieson every SKU). models.dev only adds extra inputs (video/audio/pdf) when it matches. - Reasoning effort variants on models that declare
reasoningEfforts. - Quiet OpenCode startup (diagnostics go to
startup.json, not stdout).
Quick Start
1. Install the plugin
{
"plugin": ["@brainervirus/opencode-commandcode@latest"]
}
Pin a version instead of @latest if you do not want automatic catalog patches.
file:// checkouts are not updated by npm; git pull after CI commits, or switch to the npm plugin line.
2. Provider transport (Command Code Provider API)
This plugin supplies model metadata. Point OpenCode at Command Code's documented Provider API:
{
"plugin": ["@brainervirus/opencode-commandcode@latest"],
"provider": {
"commandcode": {
"npm": "@ai-sdk/openai-compatible",
"name": "Command Code GOAT",
"env": ["COMMANDCODE_API_KEY"],
"options": {
"baseURL": "https://api.commandcode.ai/provider/v1"
}
}
}
}
3. Connect
Run /connect in opencode, search for Command Code, and enter your API key, or set COMMANDCODE_API_KEY.
4. Select a model
/models
Optional local CLI override
Maintainers only. OpenCode will scrape a local command-code install when COMMANDCODE_PACKAGE_PATH or commandCodePackagePath in ~/.config/opencode/opencode-commandcode.json is set.
Development
git clone https://github.com/BrainerVirus/opencode-commandcode.git
cd opencode-commandcode
bun install
bun run check # oxlint + oxfmt + bun test + tsc (same stack as workit)
bun run sync -- --remote # refresh models.json + manifest.json from command-code@latest
CI (.github/workflows/catalog-sync.yml) opens a PR every 6 hours when Command Code ships a new catalog. That PR, and the post-release chore/manifest-sync-v* PR, auto-merge after check (test), check (typecheck), check (lint), check (format), and check (pack) are green. .github/workflows/release.yml then runs semantic-release (npm publish + GitHub Release + tag). Do not push to main.
The GitHub Actions secret name is NPMJS (same as workit). 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 (or CATALOG_PUSH_TOKEN) is a PAT; GITHUB_TOKEN can open the PR but GitHub will not start workflows from that event.
License
MIT — see LICENSE. Original copyright Brent Weatherall.
同类生态推荐
Commandcode
@herouucn/opencode-commandcode
Inject Command Code API provider into opencode — access Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM, MiniMax & Step via unified Command Code API. / 将 Command Code API provider 注入 opencode —— 通过统一的 Command Code API 使用 Claude、GPT、Gemini、DeepSeek、Qwen、Kim
Thinking Fix
opencode-thinking-fix
Restores reasoning content dropped from multi-turn OpenCode conversations (DeepSeek, Kimi, GLM, MiMo, MiniMax, OpenCode Go, OpenRouter). Plugin + proxy + watchdog.
Commandcode Go Opencode Provider
commandcode-go-opencode-provider
Command Code API provider for opencode — use Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM, MiniMax, and Step models via Command Code