跳到主要内容

dsh-opencode-cli

已验证

dsh-opencode-cli · v0.1.5 · MIT

Bridge OpenCode CLI free models into dsh (no OpenCode login needed) via an llm adapter

安装

dsh plugin add dsh-opencode-cli

dsh --profile default --dump-config 确认 layer 已生效 —— 参见安装指南

源码

标签

作者

说明文档

dsh-opencode-cli

Bridge the free OpenCode models into DeepSeek Harness through the local opencode CLI — no OpenCode login or API key required.

It registers an LLM adapter for the opencode-cli provider route. For each model turn it:

  1. Starts one shared opencode serve instance per process (in a temporary, locked-down project with the dsh-model agent, all tools denied).
  2. Creates a session via the server's HTTP API and streams the answer back over SSE (message.part.delta), so tokens appear in real time instead of waiting for the whole reply.
  3. Converts OpenCode's text output back into harness text, and <dsh_tool_call> markers into real harness tool calls (so tools run inside dsh, not OpenCode).

Free models

  • opencode/deepseek-v4-flash-free
  • opencode/mimo-v2.5-free
  • opencode/nemotron-3-super-free
  • opencode/big-pickle

The model list is auto-discovered from opencode models opencode at startup.

Install

Install the published package into a profile:

dsh plugin --profile web add dsh-opencode-cli

If add fails with ERR_PNPM_ADDING_TO_ROOT, add this line to profiles/web/pnpm-workspace.yaml (i.e. C:/Users/Windows11/.dsh/profiles/web/pnpm-workspace.yaml):

ignoreWorkspaceRootCheck: true

then run the command again.

Usage

Pick the opencode-cli provider in the model picker, or set it as the default in $DSH_HOME/settings.yaml:

agent-default-model:
  provider: opencode-cli
  model: opencode/deepseek-v4-flash-free

Configuration

Environment variable Description
DSH_OPENCODE_BIN Override the OpenCode executable path. Defaults to opencode.
DSH_OPENCODE_MODELS Comma/space-separated model list. Values without / are prefixed with opencode/.

Example:

DSH_OPENCODE_MODELS="opencode/deepseek-v4-flash-free,opencode/mimo-v2.5-free" dsh web

Notes and limitations

  • This is a CLI bridge, not a native provider. It runs a local opencode serve instance per process, so it is slower than an HTTP provider.
  • Tool calling is prompt-bridged via <dsh_tool_call> markers; it works for common cases but is less reliable than native tool-call protocols.
  • Text-only models.

License

MIT