xueayi/dsh-opencode-go-usage 预览 preview

xueayi/dsh-opencode-go-usage

DeepSeek Harness的OpenCode Go套餐用量监控器:在浮动网页底座中实时显示5小时滚动、每周及每月的配额用量

Project Overview项目介绍

This is a native DeepSeek Harness (DSH) plugin built exclusively to monitor OpenCode Go usage quota for DSH's web UI profile. To install the plugin from npm, run dsh plugin --profile web add @xueayi/dsh-opencode-go-usage, or install from a local checkout by replacing the package name with the path to your cloned repository. After installation completes, you will need to restart your DSH web profile by running dsh web to load the new plugin. Once installed and configured, it adds a floating dock to the web GUI that displays 5-hour rolling, weekly, and monthly quota windows along with live reset countdowns, pulling fresh data from OpenCode's official quota API.

After installation, the recommended configuration flow is to select the official-channel OpenCode Go provider in DSH Web Settings → Models, then enter your API key there; no further configuration is required. The plugin can also pull the API key from an environment variable (default OPENCODE_GO_API_KEY) or manually add it to your ~/.dsh/.credentials.yaml file if you prefer. You can adjust the auto-refresh interval, request timeout, and API endpoint via the plugin configuration to match your needs. The dock sits in the bottom-right corner by default, and you can drag it anywhere on the screen, with its position saved across page reloads.

The plugin does not expose any model-facing surface, so it does not add any extra prompt text, tools, or tokens to model requests, and it has no effect on KV cache. If a refresh request fails, the dock will keep displaying the last successfully fetched data to avoid blanking the display, with only a subtle status indicator to alert you of the error. Known limitations include poll latency, stale data after repeated failed refreshes, support for only one account per profile, and no safe-area inset for manually dragged positions. This plugin is released under the open-source MIT license.

这是一款专为DeepSeek Harness(DSH)开发的原生插件,用于监控OpenCode Go的使用配额。它会在DSH的网页GUI中添加一个浮动停靠面板,展示5小时滚动、每周、每月三个配额窗口的使用情况,同时提供实时的配额重置倒计时。插件通过OpenCode Go官方配额API拉取数据,仅需配置有效的API密钥即可正常运行。

安装时需要在DSH的web配置环境下执行安装命令,安装完成后重启web配置环境即可生效。推荐用户在DSH网页设置的模型选项中选择官方渠道的OpenCode Go服务商,填入API密钥即可完成配置,无需额外手动修改配置文件。API密钥支持从环境变量或凭据文件读取,也支持直接手动填入密钥。

停靠面板支持折叠展开、自由拖动,位置会保存在本地存储中,还支持极简模式切换。插件不会向模型注入任何额外内容,不会影响token占用或KV缓存。已知限制包括轮询存在延迟、仅支持单账号、拖动后位置不保留安全边距等,项目采用MIT许可证开源。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 4 stars - very few users, little community feedback星标只有 4,几乎没人在用,遇到问题缺少社区反馈
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 web add @xueayi/dsh-opencode-go-usage

把 xueayi/dsh-opencode-go-usage 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-opencode-go-usage

OpenCode Go plan usage monitor for DeepSeek Harness: a floating dock in the web GUI showing the 5h-rolling / weekly / monthly quota windows with live reset countdowns.

Data comes from the official quota API (GET https://opencode.ai/zen/go/v1/usage, Bearer API key; no workspace id, no cookie).

Install

# From npm (the Web GUI runs on the `web` profile):
dsh plugin --profile web add @xueayi/dsh-opencode-go-usage
# Or from a local checkout:
dsh plugin --profile web add /path/to/dsh-opencode-go-usage
# Upgrade to the latest version:
dsh plugin --profile web update @xueayi/dsh-opencode-go-usage

Restart the profile afterwards (dsh web for the browser UI).

Configure

Recommended: pick the official-channel OpenCode Go provider in Web Settings → Models and enter the API key there; nothing else is needed.

The API key is resolved per refresh through ctx.credentials under the apiKeyEnv reference (default OPENCODE_GO_API_KEY) — it can also be stored manually in ~/.dsh/.credentials.yaml or an environment variable:

- insert:
    - id: opencode-go-usage
      name: '@xueayi/dsh-opencode-go-usage'
      config:
        apiKeyEnv: OPENCODE_GO_API_KEY
        refreshMs: 60000
Field Type Default Meaning
apiKeyEnv string OPENCODE_GO_API_KEY credential reference
apiKey string — direct key fallback (discouraged)
endpoint string https://opencode.ai/zen/go/v1/usage quota endpoint
refreshMs number 60000 auto-refresh interval
timeoutMs number 10000 per-request timeout

Usage dock

Usage dock screenshot

A glassy floating dock at the bottom-right corner (the web shell owns no bottom-right slot; mounted through a body portal):

  • Badge (collapsed): three mini double rings show all three quota windows at a glance — the outer ring is the remaining quota share (a full ring when nothing is used yet, shrinking as quota is spent; the arc is threshold-colored by spent share: green <60% / orange ≥60% / red ≥85%, so a nearly-empty ring reads red), the inner ring is the window's remaining time until its next reset (brand blue, shrinking live with the window period); beside them an exact 5h-rolling countdown (↻3h25m) and a live health dot.
  • Panel (click to expand): one row per window (5h Rolling / Weekly / Monthly) with a double usage ring (remaining quota outer + remaining time inner), the used/remaining percent (preceded by a tone-colored dot: green/amber/red for the spent share, a blue dot before the reset countdown restating the inner ring color), and a live reset countdown; the footer holds the update timestamp, a "Console ↗" link to the OpenCode Go console, and a manual refresh button.
  • Dragging: grab the badge and drop it anywhere on screen (the press only becomes a drag after ~4px of pointer travel, so a plain click still toggles the panel); the position persists in localStorage across reloads and is clamped back inside the viewport on window resize. The open panel follows the badge and auto-flips — below it when the top would clip, left-aligned when the badge sits near the left edge — so it always stays fully visible.
  • Minimal mode: the panel header carries a "极简" (minimal) switch. When enabled, the whole dock collapses to a single 5h-rolling ring — the badge keeps just one 5h double ring at the regular mini size (remaining quota outer, remaining time inner) with the remaining percent centered inside; no countdown, labels, or health dot. The panel keeps only the 5h-rolling row; the preference persists as well.
  • Unconfigured/error states render inline with configuration guidance; a failed fetch never blanks the dock.

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-neo-skin 下一个 Next dsh-model-failover →