Rainronin/dsh-balance-monitor ↗★ 2
@rainronin/dsh-balance-monitor
DeepSeek Harness 插件:DeepSeek API 余额实时监测(官方 /user/balance 快照 + ds_balance 工具 + 峰谷计价状态 + Matrix/原生双风格侧边栏徽章)
AI 分析
核心用途是多维度监测 DeepSeek 余额,支持会话内查询和侧边栏徽章显示。适合需要直观掌控 API 额度与计价状态的用户。
インストール
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Rainronin/dsh-balance-monitorドキュメント
README 全文を読む ↗Usage
In-session query — just ask the agent:
查一下 DeepSeek 余额 / check my DeepSeek balance
Sidebar badge — at the sidebar footer next to Settings: 刷新 force-refreshes
past the cache; polling follows the host-configured interval (30s by default);
the collapsed (rail) state shows a single status lamp (green = 连接正常,
amber = degraded). The 原生/矩阵 button switches between the Matrix CRT badge
and a native dsh style; the choice is remembered in localStorage.
Configuration
| Key | Default | Meaning |
|---|---|---|
apiKeyEnv | DEEPSEEK_API_KEY | Credential reference (env var name); change for a different account |
cacheTtlMs | 30000 | Cache lifetime in ms |
pollIntervalMs | 30000 | Background polling interval in ms |
injectEveryTurn | false | Whether to inject the balance into context every turn (opt-in; the badge and ds_balance tool are on by default) |
requestTimeoutMs | 5000 | Official-API request timeout in ms |
Override in the profile's cordis.patch.yml:
- id: balance-monitor
config:
cacheTtlMs: 10000
pollIntervalMs: 10000
使用
会话内查询——直接让 agent 查:
帮我查一下 DeepSeek 余额
侧边栏徽章——侧边栏底部(Settings 旁):刷新 按钮穿透缓存立即刷新;
轮询间隔跟随 host 配置(默认 30s);折叠态(rail)显示单色状态灯(绿 = 连接正常,
琥珀 = 异常)。原生/矩阵 按钮在 Matrix CRT 徽章与 dsh 原生风格之间切换,选择
保存在 localStorage。
配置
| 键 | 默认值 | 说明 |
|---|---|---|
apiKeyEnv | DEEPSEEK_API_KEY | 凭证引用名(环境变量名),多账号时改这里 |
cacheTtlMs | 30000 | 缓存有效期(毫秒) |
pollIntervalMs | 30000 | 后台轮询间隔(毫秒) |
injectEveryTurn | false | 是否每轮注入余额到模型上下文(默认关闭,按需开启) |
requestTimeoutMs | 5000 | 官方接口请求超时(毫秒) |
覆盖示例(profile 的 cordis.patch.yml):
- id: balance-monitor
config:
cacheTtlMs: 10000
pollIntervalMs: 10000