DeepSeek Harness 插件

dsh-opencode-usage-syamstud

OpenCode usage widget for the DeepSeek Harness web sidebar: host-side proxy to the OpenCode usage API (keeps OPENCODE_API_KEY off the page) plus a client-side bars widget.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
SyamStud/dsh-opencode-usage
最近更新
2026年8月18日
分类
模型与服务商
GitHub stars
1
载体类型
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/SyamStud/dsh-opencode-usage
插件名:dsh-opencode-usage-syamstud
作者:SyamStud

检查来源文件

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

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

<div align="center">

dsh-opencode-usage

OpenCode usage widget for the DeepSeek Harness (DSH) web sidebar

Monitor your OpenCode plan limits — rolling, weekly, and monthly — with live progress bars in the DSH web sidebar footer.

!DSH

</div>

---

Features

  • Live usage barsRolling, Weekly, and Monthly limits rendered as color-coded progress bars (red at or above 90%, amber at or above 70%, blue otherwise).
  • Human-readable resets — countdowns such as resets in 5d 19h instead of raw ISO timestamps.
  • Sidebar footer widget — a compact OpenCode Usage button that opens an anchored popover with one bar per window and a manual Refresh action.
  • Native look & feel — mirrors the built-in Settings trigger (height, radius, hover states, theme tokens) and collapses to a circular icon in the compact rail.
  • Secure by design — the API key never reaches the browser. A host-side proxy keeps the secret, so there is no CORS exposure and no leaked credentials.

Requirements

  • A DeepSeek Harness (dsh CLI) installation with the web profile enabled — the widget registers into the web sidebar.
  • Node.js ≥ 18 (uses the global fetch API).
  • An OpenCode account, or an existing OpenCode sign-in on the host machine (see [API key setup](#api-key-setup)).

Installation

Install the plugin into the web profile. The dsh plugin command forwards to pnpm in the profile directory and appends the package to dsh.profile.bundles automatically:

dsh plugin --profile web add https://github.com/SyamStud/dsh-opencode-usage.git

To use a local checkout instead:

git clone https://github.com/SyamStud/dsh-opencode-usage.git
dsh plugin --profile web add ./dsh-opencode-usage

Then restart the web app:

dsh web

In the browser, hard-refresh with Ctrl+Shift+R so the latest client bundle is served. The OpenCode Usage button appears in the sidebar footer.

API key setup

In most cases no setup is required. If OpenCode is already connected — for example when the DeepSeek Harness is wired to the OpenCode provider and you are signed in — the plugin auto-discovers the key from OpenCode's auth file (~/.local/share/opencode/auth.json) and works immediately.

If the host has no OpenCode sign-in, set the key explicitly:

# Linux / macOS
export OPENCODE_API_KEY="sk-…"
dsh web

# PowerShell (Windows)
$env:OPENCODE_API_KEY = "sk-…"
dsh web

The key is read once on the host and is never exposed to the browser — not in the page, and not in any proxied response.

Usage

1. Run dsh web and refresh the browser. 2. In the sidebar footer, click OpenCode Usage (next to Settings). 3. The popover shows three bars: - Rolling — e.g. 29% · resets in 1h 50m - Weekly — e.g. 13% · resets in 5d 19h - Monthly — e.g. 7% · resets in 28d 0h 4. Use Refresh to re-fetch on demand, or click outside the popover to close it.

Preview

Sidebar footerPopover with usage bars
Button sits next to Settings at the bottom of the sidebar and collapses to a round icon in the 56px rail.Clicking the button opens an anchored panel showing the three limits and their reset times.

Development

The plugin ships without a build step — source edits are picked up on a page refresh, with no reinstall.

git clone https://github.com/SyamStud/dsh-opencode-usage.git
cd dsh-opencode-usage
dsh plugin --profile web add ./dsh-opencode-usage

Edit:

  • dsh/index.js — host-side proxy, key resolution, routes.
  • dsh/client.js — the sidebar widget and usage popover.

Validate syntax before reloading:

node --check dsh/index.js
node --check dsh/client.js

Project layout

dsh-opencode-usage/
├── package.json        # DSH manifest (dsh.bundle / dsh.client), exports
├── cordis.patch.yml    # bundle patch that mounts the plugin as "opencode-usage"
├── README.md
└── dsh/
    ├── index.js        # host half: key discovery, upstream proxy, routes
    └── client.js       # client half: sidebar widget + usage popover