CJYLZS/dsh-commandcode-provider ↗★ 2
dsh-commandcode-provider
Sync CommandCode plan models (goat/pro/max) from the official models API + GOAT plan catalog into llm-pi-ai providers commandcode-<plan>-autosync (one-click create/update in settings).
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:CJYLZS/dsh-commandcode-provider说明文档
阅读完整 README ↗Usage dashboard (optional)
The settings card also shows account usage — requests, success rate, cost, tokens, credit balances, and the 5-hour/weekly window limits — fetched Host-side from the account endpoints (/alpha/whoami, /alpha/usage/summary, /alpha/billing/credits, /alpha/billing/subscriptions) with the same account key. The key never leaves the host.
What you get at a glance: how many requests you have left in the current five-hour and weekly windows (with progress bars and reset times), how many credits your plan still has this month, and your recent request/success/cost/token totals — so you can see whether a rate-limit or "out of credits" wall is approaching before you hit it, and confirm that a session actually consumed what you expected.
- Each endpoint degrades independently: a transient failure shows a partial-data note instead of blanking the card; when every endpoint fails the same way the card names the cause (invalid key / service unavailable / network).
- The usage endpoints live on the API root (
/alpha/*), which is distinct from the chat base/provider/v1. Use the Usage / search API base field in the card if your deployment differs.
Configuration
| Field | Default | Description |
|---|---|---|
sourceURL | https://api.commandcode.ai/provider/v1/models | Official live model list |
catalogURL | https://commandcode.ai/docs/plans/goat | Official GOAT plan page (capability catalog); falls back to the plain list when it fails |
plan | goat | Subscription tier: goat / pro / max |
targetApiKeyEnv | COMMANDCODE_API_KEY | Credential environment variable name |
targetBaseURL | https://api.commandcode.ai/provider/v1 | API base URL |
targetCompat | {thinkingFormat: "openai", supportsReasoningEffort: true} | compat override for the openai route |
extraIds | [] | Extra private model ids to write (outside the catalog, into the openai-route provider) |
autoSync | false | Periodic auto-sync (off by default; enable in the card) |
autoSyncIntervalMs | 6h | Auto-sync interval (min 60s) |
webSearch | false | Serve dsh's web_search with Command Code (/alpha/web-search) |
usageBaseURL | https://api.commandcode.ai | API root for usage/search endpoints (/alpha/*) |
Target provider names are derived from plan (commandcode- -autosync / commandcode- -anthropic); no separate configuration needed.
API Key 配置
点击「一键创建/更新」后,插件会自动创建对应档位的模型供应商——默认是 commandcode-goat-autosync(其它档位为 commandcode-pro-… / commandcode-max-…)。API key 就配在这个自动创建的供应商上。
推荐方式——在 dsh 的模型页配置:
- 进入 dsh 的 设置 → 模型(该页列出所有供应商,包括本插件自动创建的)。
- 找到
commandcode-goat-autosync(或你档位对应的供应商),点击 编辑。 - 在 API 密钥 输入框粘贴你的 CommandCode API key,点击 保存。
完成。key 会存入 dsh 的凭据库,聊天、web 搜索和用量卡片共用这一把。
备选方式——环境变量: 启动 dsh 前 export COMMANDCODE_API_KEY=cmd_xxx。(插件配置项 targetApiKeyEnv 可修改它读取的变量名。)
Key 从哪来?在 commandcode.ai Studio 的 API keys 页面创建(除 Go 计划外均可用;GOAT/Pro/Max 按套餐额度计费,Provider 计划按量付费)。
配置项
| 字段 | 默认值 | 说明 |
|---|---|---|
sourceURL | https://api.commandcode.ai/provider/v1/models | 官方实时模型列表 |
catalogURL | https://commandcode.ai/docs/plans/goat | 官方 GOAT 计划页(能力目录);抓取失败时降级为纯列表 |
plan | goat | 订阅档位:goat / pro / max |
targetApiKeyEnv | COMMANDCODE_API_KEY | 凭据环境变量名 |
targetBaseURL | https://api.commandcode.ai/provider/v1 | API 基地址 |
targetCompat | {thinkingFormat: "openai", supportsReasoningEffort: true} | openai 路由的 compat 覆盖 |
extraIds | [] | 额外写入的私有模型 id(目录之外,进 openai 路由供应商) |
autoSync | false | 定时自动同步(默认关闭,需在卡片里手动开启) |
autoSyncIntervalMs | 6h | 自动同步间隔(最小 60s) |
webSearch | false | 用 CommandCode 提供 dsh 的 web_search(/alpha/web-search) |
usageBaseURL | https://api.commandcode.ai | 用量/搜索端点所在 API 根路径(/alpha/*) |
目标供应商名由 plan 推导(commandcode- -autosync / commandcode- -anthropic),不需要单独配置。