DeepSeek Harness 插件

dsh-opencode-usage-zzh799

OpenCode Zen + Go usage readout for the dsh web GUI: a composer button showing concentric rings (5h / weekly / monthly) that opens a usage panel.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
zzh799/dsh-opencode-usage
最近更新
2026年8月18日
分类
界面增强
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/zzh799/dsh-opencode-usage
插件名:dsh-opencode-usage-zzh799
作者:zzh799

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-opencode-usage

A dsh web GUI plugin that shows your OpenCode Zen balance and Go usage windows right in the composer tool row: a concentric-ring button (rolling 5h / weekly / monthly) that opens a usage panel.

  • Host half (src/index.tslib/index.js): resolves config from env

vars and $DSH_HOME/ocgo-usage.json, fetches the opencode.ai SSR pages, and serves same-origin JSON endpoints with caching + failure cooldown.

  • Browser half (src/client.tsxlib/client.js): renders the

concentric-ring composer button and usage panel, and the config editor (cookie values are only ever shown masked — the full cookie never leaves the host).

![button](./assets/CleanShot%202026-08-18%20at%2008.30.12@2x.png) ![panel](./assets/CleanShot%202026-08-18%20at%2008.30.04@2x.png)

Features

  • Rolling 5-hour / weekly / monthly usage rings on a single composer button
  • Usage panel with window details and a manual refresh
  • Built-in config editor in the panel (masked cookie tails only)
  • Smart cookie normalization: paste the raw auth token, a full header, or

anything in between

  • Server-side cache (default 5 min) + 60 s failure cooldown so the poller

never spams opencode.ai

  • Optional peak-clock display (showPeakClock)

Install

# From a local checkout (or a tarball), add into the dsh web profile:
dsh plugin --profile web add /path/to/dsh-opencode-usage

cordis.patch.yml inserts the plugin as opencode-usage; it requires the webServer service.

Configuration

Priority: env vars > config file ($DSH_HOME/ocgo-usage.json) > defaults.

Env varConfig file keyDefaultDescription
OPENCODE_GO_COOKIEcookieOpenCode Go session cookie (auto-normalized)
OPENCODE_GO_WORKSPACE_IDworkspaceIDOpenCode workspace id
OPENCODE_GO_BASE_URLbaseUrlhttps://opencode.aiProvider base URL
OPENCODE_GO_CACHE_TTLcacheTTL300Cache TTL in seconds, clamped to [60, 3600]
OPENCODE_GO_TIMEOUT_MStimeoutMs15000Fetch timeout in ms
showPeakClockfalseShow the peak-clock readout

The cookie is never logged. You can also edit cookie / workspaceID / showPeakClock from the panel's config editor; a successful write invalidates the cache so the next poll uses the fresh values immediately.

Config file is written with chmod 600.

API

The browser half talks to the host over plain same-origin JSON:

MethodPathDescription
GET/api/opencode-usageCached usage view
GET/api/opencode-usage/refreshForce a fresh provider query
GET/api/opencode-usage/configMasked config view
POST/api/opencode-usage/configWrite cookie / workspace / showPeakClock

Development

npm install      # dev deps (esbuild) — prepack build runs automatically
npm run build    # emit lib/client.js + lib/index.js
npm run watch    # hot-swap rebuilds into a running `dsh web` host

The build mirrors the dsh plugin loader contract: the browser bundle rides in the closure-factory module format with react/platform modules externalized, and CSS is inlined idempotently (data-plugin-css).

License

[MIT](./LICENSE)