Bundle
dsh-opencodeproxy
DSH plugin: manage the local opencode-free-proxy service from the Web settings — start/stop toggle, auto-start with dsh, model-list refresh, and connectivity test.
- Source
- infexpense
- License
- MIT
- Updated
- Updated 2 days ago
Readme
# dsh-opencodeproxy DSH(`dsh web`)插件:在设置页管理本地 [opencode-free-proxy](https://github.com/bigdata2211it-web/opencode-free-proxy) 服务。 代理本身会自动从 OpenCode Zen API 获取模型列表(`big-pickle` + 所有 `-free` 后缀模型),本插件负责服务的启停与状态展示。 ## 设置页功能 | 功能 | 说明 | |------|------| | 切换开关 | 打开=启动代理服务;关闭=停止代理服务(外部启动的进程通过 `/admin/shutdown` 停止) | | 随 dsh 启动 | dsh 启动时若开关为开启状态,自动拉起代理服务 | | 切换启动时刷新 | 打开开关成功后自动向代理请求一次上游模型刷新 | | 刷新模型列表 | 手动触发代理的 `/admin/refresh-models`,并展示当前模型 | | 连通性测试 | 依次测 `/health` 与 `/v1/models`,显示延迟与模型数量 | 另有可配置项:代理目录(默认 `D:\DevTime\gloal-workspace\opencode-free-proxy`)与端口(默认 `6446`),运行中修改会自动重启服务。 ## 安装 本插件通过 `dsh plugin --profile web add <路径>` 以 pnpm `link:`(符号链接)安装。源码目录里的 `node_modules/@deepseek-ai/schemastery` 是指向 profile 内真实包的目录联接(junction)。 从 GitHub 安装(克隆后指向本地路径): ```bash git clone https://github.com/infexpense/dsh-opencodeproxy.git dsh plugin --profile web add /path/to/dsh-opencodeproxy dsh web ``` 本地开发时直接指向工作区路径亦可: ```bash dsh plugin --profile web add D:\DevTime\gloal-workspace\dsh-opencodeproxy dsh web ``` 设置持久化在 `~/.dsh/settings.yaml` 的 `opencodeproxy:` 段(`enabled` / `autoStart` / `proxyDir` / `port`)。 ## 行为细节 - 端口上已有代理在跑(无论谁启动的)时打开开关:直接接管显示,不重复启动。 - dsh 退出时只清理本插件拉起的子进程;外部启动的代理不受影响。 - 停止外部代理需要读取代理目录下 `api-keys.json` 的 `admin` key。 - 代理进程启动后需要几秒完成上游模型抓取,期间 `/v1/models` 返回回退列表,稍后自动更新为实时列表。 ## 本地开发说明 本包通过 `dsh plugin --profile web add <路径>` 以 pnpm `link:`(符号链接)安装。Node 按真实路径解析依赖, 因此源码目录里的 `node_modules/@deepseek-ai/schemastery` 是指向 profile 内真实包的目录联接(junction), 删除它会导致 dsh 启动时插件加载失败(`Cannot find package '@deepseek-ai/schemastery'`)。 修改 `lib/index.js` 后需重启 `dsh web`;`lib/client.js` 由客户端加载。
Install
dsh plugin --profile web add github:infexpense/dsh-opencodeproxy
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install dsh-opencodeproxy from the hub
- This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.