deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
Victor-770/dsh-commandcode-provider
A Command Code LLM provider plugin for DeepSeek Harness (dsh) — supporting all subscription plans (incl. Go & Pro) via Studio API / gateway.专为 DeepSeek Harness (dsh) 打造的 Command Code LLM 接入插件,全面支持包括 Go/Pro 在内的各类订阅方案。
PROJECT TOPICS
PROJECT README
Languages: English | 中文
A custom LLM provider plugin for DeepSeek Harness (dsh) that connects dsh to Command Code — a faithful port of pi-commandcode-provider onto dsh's LLM seam.
Works with every Command Code plan, including the $1/month Go plan. Even the Go plan — the only one without Provider API access — gives you an API key in the Studio; that key authenticates the CLI/agent login. This plugin uses that same key against Command Code's own
/alpha/generateendpoint, not the traditional Provider API protocol, so it works even when a plan has no Provider API access.
Disclaimer: This is an unofficial, community-maintained integration. It is not affiliated with, endorsed by, or supported by Command Code. You need your own Command Code account. Command Code's terms, availability, and pricing apply.
Requires dsh 0.2.0-rc.2 or newer. This release targets the 0.2 LLM and settings seam; on an older dsh the entry will not load. Settings edited on Settings → Models → Command Code → Edit apply live — no dsh restart.
Newbie-friendly: one command to install — the plugin mounts itself, no config files to edit.
dsh plugin --profile web add dsh-commandcode-provider@0.2.0
The package declares dsh.bundle, so dsh plugin add installs it AND automatically joins it to the profile's bundle layers — the shipped cordis.patch.yml mounts the provider row for you.
Do not also add a manual
cordis.patch.ymlrow for this plugin — the bundle patch already mounts it; a second row would double-register the provider.
The provider then appears in the web UI automatically.
Even on the Go plan, Command Code gives you an API key used for authentication:
This key is an authentication key for using Command Code — it is not a "Provider API" key. The plugin speaks Command Code's own
/alpha/generateprotocol with it, so no Provider API access is required, and the Go plan works.
Command: In a dsh chat, run:
/commandcode-setkey
and paste the key when prompted.
That's it — pick a Command Code model from the model picker and start chatting.
This plugin is not a traditional API-protocol provider:
https://api.commandcode.ai/alpha/generate with the same wire protocol the official CLI uses (x-command-code-version, x-cli-environment, x-project-slug, … headers).cmd login writes to ~/.commandcode/auth.json.<dsh home>/commandcode/commandcode-models.json; if that endpoint is unreachable (e.g. a Go plan), the last cached catalog keeps serving.Everything the pi plugin does, on the dsh host plane:
Provider registration — registers the commandcode provider route on ctx.llm with the same /alpha/generate streaming protocol, retry/timeout/abort semantics, and message/tool conversion as the pi plugin (paired tool-call filtering, data-URL image forwarding, legacy schema normalization).
Model discovery with offline cache — fetches the catalog from https://api.commandcode.ai/provider/v1/models and caches it locally (versioned, atomic writes); offline, the last cached catalog keeps serving.
Reasoning metadata — models with known Command Code effort support advertise their thinking levels through the LLM seam; a selected level is sent as params.reasoning_effort.
Image input — models marked image in the catalog accept image blocks (resolved through dsh's durable attachment service); text-only models reject images before any network request.
Authentication — credentials resolve per request through, in order:
ctx.credentials, what the web Models page writes),COMMANDCODE_API_KEY),~/.commandcode/auth.json, ~/.pi/agent/auth.json, ~/.omp/agent/auth.json.No browser OAuth flow — the key is entered in the web UI (Settings → Models → Command Code → Edit) or via /commandcode-setkey.
Commands — /commandcode-refresh (re-fetch + re-register the catalog), /commandcode-status (redacted diagnostics), /commandcode-setkey (store an API key).
Pricing display — the static per-model cost table from the pi plugin (USD per million tokens).
Error hygiene — context-overflow wording is normalized to CONTEXT_WINDOW_EXCEEDED, and every error/diagnostic text is redacted.
The commandcode-provider settings section accepts (all optional):
| Field | Default | Meaning |
|---|---|---|
apiKeyEnv |
COMMANDCODE_API_KEY |
Credential reference resolved per request |
displayName |
Command Code |
Name shown by selectors |
baseURL |
COMMANDCODE_API_BASE env → https://api.commandcode.ai |
API base for /alpha/generate (usually leave at default) |
modelsUrl |
COMMANDCODE_MODELS_URL env → Provider API |
Model discovery endpoint |
modelsTimeoutMs |
COMMANDCODE_MODELS_TIMEOUT_MS env → 10000 |
Discovery timeout |
modelsCachePath |
COMMANDCODE_MODELS_CACHE env → <dsh home>/commandcode/commandcode-models.json |
Catalog cache path |
models |
— | Optional explicit catalog entries; each overrides (or adds to) the discovered model by id |
defaultContextWindow |
262144 |
Context capacity for models neither the catalog nor an override sizes |
defaultMaxTokens |
32768 |
Output capability for models neither the catalog nor an override sizes |
timeoutMs |
— | Per-attempt HTTP request timeout |
streamIdleTimeoutMs |
300000 |
Max idle time while one stream read is outstanding |
retryPolicy |
normal defaults | Provider-owned model-request retry policy |
# $DSH_HOME/settings.yaml
commandcode-provider:
apiKeyEnv: COMMANDCODE_API_KEY # credential reference the Models page writes
ToolCallId, first-class role: 'tool' result messages, JsonObject tool arguments, and the schema-derived settings form that replaced installSettingsSection.Volatile), so the plugin re-reads settings per use and refreshes its provider route, catalog, and Models-page directory entry on loader/volatile-update./commandcode-login, no browser pop-up. The API key is entered directly in Settings → Models → Command Code → Edit (single API key field) or via /commandcode-setkey.pi-commandcode-provider: /alpha/generate streaming, model discovery + cache, reasoning efforts, image input, pricing display.npm install # dev + test dependencies
npm run typecheck # strict tsc against the harness seam packages
npm run build # emit lib/ (ESM + declarations)
npm test # vitest suite (wire protocol, discovery, cost, adapter, plugin entry)
Typecheck and vitest resolve the @deepseek-ai/* seam packages from node_modules, pinned in package.json to the dsh release this plugin targets — the same published API surface the host loads, with no local harness checkout.
MIT
中文文档: README.zh.md
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。