CJYLZS/dsh-commandcode-provider2

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).

包名
dsh-commandcode-provider
版本
0.1.3
最近更新
2026年9月4日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:CJYLZS/dsh-commandcode-provider

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

FieldDefaultDescription
sourceURLhttps://api.commandcode.ai/provider/v1/modelsOfficial live model list
catalogURLhttps://commandcode.ai/docs/plans/goatOfficial GOAT plan page (capability catalog); falls back to the plain list when it fails
plangoatSubscription tier: goat / pro / max
targetApiKeyEnvCOMMANDCODE_API_KEYCredential environment variable name
targetBaseURLhttps://api.commandcode.ai/provider/v1API 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)
autoSyncfalsePeriodic auto-sync (off by default; enable in the card)
autoSyncIntervalMs6hAuto-sync interval (min 60s)
webSearchfalseServe dsh's web_search with Command Code (/alpha/web-search)
usageBaseURLhttps://api.commandcode.aiAPI 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 的模型页配置:

  1. 进入 dsh 的 设置 → 模型(该页列出所有供应商,包括本插件自动创建的)。
  2. 找到 commandcode-goat-autosync(或你档位对应的供应商),点击 编辑
  3. 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 计划按量付费)。

配置项

字段默认值说明
sourceURLhttps://api.commandcode.ai/provider/v1/models官方实时模型列表
catalogURLhttps://commandcode.ai/docs/plans/goat官方 GOAT 计划页(能力目录);抓取失败时降级为纯列表
plangoat订阅档位:goat / pro / max
targetApiKeyEnvCOMMANDCODE_API_KEY凭据环境变量名
targetBaseURLhttps://api.commandcode.ai/provider/v1API 基地址
targetCompat{thinkingFormat: "openai", supportsReasoningEffort: true}openai 路由的 compat 覆盖
extraIds[]额外写入的私有模型 id(目录之外,进 openai 路由供应商)
autoSyncfalse定时自动同步(默认关闭,需在卡片里手动开启)
autoSyncIntervalMs6h自动同步间隔(最小 60s)
webSearchfalse用 CommandCode 提供 dsh 的 web_search/alpha/web-search
usageBaseURLhttps://api.commandcode.ai用量/搜索端点所在 API 根路径(/alpha/*

目标供应商名由 plan 推导(commandcode- -autosync / commandcode- -anthropic),不需要单独配置。