jiekesu967/dsh-plugin-opencode-usage
OpenCode Go 订阅用量悬浮面板:DeepSeek Harness Web 侧边栏显示滚动/每周/每月额度、已用与剩余额度。
Project Overview项目介绍
dsh-plugin-opencode-usage is a cordis plugin authored by jiekesu967 for the DeepSeek Harness (DSH) Web profile, distributed under the MIT license. Its single purpose is to register an isolated floating entry at the bottom-left corner of the DSH conversation window, then on click open a React panel that surfaces the user's OpenCode Go subscription usage across three windows (rolling, weekly, monthly), each card displaying used percent, remaining percent, and resets-at timestamp. Installation is performed with dsh plugin --profile web add dsh-plugin-opencode-usage, or alternatively from the GitHub repository or a local directory; after restarting dsh web and refreshing the page, the floating button becomes visible in the browser without taking any sidebar or input-box real estate.
The host half of the plugin resolves OPENCODE_GO_API_KEY via ctx.credentials.resolve, calls https://opencode.ai/zen/go/v1/usage with a Bearer header, and exposes the official percent plus resetsAt fields at GET /plugins/opencode-usage/stats, while the client half renders the panel anchored 12 px above the entry, capped at 392 px wide, with ResizeObserver following sidebar and detail-pane resizes. Auto-refresh runs every 60 s while open, the panel closes on Esc or outside click, and because the API only returns percentages the plugin deliberately avoids dollar conversions across differing model tiers. It is intended for DSH users who also hold an OpenCode Go subscription and want at-a-glance quota visibility inside the conversation surface.
Runtime dependencies are Node ^22.19.0 || >=24.0.0 plus @deepseek-ai/cordis ^4.0.2, @deepseek-ai/dsh-client-locale, dsh-client-ui-renderer, dsh-credentials, and dsh-host-webserver, all versioned >=0.1.5-rc.1 <0.2.0-0, with validation only against 0.1.5-rc.1 and rc.2; the plugin runs solely under the web profile (headless registers no route), and the stats route inherits the webserver bind address, defaulting to 127.0.0.1, so the API key must be present in ~/.dsh/.credentials.yaml or the Models/Credentials page before first use.
dsh-plugin-opencode-usage 是一款面向 DeepSeek Harness(DSH)Web profile 的 cordis 插件,由 jiekesu967 开发并以 MIT 协议开源。它唯一的目标是在 DSH 会话窗口左下角注入独立的悬浮入口按钮,点击后弹出 React 面板,展示 OpenCode Go 订阅的滚动、每周、每月三个窗口的用量百分比、剩余百分比与重置时间。安装方式为 dsh plugin --profile web add dsh-plugin-opencode-usage,也可从 GitHub 或本地路径装载,重启 dsh web 后即可在浏览器中看到入口。
典型流程:插件 host 半通过 ctx.credentials.resolve 解析 OPENCODE_GO_API_KEY,向 https://opencode.ai/zen/go/v1/usage 发起 Bearer 请求,将官方返回的 percent 与 resetsAt 暴露在 GET /plugins/opencode-usage/stats,再由客户端面板渲染并每 60 秒自动刷新,按 Esc 或点击外部关闭。目标用户是同时订阅 OpenCode Go 与 DeepSeek Harness、又希望在不打开外站的情况下随时核对额度的开发者。
依赖包括 Node 22.19 或 ≥24、@deepseek-ai/cordis ^4.0.2 及 dsh-client-locale、dsh-client-ui-renderer、dsh-credentials、dsh-host-webserver(均为 ≥0.1.5-rc.1 <0.2.0-0),仅验证 0.1.5-rc.1/rc.2;只适用于 web profile,headless 不注册路由,且该统计路由默认无鉴权,绑定 127.0.0.1,需在 ~/.dsh/.credentials.yaml 写入 API key。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-plugin-opencode-usage(jiekesu967/dsh-plugin-opencode-usage)
仓库:https://github.com/jiekesu967/dsh-plugin-opencode-usage
本站详情页:https://www.yhbd.top/plugins/jiekesu967-dsh-plugin-opencode-usage/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 2 · 最近提交 2026-09-30 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile desktop add dsh-plugin-opencode-usage
把 jiekesu967/dsh-plugin-opencode-usage 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-plugin-opencode-usage
OpenCode Go 订阅用量悬浮面板:在 DeepSeek Harness Web GUI 会话窗口左下角显示订阅额度使用情况。
功能
- 在会话窗口左下角注册独立悬浮入口,不占用侧边栏入口,也不放入输入框,避免与其他插件冲突
- 点击弹出悬浮面板,展示 OpenCode Go 订阅的三个窗口:滚动用量、每周用量、每月用量
- 每张卡片显示:已用百分比 / 剩余百分比 / 重置时间
- 不展示具体美元金额,避免不同模型额度金额不同造成误导
- 面板以入口按钮为锚点:左边缘对齐按钮,底部在按钮上方 12px,随会话窗口/侧边栏变化自动调整
- 打开期间每 60s 自动刷新;支持
Esc与点击面板外部关闭 - API key 只在 Harness host 进程内解析,不会下发浏览器
截图

