dsh-quota-card
Manifest validShows ChatGPT, Gemini and Grok Bot remaining usage with reset countdowns plus the DeepSeek balance in a compact card above the sidebar account row; thresholds, refresh interval and per-provider HTTP p
额度卡片 · dsh-quota-card
在 DeepSeek Harness 侧栏底部、登录名上方显示四个服务的额度与余额:
| Provider | 展示内容 | 数据来源 | 需要 |
|---|---|---|---|
| ChatGPT | 每周剩余 % + 重置倒计时 | chatgpt.com/backend-api/wham/usage | ~/.codex/auth.json(运行过 codex login) |
| Gemini | 每周 / 5 小时剩余 % + 重置倒计时 | Google Cloud Code retrieveUserQuotaSummary | Antigravity 登录令牌 ~/.gemini/antigravity-cli/antigravity-oauth-token |
| Grok Bot | 每周剩余 % + 重置倒计时 | Cursor GetSandUsageStatus | Cursor 用户 API Key:CURSOR_API_KEY(~/.dsh/.env 或环境变量) |
| DeepSeek | 账户余额(¥) | DSH 已登录账号服务 deepseekAccount.getBalance() | 在 DSH 内登录 DeepSeek 账号 |
交互
- 刷新:默认 60 秒,页面隐藏时暂停;右上角 ↻ 立即刷新。
- 倒计时:每秒本地走表,来自各家真实重置时间;悬停行可看到全部窗口(如 Gemini 的每周 + 5 小时)。
- 颜色:剩余 ≤ 30% 变黄、≤ 10% 变红(可调);DeepSeek 余额默认 ≤ ¥10 变黄、≤ ¥3 变红。
- 齿轮设置(弹层,立即生效):
- 显示开关:关闭的 provider 不再请求;
- 刷新间隔:30 / 60 / 120 / 300 秒;
- 告警阈值:百分比与余额金额;
- HTTP 代理:全局 + 每个 provider 覆盖,留空 = 直连(例如
http://127.0.0.1:7890); - 恢复默认。
设置保存在浏览器 localStorage 的 dsh-quota-card:settings,不上传;代理 URL 只随取数请求发给本机 Host。
安全与隐私
- API Key、OAuth 令牌只在 Host 进程读取和使用,不进入浏览器;
- ChatGPT / Antigravity 的令牌只读,不写回登录文件;Grok Bot 使用 Cursor Key 换取短期访问令牌;
- 所有请求有 15 秒超时与错误脱敏;未知或失败显示「—」而不是 0。
已知限制
- ChatGPT、Grok Bot、Gemini 使用的是非公开接口,上游字段或鉴权变化时可能失效;此时卡片显示可读错误,不会伪造数字。
- Antigravity 的令牌若被系统钥匙串隔离,需要先导出一次:
security find-generic-password -s gemini -a antigravity-acp -w > ~/.gemini/antigravity-cli/antigravity-oauth-token - Grok Bot 的 Cursor Key 必须是 用户 key(不是
admin:*team key)。 - 余额与额度仅供参考,不是计费依据。
安装
需要 DSH 0.2.2 或更高版本(0.3.0 以下)。
# 从 npm 安装(推荐)
dsh plugin --profile <profile> add dsh-quota-card
# 或从本仓库目录安装(开发)
dsh plugin --profile <profile> add /absolute/path/to/dsh-quota-card
也可以直接在「插件 → 发现」中搜索 dsh-quota-card 一键安装。
安装后刷新页面;若新增 Host 代码则重启一次 DSH。
前置条件
| Provider | 一次性准备 |
|---|---|
| ChatGPT | 运行过 codex login(~/.codex/auth.json) |
| Gemini | Antigravity 登录令牌 ~/.gemini/antigravity-cli/antigravity-oauth-token(钥匙串导出见「已知限制」) |
| Grok Bot | Cursor 用户 API Key,写入 ~/.dsh/.env 的 CURSOR_API_KEY |
| DeepSeek | 在 DSH 内登录 DeepSeek 账号 |
新增一个 provider(例如 Muse)
框架无需改动,注册表会自动派生顺序、设置项与显隐:
- Host:在
index.js写一个fetchX(),返回标准行结构;然后在PROVIDER_ADAPTERS追加一行{ id: 'x', fetch: ... }。 - Client:在
client.js的PROVIDERS加一条{ name, badge, letter? };需要真实图标就在ICON_PATHS加路径(没有则自动用首字母兜底)。 - 其余全部自动生效:显示顺序、设置里的显隐与代理输入、阈值、倒计时、缓存、错误态、窄栏模式。
如果新 provider 的指标不是「剩余百分比」或「金额余额」(例如剩余次数),只需在客户端加一个 row kind 渲染分支,仍属局部改动。
图标与许可
- 代码:MIT
- ChatGPT / Gemini / DeepSeek 图标来自 Simple Icons(CC0 1.0);Grok Bot 使用官方 App 图标。各品牌商标归其所有者,此处仅用于识别对应的服务。
Comments
Loading…
Similar plugins
by pythoner1984
One-line notice at the top edge of the DSH window with your DeepSeek balance, the ChatGPT/Codex five-hour and weekly remaining quota and their reset times, and how many quota-reset cards are left plus
★ 0
MIT
JavaScript
Oct 30, 2026
dsh plugin --profile web add dsh-plugin-openai-quotaby Andrew111888
A floating credit/quota widget for the DeepSeek Harness Web: shows DeepSeek / OpenCode Go balances and usage, and tracks DSH session token usage and estimated cost by day, month, and model.
★ 6
↓ 371/wk
BSD-3-Clause
JavaScript
Aug 26, 2026
dsh plugin --profile web add dsh-plugin-balanceby changan0617
Floating DeepSeek account balance card for the dsh web UI: shows total, granted and topped-up balance per currency, refreshed every 60 seconds. Draggable and collapsible; the API key resolves from the
★ 0
MIT
JavaScript
Oct 18, 2026
dsh plugin --profile web add dsh-deepseek-balanceby Yochor-Debug
Floating DeepSeek API balance capsule for the DSH Web GUI: a corner pill shows the remaining balance, clicking expands the total, granted and topped-up breakdown, double-clicking refreshes at once and
★ 0
MIT
JavaScript
Sep 22, 2026
dsh plugin --profile web add dsh-plugin-balance-floatby gaolin89898
Sidebar widget that follows the session's current service and shows its plan quota or balance — OpenCode GO rolling, weekly and monthly windows with time bars, MiniMax usage, and DeepSeek, OpenRouter
★ 0
MIT
JavaScript
Nov 16, 2026
dsh plugin --profile web add @gl070900/dsh-usage-meterby wawo77
Plan-usage pet for the DSH web GUI: a floating skeletal-animated character reports quota in a speech bubble, auto-matching the configured provider (OpenCode Go, Command Code, DeepSeek) to show a plan
★ 4
↓ 167/wk
MIT
JavaScript
Sep 16, 2026
dsh plugin --profile web add dsh-opencode-go-usage