Skip to content
Back to search

dsh-commandcode-provider

Command Code provider plugin for DeepSeek Harness (dsh). Adds Command Code model access, live model catalog, plan-aware model selection, reasoning effort, image input, web search, and multi-account support.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/Mars-Sea/dsh-commandcode-provider with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/Mars-Sea/dsh-commandcode-provider'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/mars-sea--dsh-commandcode-provider/badge.svg)](/listings/mars-sea--dsh-commandcode-provider)

HTML

<a href="/listings/mars-sea--dsh-commandcode-provider"><img src="/api/listings/mars-sea--dsh-commandcode-provider/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

This release supports **dsh 0.2.1-alpha.1 and nothing else** — the plugin's peer range is that one version, and its compatibility record names it alone:

dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@latest

- **Older dsh releases.** The 0.1.2–0.1.7 line is no longer supported: those engines predate the 0.1.7 settings rewrite, the `RequestMessage` envelope, and the durable image-offload contract, and the compatibility code that bridged the two was removed. The last plugin release covering 0.1.7 is 0.11.17; the 0.1.2–0.1.6 line's last release is 0.11.11; the 0.5.0-era Harness line's last release is 0.9.1. All are installed by exact version and none is maintained:

  dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.17   # dsh 0.1.7
  dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.11   # dsh 0.1.2–0.1.6
  dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.9.1     # dsh 0.5.0 line

**pnpm 11 holds back new releases.** Its `minimumReleaseAge` defaults to 1440 minutes, so a version published less than a day ago is skipped and `@latest` resolves to the *previous* release — silently, with a success exit code. To install a release from the last 24 hours, name it exactly:

dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@0.11.15

The same applies to every profile you install into, including the terminal UI below.

