Preface¶
When integrating models into DeepSeek Harness (DSH), the common approach is via HTTP API or a self-built adapter layer. If you already use the OpenCode CLI on your machine to manage models and login state, setting up a separate set of Keys or a sidecar for DSH adds an extra layer of operations overhead and permission surface.
dsh-opencode-cli-bridge, published by community maintainer home-river, leverages DSH’s native LlmAdapter: it routes traffic through the local opencode process, with no sidecar, no additional persistent process, and no API Key required within the plugin. The following sections cover what it does, how to install it, how to use it, as well as configuration and session-binding behavior.
What Is This¶
In one sentence: a DeepSeek Harness plugin that lets you invoke OpenCode-compatible models through the local OpenCode CLI within DSH Web, appearing as an opencode-bridge provider in the model selector.
- Repository: home-river/dsh-opencode-cli-bridge
- Community directory: SkillHub plugin page
- License: MIT
- Current plugin version (package): 0.1.0
- Category: Model inference
The DSH ecosystem emphasizes “everything is a plugin”; directories such as SkillHub are community sites and have no official affiliation with DeepSeek / High-Flyer.
Core Features¶
The capabilities listed in the documentation are as follows, and can be used directly once prerequisites are met.
- Native adapter: a
opencode-bridgegroup appears in the model selector; select a model and start chatting. - One-to-one session continuation: DSH sessions are bound to OpenCode sessions, and tool results remain visible across turns; the mapping is written to
~/.dsh-opencode-cli-bridge/sessions.json, and is rebuilt with a full replay if the ledger drifts or the OC session becomes invalid. - Typewriter streaming: OpenCode chunks the full output into blocks and adds a pacing layer to simulate streaming; reasoning and tool results are mirrored to DSH in a structured way (tool calls/results are carried via
reasoningblocks to avoid triggering DSH’s tool loop viatool-call, which would cause double execution). - CLI environment detection: a persistent status card at the top of the OC-bridge panel (version, path, source); when not installed, it recommends npm / scoop / choco installation commands based on the environment — read-only probing, one-click copy, no automatic installation.
- Model exposure filtering: check the models you want to appear in the selector from the sidebar; they take effect the next time the selector is opened after saving.
- Robustness: five-layer timeouts, killing the process tree on cancel (Windows uses
taskkill /T), 12-category error classification, protocol parsing safeguards.
Data flow (excerpted from the README):
DSH session → DSH LLM service → opencode-bridge LlmAdapter
→ opencode run --format json (local CLI, --dir workspace / --session session binding)
→ JSON Lines events → DSH text-delta / reasoning / usage / finish
Prerequisites¶
| Dependency | Requirement |
|---|---|
| DeepSeek Harness | 0.2.x (README tested line: 0.2.1) |
| Node.js | ≥ 20 |
| pnpm | ≥ 10 (used by dsh plugin add for dependency installation, must be on PATH) |
| OpenCode CLI | Required; this plugin routes model traffic through the local opencode |
The plugin declares in package.json: engines.dsh is >=0.2.1-0 <0.3.0. If unmet, the entire package is skipped and listed under skippedBundles; you can forcibly override it with dsh plugin --profile <p> allow-version <pkg@ver> --dsh-version <ver> --accept-risk (at your own risk).
Installation and Activation¶
Installing from the npm source is recommended (commands from the README):
# npm install (recommended)
dsh plugin --profile web add dsh-opencode-cli-bridge
For local tgz or self-packaged source:
npm pack
dsh plugin --profile web add ./dsh-opencode-cli-bridge-0.1.0.tgz
If dsh is not found, you can use:
npx -y --package @deepseek-ai/dsh dsh plugin --profile web add dsh-opencode-cli-bridge
Verification steps:
- Restart
dsh web. - Open the model selector — a opencode-bridge group should appear with models listed.
- Select a model and start chatting.
If the OpenCode CLI is not installed, you can open the OC-bridge panel in the left column and check the status in the “CLI Environment” section, then copy the recommended installation command.
Typical Usage¶
- Direct chat: select a model under
opencode-bridgein the model selector. - Panel model list configuration: the OC-bridge panel next to “Plugins” in the left column — the top shows CLI environment status; below, check the models to expose, and they take effect the next time the selector is opened after saving.
- Stop generation: cancelling generation on the DSH side will kill the CLI process tree, avoiding orphan processes.
The configuration file path written by the panel is ~/.dsh-opencode-cli-bridge/config.json, which can also be edited manually. Example:
{
"models": {
"include": ["opencode/mimo*", "opencode/gpt*"],
"exclude": ["opencode/gpt-5-pro"]
}
}
Rules (matched against the full model id, patterns only support *):
- When
includeis non-empty, only matching items are shown; leaving it empty means all are allowed. excludehas the highest priority — any match is hidden.opencode-go/*is hidden by default; if needed, explicitly add it back ininclude.
Changes take effect immediately (the selector re-reads on every open); if the configuration is corrupted, it does not error — it falls back to defaults and logs diagnostics.
Reasoning effort: the plugin declares reasoning.efforts and passes reasoningEffort through to opencode run --variant; the README notes that free models may not respond to --variant in testing, so forwarding does not guarantee that the upstream will honor it.
Use Cases and Caveats¶
Who it is for
- Those who have already installed the OpenCode CLI on their machine and want to reuse the same set of models and login within DSH Web, without setting up an additional HTTP proxy or sidecar for DSH.
- Scenarios where you need DSH and OpenCode session alignment and multi-turn tool results to remain visible.
Security and privacy (key points from the README)
- It only calls the locally installed OpenCode CLI, and traffic goes directly from the local machine to the model upstream; the plugin side has no telemetry and no third-party analytics.
- The diagnostics directory
~/.dsh-opencode-cli-bridge/containsrequests.log,diagnostics.log, andsessions.json, with no API Key. - The forensic log
last-request.mdsaves the raw prompt text of the most recent request; if you are concerned, you can delete this file without affecting functionality.
Before installing
The plugin runs with the permissions of the current dsh process and will spawn the local opencode. Before installing, you should review the repository source code and the MIT license yourself to confirm compliance with your own compliance and intranet policies.
Conclusion¶
dsh-opencode-cli-bridge bridges DSH’s LLM requests to the local OpenCode CLI: a native LlmAdapter, session continuation and streaming display, with CLI detection and model filtering completed in the panel. If you are already using the OpenCode ecosystem, you can install it into your DSH 0.2.x Web configuration using the commands above and verify the opencode-bridge group.
- Directory page: https://www.skillhub.cn/plugins/home-river/dsh-opencode-cli-bridge
- GitHub: https://github.com/home-river/dsh-opencode-cli-bridge