工作原理
DSH Web 浏览器
│ 1. 点击会话窗口左下角按钮
▼
GET /plugins/opencode-usage/stats
│
▼
DSH Host 插件
│ 2. ctx.credentials.resolve("OPENCODE_GO_API_KEY")
│ 3. GET https://opencode.ai/zen/go/v1/usage
│ Authorization: Bearer <api-key>
│ 4. 透出 percent / remainingPercent / resetsAt
▼
返回 JSON,由 React 面板渲染
官方接口只返回 percent 与 resetsAt:
{
"usage": {
"rolling": { "status": "ok", "percent": 30, "resetsAt": "..." },
"weekly": { "status": "ok", "percent": 19, "resetsAt": "..." },
"monthly": { "status": "ok", "percent": 9, "resetsAt": "..." }
}
}
插件直接展示官方 API 返回的百分比,不做金额换算。
目录结构
dsh-plugin-opencode-usage/
├── cordis.patch.yml # bundle patch: 把插件插入 profile host 组合
├── lib/
│ ├── index.js # Host 半: 订阅额度 API 查询 + HTTP 路由
│ └── client.js # Client 半: 会话窗口左下角悬浮按钮 + 面板
├── LICENSE
├── package.json # dsh.bundle / dsh.client 元数据
└── README.md
额度口径(背景说明,不用于显示)
不同模型的额度金额不同(例如 V4 Pro 月度 $15、V4 Flash 月度 $30, 整体月上限 $60),因此插件只展示官方 API 返回的百分比,不做金额换算。
| 窗口 | 官方接口字段 | 说明 |
|---|---|---|
| 滚动用量 | usage.rolling |
5 小时滚动窗口百分比 |
| 每周用量 | usage.weekly |
每周窗口百分比 |
| 每月用量 | usage.monthly |
月度窗口百分比 |
官方 API 只返回 percent 与 resetsAt;插件同时给出 remainingPercent = 100 - percent。
安装
DSH 桌面应用用的是 desktop profile,命令行 dsh web 用的是 web profile,
先确认要装进哪一个。
桌面端(DeepSeek Harness 桌面应用):
dsh plugin --profile desktop add dsh-plugin-opencode-usage
命令行 Web(dsh web):
dsh plugin --profile web add dsh-plugin-opencode-usage
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
edison7009/EchoBird
Han-1413141/dsh-cost-meter
Ychris12138/dsh-usage-stats
wink-run/tokenbank
JingbiaoMei/Tokdash
slywalker2006/dsh-passwords
songoao25/dsh-bottom-info-bar
LiZhenNet/dsh-antigravity