Shows GLM Coding Plan quota windows (5-hour, weekly, monthly tools) as an always-visible pill in the composer stats row with a 5h reset countdown, opening a card-grid detail panel with limits, reset times, 24h per-model token usage and one-click plugin self-update.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-glm-quota-dock
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Everglow28/dsh-glm-quota-dock
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
DeepSeek Harness (DSH) 插件:在会话输入框下方的统计行内,常驻一个 GLM Coding Plan 额度 pill,实时显示各窗口用量百分比。
A lightweight DeepSeek Harness plugin that shows your GLM Coding Plan quota as an always-visible pill in the composer stats row.
◔ GLM 5h 9% · 周 45% · 工具 7% · 🕐 2h 15m
截图
v1.3.2 双列卡片式详情面板(截图摄于 v1.3.1,24h 用量卡为展开态;v1.3.2 起该卡默认折叠,点击头部展开。Lite 档模拟数据、本地渲染,着色与布局与真实环境一致):
| 正常(<80%,绿/蓝) | 告警(≥80%,琥珀) | 临界(≥95%,红) |
|---|---|---|
![]() |
![]() |
![]() |
特性
- 实时额度:输入框统计行内常驻 pill,60 秒轮询(Host 下发,
minIntervalSec可调,下限 30 秒;首帧前本地 30 秒兜底);pill 百分比与详情卡片共用同一套强调色(5h 蓝#0B7FFF、工具紫#9E77ED、周窗口青、积分琥珀),≥80% 琥珀、≥95% 红同步覆盖 - 5h 重置倒计时:pill 末尾常驻 5 小时窗口的重置倒计时(悬浮看具体时刻),颜色跟随 5h 窗口;面板内 5h 卡片头部右侧展示倒计时
- 仅在 GLM 会话显示:通过会话的模型选择投影判断,只有当前会话走 Coding Plan 路由 且使用
glm-*模型时才渲染;纯 API 计费路由(消耗余额而非套餐)不会误亮,非 GLM 会话完全零请求 - 点击详情:双列卡片式面板 —— 每个窗口一张卡片(标题 + 大号百分比 + 右侧重置时刻 + 5px 粗进度条,正常态按卡片着色),绝对用量(如工具调用 7/100)与各模型明细折叠进卡片悬浮提示;24 小时用量卡默认折叠(只显示标题与 24h 总 token,点击头部展开小时级 token sparkline、按模型明细与调用次数;展开状态会话内记忆,刷新/新会话回到默认折叠),另有档位徽标(悬浮看套餐版本说明)、一键打开官方用量页、手动强制刷新
- 空闲降频:页面可见但 5 分钟无操作时自动降为 5 分钟一轮,恢复操作立即刷新;最小化/切走完全停止
- 插件版本与一键更新:面板页脚显示插件版本号(灰色小字,与套餐档位无关);每小时静默检查一次新版本(由 Host 经 pnpm 同源的 registry 查询,镜像/代理与安装一致;失败不打扰),有更新时出现「可更新」绿色药丸,点击弹出确认气泡,确认后由 Host 端执行 pnpm 自更新并自动刷新页面;若 Host 半部也随升级变更,页脚会提示「宿主待重启」(重启 DSH 后生效),反之页面落后于 Host 时提示「页面待刷新」;插件配置
enableSelfUpdate: false可关闭自更新入口 - 套餐版本自适应:V1(5h + 月度)、V2(含周窗口)、新版积分制均按响应字段自动识别展示,积分窗口也会出现在 pill 里(积分制用户不再只看到「GLM ·」),未知形状回退到「额度」段而不是空段
- 密钥不出本机:API Key 只在 Host 进程内解析与使用,浏览器仅拿到聚合后的百分比;路由挂在 DSH
/api信任栅栏与浏览器鉴权之后
要求
- DeepSeek Harness(Desktop 或
dsh web,建议较新版本) - 已在 DSH 模型页配置 GLM Coding Plan 供应商(如
zai-coding-cn),其 API Key 会通过凭据引用自动解析(默认ZAI_CODING_CN_API_KEY)
[!NOTE] 作者仅在 Lite 档(历史版本 V1:5 小时窗口 + 月度工具额度) 上实际验证过。V2(含周窗口)与新版积分制是按官方响应字段做的适配,逻辑上兼容但未经真机验证;如显示异常,欢迎提 issue 附上返回结构。
安装
插件零构建、零依赖,已发布到 npm,最简单的安装只需一条命令。
方式 A:npm(推荐)
dsh plugin --profile <你的profile> add dsh-glm-quota-dock
方式 B:让 DSH 会话里的 Agent 安装(任何 profile 通用)
把仓库地址交给 DSH 会话里的 Agent:
请用 plugin_manager 的 install_bundle 安装 https://github.com/Everglow28/dsh-glm-quota-dock
Agent 会克隆仓库并把 bundle 装进当前 profile,安装成功后按提示重启 DSH + 刷新网页即可。
方式 C:dsh CLI + git clone
git clone https://github.com/Everglow28/dsh-glm-quota-dock.git
dsh plugin --profile <你的profile> add <克隆目录的绝对路径>
方式 D:手动
把仓库克隆/复制到 ~/.dsh/profiles/<profile>/node_modules/dsh-glm-quota-dock/,并在该 profile 的 cordis.patch.yml 追加:
- insert:
- id: glm-quota-dock
name: 'dsh-glm-quota-dock'
config:
endpoint: https://open.bigmodel.cn
minIntervalSec: 60
安装后重启 DSH(Host 半部需要随进程加载),再刷新网页(Client 半部)。
配置
在安装时生成的 Cordis entry 的 config 下调整(改完重启):
| 字段 | 默认 | 说明 |
|---|---|---|
endpoint |
https://open.bigmodel.cn |
全球站用户改为 https://api.z.ai |
minIntervalSec |
60 |
上游最小请求间隔(秒),下限 30 |
apiKeyRef |
ZAI_CODING_CN_API_KEY |
凭据引用名(与模型页写入的引用一致) |
apiKey |
无 | 直接内联 key(不推荐,优先用凭据引用) |
registry |
读 npm 配置,缺省 https://registry.npmjs.org |
「可更新」检查用的 registry,应指向与 pnpm 安装一致的源 |
工作原理
凭据服务解析 API Key(与 zai-coding-cn 模型路由同一把 key)
│
▼
Host 半部调用官方监控端点(裸 key 鉴权,与官方 glm-plan-usage 一致):
GET {endpoint}/api/monitor/usage/quota/limit ← 各窗口百分比/重置时间
GET {endpoint}/api/monitor/usage/model-usage ← 近 24h 按模型用量
│ 60s 内存缓存 + 并发去重,手动刷新另加 5s 节流
▼
注册认证路由(DSH /api 信任栅栏 + 浏览器签名 cookie):
GET /api/glm-quota 聚合额度
GET /api/glm-quota/version 最新版本(经 pnpm,registry/代理与安装同源)
POST /api/glm-quota/update 一键自更新
│
▼
Client 半部:同源 fetch,60s 轮询(空闲降频,Host 下发周期),渲染 pill 与详情面板
数据来自智谱官方监控接口(与官方 glm-plan-usage 插件同源),轮询频率保守,不触碰任何非公开接口。
卸载
dsh plugin --profile <你的profile> remove "dsh-glm-quota-dock"
或让 Agent 调 plugin_manager remove_bundle。移除后重启 + 刷新页面。
常见问题
- pill 不显示? 确认当前会话使用的是 Coding Plan 路由下的 glm 模型;确认凭据引用已配置(面板报错时悬停 "GLM !" 可看原因);Host 半部改动需要重启而非刷新
License
Links
More in this category
bowenliang123/dsh-context★ 5628
DSH context insight panel: Context dashboard + /context command + Context browser — one-stop context lifecycle management with categorized composition, content details, evolution trends, compaction/injection events, and stats.
Han-1413141/dsh-cost-meter★ 774
Per-session and daily API cost, budget with usage %, official balance, history dashboard, and one-click official price sync with peak/off-peak pricing.
wssfk12138/dsh-damage-pulse★ 291
Tracks DeepSeek token usage, per-call and session costs, and account balance with cache-aware charge animations in the DSH Web UI.
zh667/TokenLedger★ 207
Sidebar usage panel that attributes tokens to the relay site that served each request, read from your existing provider config: today/month/all-time totals, per-site and per-model breakdowns, a year activity heatmap, and New API / Sub2API / DeepSeek balances.
Ychris12138/dsh-usage-stats★ 193
Multi-provider usage dashboard with provider/model token breakdowns, calendar drill-downs, account balances, and OpenCode Go / Z.ai subscription quota tracking.
PolinniZhong/dsh-personal-center★ 114
Personal center for DeepSeek Harness: cross-session usage statistics with per-provider and per-model breakdown (auto-discovers configured models), per-model cost estimation, global custom instructions, a data-driven desktop pet with bitmap & vector skins, and a conversation status overview, all local and offline.



Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.