DeepSeek Harness plugin

dsh-opencode-go-autosync

Sync opencode-go models from https://models.opencode.ai/api.json into llm-pi-ai provider opencode-go-autosync (one-click create/update in settings).

Jump to install

Source facts

Repository
CJYLZS/dsh-opencode-go-autosync
Latest update
Aug 20, 2026
Category
Tools & Capabilities
GitHub stars
1
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/CJYLZS/dsh-opencode-go-autosync
Plugin: dsh-opencode-go-autosync
Author: CJYLZS

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer2 files
README.mdSource · read only

dsh-opencode-go-autosync

DeepSeek Harness 插件:一键把 models.opencode.ai/api.jsonopencode-go 模型目录同步为 DSH 模型供应商 opencode-go-autosync

已有 opencode-go-autosync 时只刷新模型列表;不存在时一键创建,无需手动更新 settings.yaml

为什么需要它

DSH 的 llm-pi-ai 通过 @earendil-works/pi-ai 的内置目录提供 opencode-go 供应商,其模型列表是 打包时 的静态快照(dist/providers/data/opencode-go.json,当前 19 个模型),只有随 pi-ai 发版、再随 DSH 升级才会更新。

而上游 https://models.opencode.ai/api.json 是动态目录(当前 opencode-go 28 个模型,持续新增/下线),二者会随时间产生缺口:新模型在设置页选不到,已下线模型的 contextWindow / reasoningEfforts 也可能过时。llm-pi-ai 文档亦明确标注 *A route's catalog never refreshes itself*,discoveryGET /models 也只返回 id,拿不到 contextWindow / reasoningEfforts / compat 等富元数据,因此否则需要手动维护 settings.yaml 中的模型列表。

本插件把这一转换搬进运行时:设置页一个按钮(可选定时)fetch(api.json) → 映射 → mutate llm-pi-ai.providers.opencode-go-autosync,首次创建自定义供应商并写入 api / baseURL / compat / apiKeyEnv,之后仅覆盖 models,保留你已配的密钥与地址,从此无需手动更新。

---

功能

  • 一键创建/更新:设置页按钮读取上游 https://models.opencode.ai/api.jsonopencode-go,写入 llm-pi-ai.providers.opencode-go-autosync
  • 只动模型列表:已存在供应商时,仅覆盖 models,保留你配过的 apiKeyEnv / baseURL / compat 等字段。
  • 完整字段映射limit.context→contextWindow / limit.output→maxTokens / modalities→input / reasoning+reasoning_options→reasoningEffortsnone→off:none,其余直通;非推理模型写 reasoningEfforts: false)。
  • 可选自动同步:配置 autoSync: true 后每 6 小时(可配)自动刷新一次。

安装

前置

  • DSH 已安装(pnpm dsh --help 可用),profile 建议 web

从 GitHub 安装

pnpm dsh plugin --profile web add github:CJYLZS/dsh-opencode-go-autosync

或先克隆再本地安装(注意 ./):

git clone https://github.com/CJYLZS/dsh-opencode-go-autosync.git
pnpm dsh plugin --profile web add file:./dsh-opencode-go-autosync
# 也可用绝对路径:pnpm dsh plugin --profile web add file:/abs/path/to/dsh-opencode-go-autosync

安装后重启 DSH:

pnpm dsh --profile web

卸载:

pnpm dsh plugin --profile web remove dsh-opencode-go-autosync

使用

1. 打开 DSH 设置页 → Plugins,找到 Opencode Go 同步 卡片。 2. 点 一键创建/更新。首次会创建 opencode-go-autosync,再次点击仅刷新模型列表。 3. 预览上游 可不落盘查看上游模型数。

> 目标供应商名默认为 opencode-go-autosync,可在插件配置中改为任意名字(如 opencode-go-custom)。

API Key 配置

本插件不存密钥,只把供应商的 apiKeyEnv 指向一个环境变量名,密钥由 DSH 凭据体系解析。

1. 设置供应商的凭据引用

  • 设置页:模型 → 选中 opencode-go-autosyncapiKeyEnvOPENCODE_API_KEY(或 OPENCODE_GO_CUSTOM_API_KEY 等自定义名)。
  • 或直接编辑 ~/.dsh/settings.yaml
llm-pi-ai:
  providers:
    opencode-go-autosync:
      apiKeyEnv: OPENCODE_API_KEY
      api: openai-completions
      baseURL: https://opencode.ai/zen/go/v1
      compat:
        thinkingFormat: openai
        supportsReasoningEffort: true

插件首次创建时会自动写入上述 api / baseURL / compat / apiKeyEnv 默认值(apiKeyEnv 取上游 env[0],默认为 OPENCODE_API_KEY)。

2. 写入密钥值

任选其一(优先级:设置凭据 > 环境变量):

  • 推荐:DSH 设置页的凭据/密钥管理中,为 OPENCODE_API_KEY 填入真实 key(存入 ~/.dsh/.credentials.yaml,设置页脱敏显示)。
  • 或在启动 DSH 的环境中导出:
export OPENCODE_API_KEY="sk-..."
pnpm dsh --profile web
  • 或写入 ~/.dsh/.env / 项目 .env(被 loadLayeredEnv 载入):
OPENCODE_API_KEY=sk-...

验证:设置页中该供应商显示已配置;对话选 opencode-go-autosync 下任意模型可正常出流。

插件配置

cordis.patch.ymlopencode-go-syncconfig

字段默认说明
sourceURLhttps://models.opencode.ai/api.json上游目录地址
sourceProvideropencode-go上游 JSON 中的 provider key
targetProvideropencode-go-autosync写入 llm-pi-ai.providers.<key> 的目标名
targetApiKeyEnv上游 env[0]覆盖目标的 apiKeyEnv(不设则用上游默认值)
targetBaseURL上游 api覆盖目标的 baseURL
targetCompat{thinkingFormat: openai, supportsReasoningEffort: true}覆盖目标的 compat
extraIds[]额外保留的私有模型 id(如 hy3-preview),上游没有时仍以空条目写入
autoSyncfalse是否定时自动同步
autoSyncIntervalMs21600000 (6h)自动同步间隔,最小 60s

示例(profiles/web/cordis.patch.yml 覆盖):

- id: opencode-go-sync
  config:
    extraIds: [hy3-preview, muse-spark-1.2]
    autoSync: true
    autoSyncIntervalMs: 43200000

常见问题

  • file:.tmp/... 安装失败 LINKED_PKG_DIR_NOT_FOUND:本地路径必须带 ./,写 file:./.tmp/...file:/abs/...
  • 上游拉取失败:按钮会回显 sync-failed: HTTP ...,检查网络或 sourceURL
  • 密钥未生效:确认 apiKeyEnv 指向的变量名与凭据/环境变量一致,且 DSH 已重启载入。

许可

MIT