dsh-commandcode-provider README

The project's README from github.com/Mars-Sea/dsh-commandcode-provider. As one markdown file: README.md.

dsh-commandcode-provider

English | 简体中文

Awesome GitHub Repo stars DeepSeek Harness PRs Welcome CI License: MIT npm

Unofficial DeepSeek Harness LLM provider plugin for Command Code, ported from pi-commandcode-provider (MIT).

This is a community integration. You need your own Command Code account and API key or subscription, and Command Code's terms apply. This project is not affiliated with Command Code, Inc.

What you get

See Screenshots below for what the UI looks like.

Install

Pick the release line that matches your DeepSeek Harness version:

The latest tag now always points at the current 0.1.2-line plugin release, so a plain @latest install gets the newest stable release for dsh 0.1.2+. Users on the old 0.5.0-era Harness line must pin @0.9.1 explicitly.

Fresh pnpm 10 marketplace generations are supported directly. Do not add a separate @deepseek-ai/dsh-invariants dependency; the plugin declares it as a Host peer so the active dsh profile remains the owner of Harness packages.

Updating

Update with the same tag you installed with:

dsh plugin --profile web update @mars-sea/dsh-commandcode-provider@latest     # dsh 0.1.2-rc.1+
dsh plugin --profile web update @mars-sea/[email protected]      # older dsh (0.5.0 line, unmaintained)

Then restart the web app.

Getting an API key

The easiest path is the official CLI (Node.js 22+):

npm i -g command-code@latest
cmd login        # macOS/Linux; native Windows: cmdc login

Or skip the CLI: click Sign in to Command Code under Settings → Command Code — your browser opens the commandcode.ai authorization page (the same flow cmd login uses) and the key is stored in the local credential service when you approve. You can still create a key on the Keys settings page and paste it into Settings → Command Code, or export COMMANDCODE_API_KEY="user_...".

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.

Verify it works

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.

Usage dashboard

The plugin registers a /commandcode slash command showing per-account usage:

/commandcode        (or /commandcode status)

The command's user-facing 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 on its own.

Account rotation

With several Command Code subscriptions, the plugin switches to the next account automatically when one hits its usage limit:

The equivalent YAML ($DSH_HOME/settings.yaml or composition config):

llm-commandcode:
  apiKeyEnv: COMMANDCODE_API_KEY        # first (default) account
  activeAccount: COMMANDCODE_API_KEY_2   # optional: pin the active account (`default` or an account's credential ref)
  accounts:                              # rotation order after it
    - label: Go #2
      apiKeyEnv: COMMANDCODE_API_KEY_2
    - label: Go #3
      apiKeyEnv: COMMANDCODE_API_KEY_3
  modelAccountRules:                     # optional: route models to accounts (first match wins)
    - models:                            # catalog model ids (multi-select)
        - deepseek/deepseek-v4-pro
        - deepseek/deepseek-v4-flash-vision-exp
      account: COMMANDCODE_API_KEY_2
    - models:
        - tencent/hy4-preview
      account: default
  visibleModels:                       # optional: show only these models in pickers (catalog model ids); unset shows all
    - deepseek/deepseek-v4-pro
    - tencent/hy4-preview

Configure

Settings → Command Code covers the API key, API base URL, working directory, and request/stream timeouts; once a key is saved, a live Account usage card appears at the top of the page.

The same options live in $DSH_HOME/settings.yaml (changes apply immediately, no restart):

llm-commandcode:
  apiKeyEnv: COMMANDCODE_API_KEY   # credential reference
  apiBase: https://api.commandcode.ai
  workingDir: /path/to/project     # optional
  modelsCachePath: ~/.commandcode/models-cache.json
  requestTimeoutMs: 60000          # default 60s
  streamIdleTimeoutMs: 300000      # default 300s

When your deployment's dsh shell 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. You do not configure a separate search key, endpoint, or model.

On by default. The plugin's Settings → Command Code page has a "Serve dsh web search with Command Code" toggle (webSearch, default on). When on, the plugin selects commandcode as the active search backend automatically; turn it off to hand the selection back to whichever backend was there before (a sibling search plugin such as modsearch keeps working — it is never forced back to dsh's shipped DeepSeek search). The toggle takes effect on the next search — no restart needed.

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.

Notes & limitations

Permissions & privacy

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.

Disabling / uninstalling

Development

npm install
npm run typecheck   # tsc --noEmit
npm run build       # tsdown -> lib/

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.

Community & feedback

License

MIT — see LICENSE. Portions ported from pi-commandcode-provider (MIT).

Screenshots

Model picker — plan tier, deal/FREE, peak/off-peak, Image and context annotations:

Model picker with plan, deal, image and context annotations

Usage dashboard — /commandcode per-account report:

Usage dashboard

Settings page — API key, connection knobs, account rotation and the live account-usage card:

Command Code settings page with the account usage card

dsh-commandcode-provider (Mars-Sea/dsh-commandcode-provider)

Searching Database…

这是什么?这是一个非官方插件,把 Command Code 添加为 DeepSeek Harness(dsh)内的一个 LLM 提供商,让 dsh 能使用 Command Code 的实时模型目录、基于套餐的模型选择、推理力度控制、图像输入、网页搜索和多账户支持。
怎么把它装进我的 dsh profile?用 'dsh plugin add' 把它安装到任意 dsh profile,并选择与你的 dsh 版本匹配的发布线:dsh 0.1.2+ 直接用 @latest 安装,老的 0.5.0 时代 Harness 线则要显式固定为 @0.9.1。
使用之前需要有自己的 Command Code 账户吗?需要——你需要一个带 API 密钥或订阅的 Command Code 账户、一个用于承载插件的现有 dsh 安装;如果要用官方 CLI 获取密钥,还需要 Node.js 22+。
这个插件做不到什么?完全不支持停止序列(携带停止序列的请求会失败),图像输入只对带 Vision 标记的模型有效,而且在旧的 /alpha/generate 传输通道上,之前轮次的推理内容不会回放到后续轮次。
我的 API 密钥和聊天数据会去哪里?插件只在你本地的 dsh profile 和 Command Code API 之间通信:在本地它会接触凭据存储、模型缓存以及一个备用的 ~/.commandcode/auth.json,并且不发送任何遥测数据。
多账户轮换是怎么工作的?你在 Account rotation 设置卡片里添加多个带标签和 API 密钥的 Command Code 账户;当当前账户达到用量上限时,请求会自动回落到下一个账户,等原账户的用量窗口重置后再切回原来的账户。
它会取代 dsh 内置的网页搜索吗?当 dsh 的网页能力被挂载时,插件的搜索开关(默认开启)会把 websearch 工具切换到 Command Code 的 /alpha/web-search 端点(使用同一个 API 密钥),而不是 dsh 自带的 DeepSeek 搜索后端。
可以控制推理力度或给模型发图片吗?提供可选推理力度档位的模型会在模型选择器中显示这些档位,具备视觉能力的模型可以在聊天中直接接受图像输入;纯文本模型则会拒绝图片。
README 为什么提到要固定确切的旧版本?dsh 0.5.0 及更早版本使用的是不同的 rc 时期 Host/浏览器 API,所以这条老版本线上的用户必须安装确切为 @0.9.1 版本的插件,而不是 @latest——后者现在只面向 dsh 0.1.2+。
Creator
Mars-Sea
Size
8.6 MB
Stars
393
Age
2mo
Commits · 90 Days