dsh-opencode-cli-bridge: Using OpenCode-Compatible Models in DSH via Local OpenCode CLI

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.

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.

  1. Native adapter: a opencode-bridge group appears in the model selector; select a model and start chatting.
  2. 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.
  3. 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 reasoning blocks to avoid triggering DSH’s tool loop via tool-call, which would cause double execution).
  4. 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.
  5. 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.
  6. 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:

  1. Restart dsh web.
  2. Open the model selector — a opencode-bridge group should appear with models listed.
  3. 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

  1. Direct chat: select a model under opencode-bridge in the model selector.
  2. 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.
  3. 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 *):

  1. When include is non-empty, only matching items are shown; leaving it empty means all are allowed.
  2. exclude has the highest priority — any match is hidden.
  3. opencode-go/* is hidden by default; if needed, explicitly add it back in include.

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/ contains requests.log, diagnostics.log, and sessions.json, with no API Key.
  • The forensic log last-request.md saves 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
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye