DSH-Desktop uses a plugin-based architecture. The dsh-commandcode plugin registers a route for the Command Code provider, making its models callable within DSH. The plugin is developed by maintainer wjf1 and is licensed under the MIT License.
Core Features¶
In addition to providing basic functionality, the plugin adds adaptation and enhancements for the Command Code ecosystem:
- Provider Route Registration: Registers the
commandcoderoute onctx.llm, making Command Code models available in any conversation. - Models Page Card: Provides a dedicated card on the model settings page, supporting API Key input and quick login.
- Live Model Catalog: Retrieves the model catalog in real time from the Command Code Provider API and supports local caching.
- Credential Configuration: Supports configuring credentials via environment variables, the settings page, the CLI authentication file, or the built-in OAuth login flow.
- Streaming Generation: Supports SSE/JSONL streaming generation, including text, reasoning, tool calls, and usage events.
- Stale-While-Revalidate Catalog: Provides a cache-first strategy with background refresh; supports ETag requests and a circuit breaker mechanism to prevent invalid requests.
- Configurable Timeout & Retry: Supports configuring request timeout (first byte) and stream idle timeout, and uses an exponential backoff strategy to handle transient failures.
- Multi-Account Rotation: Supports configuring multiple API Keys and automatically switching when a 429 rate limit or 401 authentication failure occurs.
- Plan-Aware Model Filtering: Automatically filters unavailable models based on the account subscription tier.
- Usage & Billing Dashboard: Provides per-account usage statistics, subscription plan information, and progress bar display.
- Image Input Support: Supports Vision models receiving image attachments.
- Redesigned Settings Page: Uses a card-based layout, divided into Connection, Usage & Plan, Multi-Account, and Advanced Settings.
- Bilingual Interface: The interface supports Chinese/English switching and follows the browser language setting.
- TypeScript Build: The project is built with TypeScript and includes type declaration files.
Installation and Enablement¶
Before installing, ensure the environment meets the requirements: DSH-Desktop version >= 0.7.0 (compatible with DeepSeek Harness 0.1.2-alpha.1) and Node.js >= 20 (used only for development builds; the desktop app includes its own runtime).
- Install the Plugin
Run the following command in the DSH profile directory:
npm install dsh-commandcode
- Configure Profile
Editpackage.jsonand adddsh-commandcodeto thedsh.profile.bundlesarray:
{
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"dsh-commandcode"
]
}
}
}
- Restart
Restart DSH-Desktop. The Command Code provider will appear in the model list.
Configuration¶
API Key Configuration¶
Supports multiple configuration methods, in descending order of precedence:
1. Settings Page: Paste and save it on the settings page.
2. Environment Variable: Set COMMANDCODE_API_KEY.
3. CLI Auth File: Run command-code login to generate ~/.commandcode/auth.json.
4. Built-in Login: Click “Login with Browser” on the settings page to complete OAuth authorization.
Key Settings¶
| 字段 | 类型 | 默认值 | 说明 |
|---|---|---|---|
requestTimeoutMs |
number | 60000 | Timeout for waiting for the first byte of the response |
streamIdleTimeoutMs |
number | 300000 | Maximum allowed idle time during streaming |
filterModelsByPlan |
boolean | true | Whether to filter models based on subscription plan |
lang |
‘zh’ | ‘en’ | ‘zh’ | Language for the terminal command /commandcode |
Multi-Account Configuration¶
Configure multiple accounts in cordis.patch.yml; the plugin will automatically handle rotation:
- insert:
- id: llm-commandcode
name: "dsh-commandcode"
config:
apiKeyEnv: COMMANDCODE_API_KEY
accounts:
- label: "Work"
apiKeyEnv: COMMANDCODE_API_KEY_WORK
- label: "Personal"
apiKeyEnv: COMMANDCODE_API_KEY_PERSONAL
Usage¶
- Select a Model: Open any conversation, click the model selector, find the “Command Code” group, and select a model with the
(CC)suffix. - View Usage: Go to the
Settings → Command Code → Usage & Plancard, or directly enter/commandcodein the DSH terminal. - Authorize Login: Go to
Settings → Command Code, click “Login with Browser” to complete authorization. No restart is required.
Notes¶
- The plugin runs with the permissions of the current DSH process. Ensure that you install it from a trusted source.
- A valid Command Code account and an API Key or subscription are required.
- The model catalog uses caching by default. Restarting clears the in-memory cache. If a model does not appear, click “Refresh” in the Usage card to refresh.
Links¶
- GitHub: https://github.com/wjf1/dsh-commandcode
- Directory Page: https://www.skillhub.cn/plugins/wjf1/dsh-commandcode