← 返回列表
未验证
在侧边栏实时查看 OpenCode 套餐限额与重置倒计时
尚未跑自动兼容性验证,可查看页面内的依赖与入口分析。 · 最近上游提交 2026/8/18 · 已提供中文文档
DeepSeek Harness 网页侧边栏的 OpenCode 使用情况小组件。以进度条形式实时显示滚动、每周和每月的套餐限额。
综合分
27.8
GitHub 分
27.8
用户评分
—
★ Stars
1
周下载量
—
安装插件(需先安装 dsh CLI 引擎:npm install -g @deepseek-ai/dsh)
dsh plugin --profile web add SyamStud/dsh-opencode-usage该插件未发布到 npm,走 GitHub 源安装(pnpm 若拦截 prepare 脚本,按其提示在 pnpm-workspace.yaml 的 allowBuilds 中放行后重跑)
数据截至 2026/9/16(元数据每日更新 · 实装验证按队列轮转,单条结论的验证时间见上方)
用户评分
还没有人投票,来当第一个
订阅周报,不错过优质插件更新
每周一封 · 高评分插件 + 新用户活动
README
dsh-opencode-usage 用于 DeepSeek Harness (DSH) Web 侧边栏的 OpenCode 用量小组件 在 DSH Web 侧边栏页脚中,通过实时进度条监控你的 OpenCode 套餐限额——滚动、每周和每月。 DSH 功能特性 - 实时用量条 — Rolling、Weekly 和 Monthly 限额以颜色编码的进度条呈现(达到或超过 90% 时为红色,达到或超过 70% 时为琥珀色,其他情况为蓝色)。 - 人类可读的重置时间 — 使用 resets in 5d 19h 这样的倒计时,而不是原始的 ISO 时间戳。 - 侧边栏页脚小组件 — 一个紧凑的 OpenCode Usage 按钮,点击后打开一个锚定弹出框,每个窗口显示一条进度条,并提供手动 Refresh 操作。 - 原生外观与体验 — 与内置的 Settings 触发器保持一致(高度、圆角、悬停状态、主题令牌),并在紧凑栏中折叠为圆形图标。 - 安全设计 — API 密钥永远不会到达浏览器。主机端代理保管密钥,因此不存在 CORS 暴露,也不会泄露凭据。 环境要求 - 已启用 web profile 的 DeepSeek Harness(dsh CLI)安装——该小组件会注册到 Web 侧边栏中。 - Node.js ≥ 18(使用全局 fetch API)。 - 一个 OpenCode 账户,或主机上已有的 OpenCode 登录(参见 API 密钥设置)。 安装 将插件安装到 web profile 中。dsh plugin 命令会转发到 profile 目录中的 pnpm,并自动将包追加到 dsh.profile.bundles: dsh plugin --profile web add https://github.com/SyamStud/dsh-opencode-usage.git 如果要改用本地检出: git clone https://github.com/SyamStud/dsh-opencode-usage.git dsh plugin --profile web add ./dsh-opencode-usage 然后重启 Web 应用: dsh web 在浏览器中,使用 Ctrl+Shift+R 强制刷新,以便加载最新的客户端 bundle。OpenCode Usage 按钮会出现在侧边栏页脚中。 API 密钥设置 大多数情况下无需任何设置。如果 OpenCode 已经连接——例如当 DeepSeek Harness 已接入 OpenCode 提供商并且你已登录——插件会自动从 OpenCode 的认证文件(~/.local/share/opencode/auth.json)中发现密钥并立即生效。 如果主机上没有 OpenCode 登录,请显式设置密钥: Linux / macOS export OPENCODE_API_KEY="sk-…" dsh web PowerShell (Windows) $env:OPENCODE_API_KEY = "sk-…" dsh web 密钥在主机上读取一次,并且永远不会暴露给浏览器——既不会出现在页面中,也不会出现在任何代理响应中。 使用方法 1. 运行 dsh web 并刷新浏览器。 2. 在侧边栏页脚中,点击 OpenCode Usage(位于 Settings 旁边)。 3. 弹出框会显示三条进度条: - Rolling — 例如 29% · resets in 1h 50m - Weekly — 例如 13% · resets in 5d 19h - Monthly — 例如 7% · resets in 28d 0h 4. 使用 Refresh 按需重新获取,或点击弹出框外部将其关闭。 预览 | 侧边栏页脚 | 带用量条的弹出框 | | --- | --- | | 按钮位于侧边栏底部的 Settings 旁边,在 56px 宽的边栏中会折叠为圆形图标。 | 点击该按钮会打开一个锚定面板,显示三项限制及其重置时间。 | 开发 该插件无需构建步骤即可发布——源码修改在页面刷新后即可生效,无需重新安装。 git clone https://github.com/SyamStud/dsh-opencode-usage.git cd dsh-opencode-usage dsh plugin --profile web add ./dsh-opencode-usage 编辑: - dsh/index.js — 宿主端代理、密钥解析、路由。 - dsh/client.js — 侧边栏小组件和用量弹出框。 重新加载前验证语法: node --check dsh/index.js node --check dsh/client.js 项目结构 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
扫码进群