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

v587d/dsh-opencode-go-usage

一个DeepSeek Harness(dsh)捆绑包,用于在Web GUI的编辑器停靠栏中显示OpenCode Go订阅使用情况——与内置对话统计行位于同一位置。

Project Overview项目介绍

This is a native bundle built exclusively for DeepSeek Harness (DSH), designed to show OpenCode Go subscription usage stats directly in DSH’s web UI. It adds a status chip to the dock area above the input box, displaying 5-hour rolling, weekly, and monthly usage percentage along with time remaining until the usage window resets. The chip changes color based on usage thresholds: yellow when usage hits 80%, and red when it goes over 90% or hits a rate limit. It also displays the timestamp of the last successful data fetch to help users check data freshness.

To install the bundle, you need DSH version 0.1.0-rc.6 or newer running with the web profile, and pnpm available on your system PATH. The recommended installation method is installing directly from GitHub via the command dsh plugin --profile web add github:v587d/dsh-opencode-go-usage. The repository ships pre-built artifacts in the lib/ directory, so no extra build step or build permissions are required after installation. It can also be installed from npm or a local tarball. After installation, you need to restart dsh web and refresh the browser page for the chip to appear.

Configuration can be done in three ways, the simplest being the in-ui Set panel accessed by clicking the status chip. You can also set credentials via environment variables or a local configuration file stored in $DSH_HOME/ocgo-usage.json. The plugin follows strict security practices: the OpenCode Go auth cookie is never exposed to the browser and only stored on the host side. It is released under the permissive MIT license, and the auth cookie expires after one year, so you just need to update it after it expires. Optional configuration options let you adjust cache TTL and API base URL.

这是一款专为 DeepSeek Harness (DSH) 开发的原生 bundle 插件,功能是在 DSH Web 界面输入框上方的 dock 区域(和内置令牌统计同位置)显示 OpenCode Go 的订阅用量。它支持展示 5 小时滚动、每周、每月三个窗口的用量百分比和重置倒计时,会根据阈值自动变色,在用量耗尽触发限流前提醒用户,是 pi-ocgo-usage Pi 插件的 Web 对应版本。

需要安装在 0.1.0-rc.6 或更新版本的 Web 配置档 DSH 上,系统要求 PATH 环境变量中提前配置好 pnpm 工具。安装方式推荐从 GitHub 直接安装,执行对应命令即可完成,也支持从 npm 或本地压缩包安装,无需额外权限。由于仓库已经提交了预构建产物,整个安装过程不需要额外执行构建步骤,流程十分简便。

配置支持三种方式,最简便的是界面内点击芯片展开后通过 Set 面板直接输入 workspace ID 和 cookie,也支持通过环境变量或配置文件填写。插件遵循安全规范,cookie 仅保存在 host 侧,浏览器不会获取到完整 cookie。项目采用 MIT 许可证开源,cookie 有效期为一年,过期后更新即可继续使用。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 note1 项提示
  • 10 stars - an early-stage project星标 10,属于早期项目
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 dsh-ocgo-usage

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

READMEREADME

dsh-opencode-go-usage

English | 中文

npm license: MIT awesome · DSH plugin

Footer demo

一个 DeepSeek Harness (dsh) bundle,在 Web 界面的输入框上方 dock(与内置 token 统计同位置)显示 OpenCode Go 订阅用量。

它是 pi-ocgo-usage(Pi 插件)的 Web 对应物:三个用量窗口(5h 滚动 / 每周 / 每月)的百分比与重置倒计时,按阈值变色,让你在窗口耗尽、请求被限流之前就发现。

OpenCode Go: 5h 0% (1h 23m) · wk 65% (2d 20h) · mo 83% (6d 21h) · upd 20:15

特性

  • 三个窗口 —— 5h 滚动 / 每周 / 每月 的百分比 + 重置倒计时
  • 颜色阈值 —— 正常 → 黄色警告(≥80%)→ 红色错误(≥90% 或已限流)
  • 数据新鲜度 —— upd HH:MM 显示最近一次成功抓取时间
  • 轻量轮询 —— 每 10s 轮询(切回标签页立即刷新);host 端 300s 缓存(TTL 可配)+ 60s 失败冷却,不会频繁打扰 opencode.ai
  • Provider 感知 —— 仅当会话当前模型走 opencode-go provider 时显示;每次轮询读取内存中的实时模型选择(session.models,毫秒级),切到 DeepSeek 官方等其它 provider 后一个轮询周期内自动隐藏,切回自动恢复(与 pi-ocgo-usage 行为一致)
  • 点击展开 —— 详情面板显示每个窗口的重置倒计时,左下角 Set 可配置凭据,右侧 refresh upd HH:MM 手动刷新
  • 内置凭据编辑器 —— 无需碰终端:Set 面板直接修改 workspace id 与 cookie(输入框以 •••• + 末尾 4 位显示,点击外部 / Esc / 保存确认写入)
  • 优雅降级 —— 配置缺失显示 <err:noconfig>,HTTP 失败显示 <err:httpXXX>;出错时点击 chip 直接进入 Set 面板
  • Cookie 只在 host 侧 —— 浏览器只访问同源 /api/ocgo-usage JSON 端点,cookie 永不进入页面

⚠️ 需要 OpenCode Go 会话 cookie。 该 cookie 是完整用户会话(不是 API key),可访问你 OpenCode 账户的全部内容。请像对待密码一样对待它——见 配置。

环境要求

  • DeepSeek Harness 0.1.0-rc.6 或更新(web profile)
  • PATH 上有 pnpm(dsh plugin 需要)

安装

这是一个标准的 dsh bundle:package.json 声明了 dsh.bundle,通过 dsh plugin --profile web add <spec> 安装(pnpm 转发器),自动加入 profile 的 dsh.profile.bundles。仓库内置预构建的 lib/ 产物,安装无需任何构建步骤或构建权限——遵循官方 publish 指南。

从 GitHub 安装(推荐)

dsh plugin --profile web add github:v587d/dsh-opencode-go-usage

因为 lib/ 已提交到仓库,pnpm 直接安装构建好的包,不会要求构建脚本授权。

从 npm 安装(发布后)

dsh plugin --profile web add dsh-ocgo-usage

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-mygo 下一个 Next dsh-answer-pet →