Skip to main content

dsh-commandcode-provider

76Stars4Forks0Issues0Watchers

Integrate Command Code with DSH, providing model catalog, inference requests, image input, and account usage viewing capabilities.

Evidence5/5methodologySourceInstallMaintenanceDSH versionSecurity scan
Machine-auditedInstall commandRepo verifieddsh-plugin topicLicenseREADMEAI wiki
Language
TypeScript
License
MIT
Branch
main
deepseek-harnessdshdsh-pluginllmllm-providernpmpluginprovider

Install

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

Run the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial

Install via your agent

Install the DeepSeek Harness plugin Mars-Sea/dsh-commandcode-provider for me: review the repository at https://github.com/Mars-Sea/dsh-commandcode-provider first, then run the install command and verify the plugin loads successfully.

Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.

One-line Description

This plugin integrates Command Code into DSH, allowing you to browse and use models provided by Command Code directly from DSH's model selector. It also provides a dedicated settings page, account usage viewing, and model list organization by plan.

Key Features

  • Integrate Command Code Models: Register a commandcode model provider, converting DSH's conversations, tool calls, and streaming output into Command Code requests.
  • Synchronize Model Catalog: Fetch real-time model list from Command Code, and use local cache to continue displaying the existing catalog when network is unavailable.
  • Display Model Usage Information: Mark minimum plan, promotions, image capability, and context window in the model selector, sorted by plan tier.
  • Filter Models by Account Plan: Hide models not supported by the subscription plan by default; retain full list when billing information is uncertain, actual permissions are still determined by the server.
  • Support Reasoning Intensity and Image Input: Provide optional reasoning intensity for known models; Vision models can receive images, which are read through DSH's attachment service.
  • View Account Usage: Check request count, spending, tokens, quotas, time window limits, and subscription information via the /commandcode command and the account card in the settings page.

Technical Implementation

  • Language: TypeScript
  • Key Dependencies: @deepseek-ai/dsh-llm, @deepseek-ai/dsh-settings, @deepseek-ai/dsh-credentials, React
  • Architecture Pattern: DSH bundle registers both Host-side model adapter and configurable provider, and inserts plugin configuration through Cordis patch; Web client additionally registers Command Code settings page. Account usage is obtained by Host-side through Remote gateway, browser does not hold API key directly.
  • Entry Files: src/index.ts; model request and catalog adapter located at src/adapter.ts, browser entry at src/client/index.ts.

Use Cases

Suitable for users who want to use Command Code accounts and models in DSH, and view plans and image capabilities in the same model selector. Users who need to understand account quotas, request spending, or 5-hour/weekly window usage can also directly use the settings page or /commandcode command.

Prerequisites and Compatibility

DependencyMinimum VersionDescription
DSH Runtime^0.1.0-rc.6 peer dependencyRequires DSH's LLM, credentials, settings, client connection and other services; plugin package declares corresponding peer dependencies.
Node.js>=22Required by package.json engines field.
React^18.2.0Web settings page uses React for rendering.
PlatformCross-platformpackage.json does not declare os or cpu restrictions.
Native ModulesNoneNo native module dependencies such as node-pty, node:sqlite declared.

Installation

dsh plugin --profile web add github:Mars-Sea/dsh-commandcode-provider

Configuration Options

OptionTypeDescriptionDefault
apiKeyEnvStringSpecifies the name for reading API key from DSH credentials service or startup environment. Settings page also uses this reference when saving keys.COMMANDCODE_API_KEY
apiKeyStringAPI key directly written to plugin composition config; suitable for host configuration injection, takes priority over credential reference.Not set
apiBaseStringBase address for Command Code API, convenient for using endpoints other than the default.https://api.commandcode.ai
workingDirStringSubmitted to Command Code as project working directory; uses DSH process current directory when empty.Current working directory
modelsCachePathStringLocation for saving model catalog cache, used for fallback display when network is temporarily unavailable.~/.commandcode/models-cache.json
requestTimeoutMsNumberMaximum wait time to receive first byte of response for generation requests.60000 ms
streamIdleTimeoutMsNumberWhen streaming response has continuous no data, connection is considered invalid after exceeding this time.300000 ms
filterModelsByPlanBooleanControls whether model selector hides models beyond account subscription plan; shows full catalog when turned off.true

FAQ

Q: Does this plugin need an API key?

A: Model catalog can be browsed without a key, but sending requests and viewing account usage require a valid Command Code API key. The plugin first checks direct configuration, then resolves through DSH credentials service; falls back to reading startup environment, and finally to ~/.commandcode/auth.json.

Q: What image inputs are supported?

A: Only models registered as Vision in the source code accept images, and DSH needs to have attachment service enabled. Text models will not silently discard images; instead, they return an unsupported content error.

Q: Why is a certain model missing from the model list?

A: The default model selector hides models beyond permissions based on account subscription plan. Opening may fail when billing query fails, plan is unknown, or there's on-demand balance; turning off filterModelsByPlan also shows the full catalog, but server may still return plan permission errors.

Q: What to do when requests interrupt during long thinking?

A: Default waits 60 seconds for first byte, and allows 300 seconds of stream idle time. When network is slow or model outputs for a long time, you can increase requestTimeoutMs or streamIdleTimeoutMs in settings page; request connection failures, rate limits, and some server errors retry according to DSH default policy.

Q: Why does the request return MODEL_NOT_IN_PLAN?

A: This means the selected model is not in the current Command Code plan. You can select a model included in the current plan, or adjust the account plan; plan markers in the model list are only for reference, the server is the ultimate source of permissions.

Q: Is stop sequence supported?

A: No. Command Code's request format does not have a stop field; requests with this option will explicitly return an unsupported option error.

Q: Settings page shows unconfigured, but requests still succeed. Why?

A: The key may come from the official CLI login file ~/.commandcode/auth.json instead of DSH credential store. Saving the key to settings page will allow settings page to accurately display configured status.

Q: Will uninstalling the plugin delete the API key?

A: No. The uninstall command only removes the plugin package and its configuration layer; keys in DSH credential store and ~/.commandcode/auth.json are retained.

Learning Curve

Beginner — After installing the plugin, fill in API key and connection parameters mainly through "Settings → Command Code", then select model from model selector; check advanced configuration only when you need to adjust options based on plan or network conditions.

Known Issues and Limitations

  • stop sequence is not supported; requests with this option will return UNSUPPORTED_OPTION.
  • Image input is limited by Vision model list and depends on DSH attachment service; switching to text model in sessions with images will also be rejected by DSH.
  • Model capabilities, plans, promotions, and peak/off-peak prices are static snapshots in source code; plugin update is required to fully sync after official catalog or plan changes.
  • When model catalog refresh fails, it falls back to local cache; if cache doesn't exist or is invalid, model selector may have no old catalog to display, but explicit model requests are still handled by server.
  • Account usage depends on Command Code's account interface and API key; each interface degrades independently; when some interfaces fail, the report retains other available data.
  • Default stream idle timeout is 300 seconds; very long reasoning processes or network stalls exceeding this value will still be marked as timeout.
  • Plugin only reads the official CLI's ~/.commandcode/auth.json as the last fallback, and does not read authentication files from other tools like pi/OMP.

Read the usage guide →

Install steps, key points, FAQ and compatibility for this plugin — auto-derived from indexed fields.

Listing badge

Listed on deepseek-plugin.org
[![Listed on deepseek-plugin.org](https://img.shields.io/badge/listed_on-deepseek--plugin.org-007EC6)](https://deepseek-plugin.org/plugins/Mars-Sea/dsh-commandcode-provider)

Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.

← Back to plugin directory