Fresh pnpm 10 marketplace generations are supported directly. Every Harness package — including `@deepseek-ai/cordis` and `@deepseek-ai/schemastery` — is declared by the plugin at an exact version as a Host peer, so the active dsh profile remains their owner; do not add a separate dependency for any of them. Upstream removed the `@deepseek-ai/dsh-invariants` package in `0.2.1-alpha.1`, so the plugin no longer declares it.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 290 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # dsh-commandcode-provider
  2. **English** | [简体中文](./README.zh-CN.md)
  3. [![Awesome](https://awesome.re/badge.svg)](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin)
  4. [![GitHub Repo stars](https://img.shields.io/github/stars/Mars-Sea/dsh-commandcode-provider?style=flat-square)](https://github.com/Mars-Sea/dsh-commandcode-provider/stargazers)
  5. [![DeepSeek Harness](https://img.shields.io/badge/DeepSeek%20Harness-plugin-4D6BFE?style=flat-square)](https://github.com/deepseek-ai/deepseek-harness)
  6. [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/Mars-Sea/dsh-commandcode-provider/pulls)
  7. [![CI](https://github.com/Mars-Sea/dsh-commandcode-provider/actions/workflows/ci.yml/badge.svg)](https://github.com/Mars-Sea/dsh-commandcode-provider/actions/workflows/ci.yml)
  8. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
  9. [![npm](https://img.shields.io/badge/npm-@mars--sea%2Fdsh--commandcode--provider-blue.svg)](https://www.npmjs.com/package/@mars-sea/dsh-commandcode-provider)
  10. Unofficial [DeepSeek Harness](https://deepseek-harness.github.io/deepseek-harness/) LLM provider plugin for **Command Code**, ported from [pi-commandcode-provider](https://github.com/patlux/pi-commandcode-provider) (MIT).
  11. > Community integration. You need your own Command Code account, API key or subscription, and Command Code's terms apply. Not affiliated with Command Code, Inc.
  12. ## Quick start
  13. | | |
  14. |---|---|
  15. | Verified engines | dsh `0.2.1-rc.2`, `0.2.1-rc.3`, `0.2.1-rc.4`, `0.2.1-rc.5`, `0.2.2-alpha.2`, `0.2.2-alpha.3`, `0.2.2-rc.1`, `0.2.2-rc.2` |
  16. | Node.js | **`>=24.9`** — raised from 22 in 0.16.0, see [Node.js 24.9 or newer](#nodejs-249-or-newer-is-required) |
  17. | Install — web | `dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@latest` |
  18. | Install — terminal | `dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider@latest` |
  19. | Config file | `$DSH_HOME/settings.yaml` → `llm-commandcode:` |
  20. | API key env | `COMMANDCODE_API_KEY` |
  21. | Usage dashboard | `/commandcode` |
  22. ## Features
  23. - **Plugin bundle** — one `dsh plugin add` installs a `commandcode` provider route with the live model catalog.
  24. - **Settings page** — accounts (keys, browser sign-in, live quota, dedicated models), model visibility, privacy switches, connection options.
  25. - **Annotated catalog** — plan tier, deal/`FREE` badge, peak/off-peak, image support and context window in the picker; free models first.
  26. - **Custom model names** — override a model's display name by catalog id so external tools that match on the name string (peak-hour reminders, cache-pricing plugins) keep working; the model id, request body, pricing and picker order are unchanged.
  27. - **Multi-account rotation** — an exhausted account hands over to the next one; pin a preferred account or route models to dedicated ones.
  28. - **Browser sign-in** — run the official authorization flow from the settings page; the approved key lands in the local credential store.
  29. - **Plans & quota panel** — optional sidebar card with the serving account's plan, 5-hour and weekly windows, balances and reset times.
  30. - **Session cost estimate** — published-rate estimates (`≈`) beside the composer token counter, priced per request from durable session history.
  31. - **Model analysis** — tokens, estimated cost, response timing and failures by session or date range. [Scope](docs/模型成本与性能分析.md).
  32. - **Web search** — the dsh `web_search` tool is served by Command Code (`/alpha/web-search`) with the same key and endpoint as chat.
  33. - **Zero data retention** — optional ZDR routing (`x-cmd-zdr: 1`), off by default.
  34. - **Context & output limits** — override the metered context window globally or per model, and cap or omit the per-turn `max_tokens`.
  35. - **Reasoning effort & images** — effort levels in the picker; Vision models accept images.
  36. - **Terminal UI** — the same install serves a [dsh-TUI](#terminal-ui-dsh-tui) profile with its own `/settings` → Command Code page.
  37. ## Screenshots
  38. **Model picker** — plan tier, deal/FREE, peak/off-peak, Image and context annotations:
  39. <img src="assets/screenshots/model-picker.png" alt="Model picker with plan, deal, image and context annotations" width="320">
  40. **Usage dashboard** — `/commandcode` per-account report:
  41. <img src="assets/screenshots/usage-dashboard.png" alt="Usage dashboard" width="520">
  42. **Settings page** — accounts with live quota, model visibility, privacy switches, connection options:
  43. <img src="assets/screenshots/settings-page.png" alt="Command Code settings page with the account usage card" width="640">
  44. ## Install
  45. ```sh
  46. dsh plugin --profile web add @mars-sea/dsh-commandcode-provider@latest
  47. ```
  48. This build admits **dsh `>=0.2.1-rc.2 <0.2.2-0`** — every RC of the `0.2.1` channel from `0.2.1-rc.2` onward — **and `>=0.2.2-alpha.2 <0.2.3-0`**, the `0.2.2` channel from its current alpha. As checked on 2026-11-18, npm `latest` points to `0.2.2-rc.1`, `next` to `0.2.2-rc.4`, and `alpha` to `0.2.2-alpha.3`. All ten verified releases are covered by the full engine matrix (`npm run test:engine`, `npm run test:install`). A later release of either channel is admitted without a plugin update, but stays unverified until a record is added to `dsh.compatibility.dshReleases`. `0.2.3` and later are deliberately excluded — the upper bounds are written `<0.2.2-0` / `<0.2.3-0` for exactly that reason. A profile on `0.2.0-rc.2`, `0.2.1-alpha.5` or older must upgrade its engine first. Compatibility details — the `engines.dsh` admission rule, package pairings, evidence — live in [engine compatibility](docs/agent-reference/engine-compatibility.md).
  49. **DSH `0.2.2-rc.2` compatibility (included in v0.17.7):** The actual installed engine and an isolated install have passed verification, along with a full typecheck against rc.2 dependencies. Provider errors retain custom codes and retry facts; auxiliary request purposes and settings-icon types compile with both older and newer engines. The existing engine range is unchanged and rc.2 is now recorded in `dshReleases`. Browser rendering and live-provider behavior remain outside these checks; see the [integration record](docs/对接说明.md).
  50. ### Node.js 24.9 or newer is required
  51. **The Node.js floor was raised from 22 to 24.9 in 0.16.0. On Node 22 or 23, upgrade Node before updating this plugin.**
  52. dsh `0.2.2-alpha.2` declares `engines.node >=24.9.0` and this plugin admits that engine, so the package-wide floor had to follow: a plugin that claims to support an engine must not be installable on a Node version that engine cannot start on. What that means in practice:
  53. - `npm` reports `EBADENGINE` when installing or updating this plugin on Node 22/23. It is a warning, not a hard failure, unless your npm sets `engine-strict=true`.
  54. - The `0.2.2` engines genuinely cannot run on Node 22/23, so a profile admitted there would fail at startup — the failure this floor exists to prevent.
  55. - The `0.2.1` RC engines still run on Node 22, but `engines.node` is a single floor for the whole package, so it applies to them too. That is the cost of admitting two channels in one build.
  56. `nvm install 24 && nvm use 24` (or any Node 24.9+ distribution) resolves it. Node 24 is a current LTS line.
  57. **Older dsh releases** are no longer supported: the last plugin release for dsh 0.1.7 is `0.11.17`, for 0.1.2–0.1.6 it is `0.11.11`, and for the 0.5.0-era line `0.9.1` — all installed by exact version, none maintained.
  58. > **pnpm 11 holds back new releases.** `minimumReleaseAge` defaults to 1440 minutes, so a version published less than a day ago is skipped and `@latest` resolves to the *previous* release — silently, with a success exit code. To install a release from the last 24 hours, name it exactly: `@mars-sea/dsh-commandcode-provider@0.11.15`. This applies to every profile, including the terminal UI below.
  59. ### Updating
  60. **Prefer the Web plugin page.** A profile that installed this plugin from the npm registry is marked updatable by dsh: sidebar **Plugins** → open this plugin → the **Versions** section below its rows lists newer releases, and **Update** replaces the installed one. An available update also shows an **Updatable** badge on the card and **Update to** in the detail header. The host checks the target first, then removes the old version and installs the target, rolling back to the previous version if that install fails. With HMR the new version starts immediately; without HMR dsh reports that a restart is required. API keys live in the dsh credential store and settings in the profile's `cordis.patch.yml`, so neither is lost when the package is replaced.
  61. **Only registry installs under their own package name get a Versions section.** Bundles installed from `link:` / a local path, a Git address, or a tarball (for example `dsh plugin add /path/to/dsh-commandcode-provider` during development), and bundles shipped with the installation, do not show it. Use the CLI below for those, or remove the bundle and reinstall with the registry command above. The section recommends the newest non-prerelease, non-deprecated version whose `engines.dsh` admits the running dsh; prereleases can be revealed manually.
  62. **CLI (fallback)** — same tag as the install, then restart the web app. Each profile updates separately, because the terminal UI owns its own plugin list:
  63. ```sh
  64. dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@latest
  65. dsh plugin --profile dsh-tui update @mars-sea/dsh-commandcode-provider@latest
  66. ```
  67. > `dsh plugin update` is a pnpm passthrough, not the host's plugin-update path; `minimumReleaseAge` above can silently skip a fresh release there too, so name an exact version when needed.
  68. ## Get an API key and verify it works
  69. Easiest via the official CLI (Node.js 22+):
  70. ```sh
  71. npm i -g command-code@latest
  72. cmd login # macOS/Linux; native Windows: cmdc login
  73. ```
  74. Or skip the CLI: click **Sign in to Command Code** under **Settings → Command Code** — the browser opens the commandcode.ai authorization page (the same flow `cmd login` runs) and the key is stored locally once you approve. You can also create a key on the [Keys page](https://commandcode.ai/mars-sea/settings/keys) and paste it, or `export COMMANDCODE_API_KEY="user_..."`.
  75. > The sign-in flow needs the Host and your browser on the same machine (loopback callback). With a remote Host, paste the key manually; a literal composition-level `apiKey`, if set, still takes precedence over a signed-in credential.
  76. **To verify:** after restart, enter your API key in **Settings → Command Code** and save. **Settings → Models** shows a **Command Code** card, and the model picker lists the live catalog under **commandcode**. Send a message with a model your plan includes.
  77. ## Terminal UI (dsh-TUI)
  78. **Each dsh profile owns its own plugin list**, so the web install does not reach the terminal — add the plugin to the `dsh-tui` profile as well, pinned to an exact version (within 24 hours of a release a bare name resolves to the previous build, leaving a fresh install with no `/settings` → Command Code page and no `commandcode` models):
  79. ```sh
  80. dsh plugin --profile dsh-tui add @mars-sea/dsh-commandcode-provider@latest
  81. ```
  82. Then pick the provider in the model selector, or name it directly:
  83. ```text
  84. /model commandcode/deepseek/deepseek-v4.1-flash
  85. ```
  86. `/model` lists every registered provider, with the live catalog and its plan/deal/context annotations; the `/commandcode` dashboard works there too.
  87. **Entering the key.** The TUI has no web Models page, so the plugin declares its own page — **`/settings` → Command Code** — with the API key, API base, out-of-plan filter, active account and command language. The key field is write-only: it shows whether a key is configured and writes what you type to the credential store, never to a settings document. The same page lists the whole catalog as checkboxes grouped by plan tier, free models first; everything starts checked, and the choice is stored as per-model overrides next to the `visibleModels` list the web page edits. Custom display names (`modelNames`) are configurable on the Web settings page only for now; the terminal settings page does not expose them yet (the same boundary as `contextWindow`, issue #86).
  88. Alternatively set the key outside the TUI. The first match wins:
  89. - A literal `apiKey` in the composition config wins over everything and is always used.
  90. - Otherwise the credential reference is resolved (`apiKeyEnv`, `COMMANDCODE_API_KEY` by default). In a profile that mounts the credentials service (Web, desktop, SDK, ACP) that service owns the order: **since 0.2.1-alpha.3 a saved credential wins over the launching environment**; earlier releases had the environment first.
  91. - A **headless profile mounts no credentials service on purpose**, so only the launching environment, the project `.env` and `$DSH_HOME/.env` apply — **a key saved on the page never reaches a headless run**.
  92. - The last resort is `~/.commandcode/auth.json`, written by the official CLI.
  93. ```sh
  94. export COMMANDCODE_API_KEY="user_..." # launching environment
  95. cmd login # writes ~/.commandcode/auth.json
  96. ```
  97. **Making Command Code the default.** dsh-TUI pins its own agent route, so its `agent-default-model` setting does not override it. Override the `agent-loop` row in your profile patch (`$DSH_HOME/profiles/dsh-tui/cordis.patch.yml`):
  98. ```yaml
  99. - id: agent-loop
  100. inject: [tuiStartup]
  101. config:
  102. agents:
  103. - id: main
  104. provider: commandcode
  105. model: deepseek/deepseek-v4.1-flash
  106. reasoningEffort: max
  107. cwd: !!js process.cwd()
  108. ```
  109. ## Usage dashboard
  110. The plugin registers a `/commandcode` slash command showing per-account usage:
  111. ```text
  112. /commandcode (or /commandcode status)
  113. ```
  114. Its copy follows the shell's locale: explicit `lang: 'en' | 'zh'` in the `llm-commandcode` plugin config wins, otherwise `LC_ALL`/`LANG` is read, otherwise it falls back to `zh`. The web settings page is independent — it follows the browser's language preference.
  115. ## Account rotation
  116. With several Command Code subscriptions, the plugin **switches to the next account automatically** when one hits its usage limit:
  117. - **Setup** — **Add account** in the **Accounts** card at Settings → **Command Code**, then sign in or paste an API key. Account actions (add, rename, replace or clear a key, remove, pin) apply immediately; only the other settings wait for the Save bar. The top-level key always serves first as the `default` account.
  118. - **Manual switching** — **Pin this account** in an account's **⋯** menu makes it preferred; if it is exhausted, requests fall back to the others and return once its window resets. **Unpin** returns to automatic rotation.
  119. - **Dedicated models** — expand an account and pick its **Dedicated models** from the live catalog. Those requests serve from that account while it is usable; an exhausted account falls back to the normal rotation. A model belongs to one account at a time (stored as `modelAccountRules`).
  120. - **Show only favorite models** — the **Visible models** picker in the **Models & context** card keeps only the checked models in the picker; unchecked shows all (the default).
  121. Each account row shows its plan, status and 5-hour/weekly meters; expand it for the full report, or run `/commandcode`. When a refreshed report shows a spent window, that account also leaves automatic selection until the window resets. The equivalent YAML is in [Configure](#configure).
  122. ## Configure
  123. **Settings → Command Code** groups the options as **Accounts** (keys, sign-in, live quota, pinning, dedicated models), **Models & context** (out-of-plan filter, visible models, context length, output limit), **Privacy & security** (zero data retention), **Integrations & display** (web search, sidebar quota card) and **Advanced** (API base URL, timeouts, transport retries, image offload). The same options live in `$DSH_HOME/settings.yaml` and apply immediately, without a restart:
  124. ```yaml
  125. llm-commandcode:
  126. apiKeyEnv: COMMANDCODE_API_KEY # first (default) account
  127. activeAccount: COMMANDCODE_API_KEY_2 # optional: pin the active account
  128. accounts: # optional: rotation order after it
  129. - label: Go #2
  130. apiKeyEnv: COMMANDCODE_API_KEY_2
  131. modelAccountRules: # optional: route models to accounts (first match wins)
  132. - models: # catalog model ids (multi-select)
  133. - deepseek/deepseek-v4-pro
  134. account: COMMANDCODE_API_KEY_2
  135. visibleModels: # optional: only these models in pickers; unset shows all
  136. - deepseek/deepseek-v4-pro
  137. apiBase: https://api.commandcode.ai
  138. workingDir: /path/to/project # optional
  139. modelsCachePath: ~/.commandcode/models-cache.json
  140. requestTimeoutMs: 300000 # default 300s (the official CLI's own budget)
  141. streamIdleTimeoutMs: 300000 # default 300s
  142. # offloadSeenImagesForCache: true # opt in to CLI cache mitigation
  143. showSidebarQuota: true # optional: sidebar plans & quota card (default off)
  144. zdr: true # optional: zero-data-retention upstreams only (default off)
  145. # contextWindow: 131072 # optional: custom context length for every model
  146. # contextWindowOverrides: # optional: per-model context lengths; wins over contextWindow
  147. # deepseek/deepseek-v4-pro: 65536
  148. # maxOutputTokens: 65536 # optional: per-turn output limit; 0 sends no max_tokens
  149. # modelNames: { "deepseek/deepseek-v4.1-flash": "DeepSeek V4.1 Flash" } # optional: display-name overrides by catalog id
  150. ```
  151. ### Context, output and image tuning
  152. | Option | Effect |
  153. |---|---|
  154. | `contextWindow`, `contextWindowOverrides` | Replace the catalog `context_length` the harness meters and compacts on (issue #86). Use it when the catalog over-reports the window (sessions then fail with `context_length_exceeded`) or under-reports it (sessions compact too early). Whole tokens in 1 – 10,000,000; `32K`/`1M` shorthand accepted. |
  155. | `maxOutputTokens` | Per-turn `max_tokens` cap. Every request already carries `max_tokens`, resolved as the smallest of the model's published ceiling, the runtime-learned ceiling and the gateway cap of 131,072 — a passive hard limit that cuts the answer with no warning to the model. A positive number can only **tighten** it; `0` sends **no** field at all, which is the fix for answers cut off mid-sentence (`0` affects the CLI and OpenAI transports only; Claude's Anthropic Messages endpoint requires the field). An empty field clears the setting — it is not the same as writing `0`. |
  156. | `offloadSeenImagesForCache` | On the CLI transport a new image can make the reported prompt cache retreat to the first historical image even when every previous request message is byte-identical. Enabling it replaces an older image with a stable text placeholder once this model has answered with it, so later text stays cached without replaying old pixels. It mitigates the cost spike but does not repair Command Code's multimodal cache behavior, and the model cannot inspect an offloaded image again without rereading the source file. Off by default. [Live evidence](docs/issue-64-cache-review.md). |
  157. | `modelNames` | Optional map of catalog model id → custom display name; only the picker label (`LlmModelInfo.name`) changes, so external tools that match on the model name string (peak-hour reminders, cache-pricing plugins) can be made to line up — our default ` (CC)` suffix and upstream's ` (latest)` suffix are what break them. **Unset or empty (the default) keeps the name exactly as today: `${catalogName} (CC)`**, with any upstream ` (latest)` preserved; an unknown model with no catalog row still shows the bare id. The model id, request body, pricing, peak labels, price table, `commandcode/prices` wire and Remote descriptor count are unchanged; sorting still uses the catalog original name, so renaming never reorders the picker. Configurable on the Web settings page only for now — the terminal settings page is not wired up. |
  158. ## Web search
  159. When your deployment mounts the web capability (`@deepseek-ai/dsh-web` + `@deepseek-ai/dsh-tool-web`), the model's `web_search` tool is served by this plugin's `commandcode` search provider — it calls the Command Code Provider API's `/alpha/web-search` endpoint with the **same API key and base URL** as chat, so no separate search key, endpoint or model is needed.
  160. **On by default.** The *"Serve dsh web search with Command Code"* toggle (`webSearch`) selects `commandcode` as the active search backend; turning it off hands the selection back to whichever backend was there before (a sibling search plugin such as modsearch keeps working). The change takes effect on the next search — no restart.
  161. - The provider registers as `commandcode` on `ctx.web` only when the web service is present; without it this stays a chat-only plugin.
  162. - When the official **Web search** settings already pin another backend, that explicit choice wins: the plugin keeps `commandcode` registered but unselected and reports that state. It takes over only while nothing else pins the field, remembers the backend it displaced, and restores it when the toggle goes off or the plugin unloads. To pin it durably, set `searchProvider: commandcode` (or `$DSH_WEB_SEARCH_PROVIDER=commandcode`).
  163. - `numResults` from the dsh tool is clamped to the Command Code range (1–10, default 5); results map to the dsh `WebSearchSource` shape (`url`/`title`/`snippet`).
  164. > This reuses the Command Code Provider API directly (like the official CLI's built-in `web_search`), so it is distinct from a DeepSeek-native search backend.
  165. ## Zero data retention (ZDR)
  166. Command Code can serve a request only through upstreams that retain no prompts or completions and never train on them — the same opt-in the official CLI exposes as `CMD_ZDR=1`, and the `x-cmd-zdr: 1` header on the Provider API ([official docs](https://commandcode.ai/docs/resources/zdr)).
  167. **Off by default.** Turn it on with the *"Zero data retention (ZDR)"* toggle (`zdr`) in the Privacy & security card, or in your profile config.
  168. - The header is sent on **every chat request** while ZDR is on. A model without an available ZDR upstream fails with `422 cmd_zdr_no_providers`; the request is never retried without the header.
  169. - If a refusal still happens (coverage churn, or no spare ZDR capacity at that moment), the error names the cause and how to turn ZDR off instead of surfacing as a bare HTTP 422.
  170. - **ZDR usually costs more**: capacity is limited and billed at each upstream's pass-through rates, and which upstream serves a request can change per request. The session-cost readout keeps quoting the ordinary catalog rates; the real per-request price shows in Command Code's Studio usage page.
  171. ## Notes & limitations
  172. - **Image input is model-gated** — only Vision models accept images; text-only models refuse them, and dsh rejects switching a text-only model into an image-bearing session. The adapter reports the size actually put on the wire (long edge 1568, encoded bytes capped at 1 MiB), and the provider caps a single request (around 50 MB, undocumented); images beyond that budget are replaced by a short "image omitted" note, and an over-sized request is retried once with a smaller image budget.
  173. - **No `stop` sequences** — requests carrying one fail.
  174. - **Historical reasoning is replayed on both transports** so a tool-calling loop keeps its chain of thought: `/provider/v1/chat/completions` passes it back as `reasoning_content`, `/alpha/generate` carries it as a `reasoning` block inside the rebuilt assistant turn. Only tool calls with a paired tool result are replayed.
  175. - **Tool parameter schemas are normalized** to the object root the provider requires, so a tool declared without one (a third-party plugin's hand-written schema, an MCP server's `inputSchema`, a generated root `$ref`) no longer fails the turn with `schema must be a JSON Schema of 'type: "object"'`.
  176. - The model catalog is browsable without a key; chat requests need one.
  177. ## Permissions & privacy
  178. The plugin only communicates between your local dsh profile and your Command Code account: locally it touches only the credential store and the models cache (plus `~/.commandcode/auth.json` as a last-resort fallback); on the network it calls only the Command Code API. No telemetry. With **zero data retention** on, chat requests require a ZDR upstream; models without one fail instead of running without the protection.
  179. ## Disabling / uninstalling
  180. - **Disable** without removing: edit your profile's `cordis.patch.yml` and comment out (or remove) the `llm-commandcode` row, or set `disabled: true`, then restart.
  181. - **Uninstall** completely: `dsh plugin --profile web remove @mars-sea/dsh-commandcode-provider`. Your API key in the dsh credential store and `~/.commandcode/auth.json` are left untouched.
  182. ## Development
  183. ```sh
  184. npm install
  185. npm run typecheck # tsc --noEmit
  186. npm run build # tsdown -> lib/
  187. ```
  188. To try a local build in a profile: `dsh plugin --profile web add /path/to/dsh-commandcode-provider`. After changing `src/`, re-run `npm run build` and restart the app.
  189. The package exports the plugin root, `/client`, `/locale/*.json`, and `/package.json`. Source remains in the repository; the unpackaged `./src/*` export was removed. `npm run test:pack` checks declared entry points against the actual packed file list.
  190. ## Reference docs
  191. The engineering detail behind this README lives under [`docs/agent-reference/`](docs/agent-reference/):
  192. - [adapter and wire contracts](docs/agent-reference/adapter-protocol.md) — transports, streaming, images, tool calls, reasoning replay, output budget, ZDR header
  193. - [accounts and retry](docs/agent-reference/accounts-and-retry.md) — credential resolution, account rotation, rate limits, web search selection
  194. - [client and settings](docs/agent-reference/client-and-settings.md) — settings pages, browser sign-in, TUI settings, model selection
  195. - [usage and cost](docs/agent-reference/usage-and-cost.md) — session cost readout, price snapshot, compaction accounting
  196. - [engine compatibility](docs/agent-reference/engine-compatibility.md) — supported dsh versions, peer ranges, `engines.dsh` admission
  197. - [model catalog](docs/agent-reference/model-catalog.md) — catalog sync, plan tiers, effort levels, deals, ZDR exception set
  198. ## Community & feedback
  199. [GitHub Repository](https://github.com/Mars-Sea/dsh-commandcode-provider) · [GitHub Releases](https://github.com/Mars-Sea/dsh-commandcode-provider/releases) · [npm Package](https://www.npmjs.com/package/@mars-sea/dsh-commandcode-provider) · [Linux.do 社区](https://linux.do/)
  200. ## License
  201. MIT — see [LICENSE](./LICENSE). Portions ported from [pi-commandcode-provider](https://github.com/patlux/pi-commandcode-provider) (MIT).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.