在 Harness Web UI 上悬浮显示 OpenCode Go 用量:5 小时滚动、每周与每月百分比、重置倒计时与续订日期,支持设备码登录与静默刷新。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:Assidefok/dsh-opencodego-status
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A floating overlay for the DeepSeek Harness Web UI that shows your OpenCode Go usage — the 5-hour rolling limit, the weekly limit and the monthly limit — at a glance.
The collapsed pill lives in the corner of the window and shows the three percentages with a colour dot per limit. Click it for progress bars, reset countdowns, the renewal date, and the sign-in controls.
What you get
- Collapsed pill —
5h · 7d · 30dpercentages, coloured by how close you are to the limit (brand → warning from 60% → error from 80%), plus the weekly reset countdown. - Expanded card — one progress bar per limit,
resets inandrenews incountdowns, Refresh, Sign out, and a link to the OpenCode console. - Device-code sign-in — connect from the overlay; the code is shown in the card and approved in the browser. No password is ever typed into the overlay.
- Silent token refresh — the stored session is refreshed before it expires.
- English and Chinese UI, following the Harness locale service.
- Theme-aware — every colour and border comes from the Harness theme tokens, so light and dark themes both look native.
The numbers come from the OpenCode Console Go subscription meters, the same source the console page itself renders.
Requirements
- DeepSeek Harness Web UI (
0.2.x). - An OpenCode Go subscription. The overlay reads the Go plan meters; it shows
Not connectedwhen no OpenCode session is stored, and an error state when the subscription is missing or the API changes.
Install
dsh plugin --profile web add github:Assidefok/dsh-opencodego-status
Then refresh the Harness Web UI. A small pill appears in the top-right corner.
Connect
- Click the pill, then Connect.
- The card shows a short code (for example
GNNM-XQHS) and an Open approval page button. Approve the device in the browser. - The overlay switches to your live usage as soon as the console confirms.
The session is stored locally at $DSH_HOME/opencodego-status/state.json with 0600
permissions ($DSH_HOME defaults to ~/.dsh). Sign out in the card deletes it.
Tokens are sent only to opencode.ai; the browser half never receives them.
Configuration
The bundle row in the Harness profile's cordis.patch.yml accepts:
- id: opencodego-status
name: dsh-opencodego-status
config:
enabled: true # hide the overlay without uninstalling the bundle
position: top-right # top-right | top-left | bottom-right | bottom-left
refreshSeconds: 60 # 15 – 3600
showResets: true # show reset countdowns
How it works
- The host half (
index.js) registers a prefix route at/api/opencodego-statusand talks to the OpenCode Console:<origin>/console/auth/device/code,<origin>/console/auth/device/token(device grant and refresh grant) and<origin>/console/api/go/status. - The client half (
client.js) registers one entry in theshell.overlayslot and polls/api/opencodego-status/status. It never sees an access token. - No dependencies, no build step: the client module is plain JavaScript and React comes from the Harness browser module table.
The console endpoint is not a documented public API. If OpenCode changes it, the overlay degrades to an error state with a Retry button instead of breaking the UI.
License
MIT — see LICENSE.
链接
同类插件
bowenliang123/dsh-context★ 5632
DeepSeek Harness 官方推荐的上下文洞察插件,透视上下文组成与演进,以及多 Agent 协作与通讯。提供跨会话的「上下文洞察」页(token、费用、缓存命中、活跃热力图、技能与工具加载)、会话内的「上下文」页签(构成、token 与耗时统计、时间线、浏览器、事件、文件活动、命令执行)、展示当前 Agent、其父级与全部子 Agent 的 Fleet 页签,以及 /context 命令。
Han-1413141/dsh-cost-meter★ 791
会话与当日 API 费用统计、预算图框(已用%)、官方余额、历史看板,支持峰谷计价与官方价格一键同步。
wssfk12138/dsh-damage-pulse★ 292
在 DSH Web 界面追踪 DeepSeek Token 用量、单次与会话费用及账户余额,并显示缓存感知的扣费动画。
zh667/TokenLedger★ 207
侧边栏用量面板:把 Token 归属到实际服务该请求的中转站,站点从已有的 provider 配置中读出,无需额外配置;含今日/本月/累计三窗口、按站点与模型下钻、一年活跃度热力图,以及 New API / Sub2API / DeepSeek 余额。
Ychris12138/dsh-usage-stats★ 195
多供应商用量看板:按供应商/模型统计 Token 与日期下钻,统一展示账户余额,并追踪 OpenCode Go / Z.ai 订阅额度。
Mt-Youya/dsh-plugins#sessions-insight★ 132
按工作目录浏览 Claude Code、DSH 和 Codex 会话日志,查看每轮上下文构成、token 用量、压缩点和费用估算。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。