WihteCo/dsh-opencode-go-quota ↗★ 0

dsh-opencode-go-quota

侧栏显示OpenCode Go多窗口用量配额 适合需要监控OpenCode Go 5小时、周、月度用量及重置倒计时的用户。

包名
dsh-opencode-go-quota
兼容性
待验证
版本
1.0.0
许可证
MIT
最近更新
2026年10月7日

同名包的其他仓库

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:WihteCo/dsh-opencode-go-quota

dsh-opencode-go-quota

English — OpenCode Go quota in the DeepSeek Harness sidebar foot, directly under the workspace/session list. One 42px cell shows the most constrained window; hovering or clicking opens a popover with the rolling 5-hour, weekly and monthly windows, each carrying a usage bar, an elapsed-time marker (so you can tell whether you are burning faster than the clock), the remaining share and a reset countdown. A Host half serves GET /api/opencode-go-quota from OpenCode's official usage endpoint (https://opencode.ai/zen/go/v1/usage) using the key already in the DSH credential store, so the key never reaches the browser. The collapsed 56px rail shows the percentage as a number.


在 DeepSeek Harness 网页版左侧边栏最底部(「工作区 / 会话列表」下方、与「设置」同排)显示 OpenCode Go 订阅额度的 DSH 插件。

显示内容

区域内容
展开的侧边栏一行 42px 的单元格:◯ OpenCode Go ………… 本月 18%。左边的小圆环本身就是进度指示,右边是最紧张那一档的已用百分比
收起的侧边栏(56px 竖条)一个 36px 圆形按钮,直接显示百分比数字
悬停 / 点击弹出一个 320px 浮层:每一档一行,含 6px 用量条、时间进度标记(窗口已经过去多少,用来判断你是用得比时间快还是慢)、剩余百分比与重置倒计时
浮层里的「刷新」立即重新拉取(绕过 Host 端 30 秒缓存)

浮层里每档的三行含义:

5 小时窗口                        已用 8%
▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   ← 填充=已用;竖线=时间进度
剩余 92%            时间已过 46%      2 小时 12 分钟后重置
  • 竖线在填充右边 → 你比时间用得慢,安全;竖线在填充左边 → 比时间快,要收着点。
  • 本月 的时间进度带 ≈,因为计费周期的起点不在接口里,是按「重置时间往前推一个自然月」估算的;5 小时窗口 和 本周 是精确值(5 小时 / 7 天)。

颜色:`


卸载:

plugin_manager action=remove_bundle target=dsh-opencode-go-quota


临时停用:`plugin_manager action=set_plugin target=opencode-go-quota enabled=false`。

安装后无需重启即可生效;若浏览器页面没有立刻出现,刷新一次页面即可。

## 排查

* 卡片显示红色错误文字:把鼠标停在上面看完整信息。
* `凭据 OPENCODE_GO_API_KEY 未配置` → 在「设置 → 模型」里给 `opencode-go` 填 API Key。
* `额度接口返回 401` → Key 失效或已轮换,重新填一次。
* 直接验证 Host 半边:

  ```bash
  curl -s http://127.0.0.1:19387/api/opencode-go-quota