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

xiaweiliang060035/dsh-opencode-go-usage

DSH(DeepSeek Harness)网页插件——悬浮小部件,实时显示每个API密钥的OpenCode Go订阅使用量(滚动/周/月)。悬浮实时展示opencode-go各密钥用量。

Project Overview项目介绍

This is a native DSH web-GUI plugin built exclusively for DeepSeek Harness that tracks OpenCode Go subscription quota usage in real time. It adds a compact floating button pinned to the right edge of your DSH web interface, with a color-coded badge that shows the worst quota status across all your OpenCode Go API keys at a glance. Green means all quotas are safe, orange means one is approaching limit, and pulsing red means one is exhausted. To install the plugin, you can either add it as a local file dependency after cloning the repo to your local machine, or install the published npm package directly to your DSH web profile.

After installation, the plugin automatically discovers your OpenCode Go API key pool by scanning the standard DSH credentials file at $DSH_HOME/.credentials.yaml for all entries matching the OPENCODE_GO_KEY_<name> pattern. If you do not have a key pool configured, it will fall back to displaying quota usage for your single active key stored in the OPENCODE_GO_API_KEY environment variable. It updates usage data every 60 seconds by default, but you can adjust the poll interval, timeout, and other settings in your DSH profile's configuration file. Clicking the floating button opens an expandable panel that shows detailed usage for each key, including reset countdowns and flags for exhausted quotas.

This plugin requires Node.js to be installed on your host machine, and it only works with the default DSH web profile that includes the webServer, credentials, and timer services. All your OpenCode Go API keys never leave your local DSH host, which keeps your credentials secure and private. The plugin automatically adapts to your DSH theme, working in both light and dark modes, and it supports both Chinese and English based on your browser's language setting. If you run into issues like missing widget or invalid key errors, check the troubleshooting section in the readme for common fixes and solutions.

这是一款面向DeepSeek Harness(DSH)的原生Web GUI插件,专门用于实时显示OpenCode Go订阅的使用配额情况。它会在DSH网页界面的右边缘添加一个固定悬浮的小部件,其徽章会用颜色编码直观显示所有API密钥中最紧张的配额状态,一眼就能掌握整体使用情况。点击这个小部件可以展开面板,为密钥池中的每个密钥分别展示滚动周期、每周、每月的使用占比、百分比和重置倒计时。

插件会自动扫描DSH标准凭证文件$DSH_HOME/.credentials.yaml,识别所有以OPENCODE_GO_KEY_开头命名的密钥,不需要用户手动硬编码密钥的数量或名称。如果没有配置密钥池,也会回退显示当前单个OPENCODE_GO_API_KEY的配额情况。插件默认每分钟从官方接口拉取一次最新数据,面板自动刷新,同时支持手动刷新,适合使用多个OpenCode Go密钥的DSH用户监控配额状态。

本插件依赖Node.js环境和DSH的Web配置文件,需要通过npm包或者本地文件依赖的方式安装到DSH的Web配置文件中。插件支持中英文双语,跟随浏览器语言自动切换,同时适配DSH的浅色和深色主题。它采用MIT许可证开源,用户可自定义轮询间隔、超时时间等参数,所有API密钥始终保存在本地,不会外传至第三方。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • 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 web add github:xiaweiliang060035/dsh-opencode-go-usage

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

READMEREADME

dsh-opencode-go-usage

简体中文 · English

A DeepSeek Harness web-GUI plugin that shows your OpenCode Go subscription usage in real time — a floating widget that tracks rolling / weekly / monthly quota for every API key in your pool, with color-coded progress bars and reset countdowns.

Features

  • Floating widget — a compact button pinned to the right edge of the page. Its badge shows the worst window across all keys at a glance; the color (green / orange / pulsing red) tells you whether any key is close to its quota limit.
  • Expandable panel — click the button to open a panel with one card per key (the currently active key is marked with a ★), each showing rolling / weekly / monthly usage as progress bars, percentages, and time-until-reset. Rate-limited windows are flagged with ⚠.
  • Real-time — the Host polls the official usage endpoint every 60 seconds (configurable); the panel refreshes automatically and has a manual refresh button.
  • Auto key-pool discovery — reads your key pool from $DSH_HOME/.credentials.yaml (any OPENCODE_GO_KEY_<name> entries), so there is no hardcoded key count or name. Falls back to the single current key (OPENCODE_GO_API_KEY) when no pool exists.
  • i18n — Chinese / English, auto-selected from your browser language.
  • Theme-aware — uses DSH theme tokens; works in both light and dark themes.

Screenshot

floating widget

How it works

Host half (plain Node ESM):

  1. Discovers key-pool names — from config.keyNames if provided, otherwise by scanning .credentials.yaml for OPENCODE_GO_KEY_* entries.
  2. Resolves each key value through the credentials service (environment → credentials file → .env layering).
  3. Calls the official usage endpoint with Authorization: Bearer <key>:
GET https://opencode.ai/zen/go/v1/usage
Authorization: Bearer <API_KEY>

Response example:

{
  "usage": {
    "rolling": { "status": "ok", "percent": 9,  "resetsAt": "2026-08-14T07:20:04.810Z" },
    "weekly":  { "status": "ok", "percent": 12, "resetsAt": "2026-08-17T00:00:00.810Z" },
    "monthly": { "status": "ok", "percent": 6,  "resetsAt": "2026-09-09T00:41:03.810Z" }
  }
}

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-CLI 下一个 Next mylife →