dsh-usage-glm-cn
v1.1.6
Published
DSH command plugin: /usage-glm-cn command and composer readout for your Z.ai / ZhipuAI GLM Coding Plan subscription quota usage
Maintainers
Readme
中文 · English
把智谱 BigModel / Z.ai GLM Coding Plan 订阅配额放进 DSH 对话界面:输入 /usage-glm-cn 查看完整报告;选中 GLM 模型时,输入框右下角常驻读条,每分钟自动刷新。切到其他模型自动隐藏。
- 右下角读条:
Rolling x% (倒计时) · Weekly x% (倒计时) · Peak / Off-peak 50% /usage-glm-cn命令:5 小时滚动窗口 + 周配额 + MCP 月度配额,各带重置倒计时- 峰谷提示:高峰 = 北京时间工作日 14:00–18:00(积分全额抵扣);其余时段(含周末全天)按基础积分 50% 抵扣,读条实时显示当前时段
- 密钥安全:只在 DSH 主机端解析,绝不进浏览器
- 邀请注册:BigModel.cn 新用户送 2000 万 Tokens,GLM-5.3 旗舰模型可试用
系列插件 / Family
同一套极简监控,覆盖五家服务商,格式统一(Rolling x% (倒计时) · Weekly …):
| 插件 | 服务商 | 监控内容 |
|---|---|---|
| dsh-usage-opencode-go | OpenCode Go | Rolling / Weekly / Monthly 配额 |
| dsh-usage-deepseek | DeepSeek | 账户余额 + 波峰/波谷 |
| dsh-usage-minimax-cn | MiniMax Coding Plan | coding / video 分服务配额 |
| dsh-usage-kimi-cn | Kimi Coding Plan | Rolling / Weekly 配额 |
| dsh-usage-glm-cn | Z.ai GLM Coding Plan | Rolling / Weekly / MCP 配额 + 峰谷时段 |
先决条件 / Prerequisites
- 已安装 DSH(Node.js >= 20):
npm install -g @deepseek-ai/dsh - 智谱 BigModel API Key,写入
~/.dsh/.credentials.yaml(与 GLM Coding Plan 所用 key 一致):
ZAI_CODING_CN_API_KEY: <你的 key>(或 export ZAI_CODING_CN_API_KEY=<key>;海外用户可 export ZHIPUAI_BASE_URL=https://api.z.ai 切到全球端点)
Install 安装
cd ~/.dsh/profiles
npm install dsh-usage-glm-cn --save --registry=https://registry.npmjs.org⚠️ 从旧版本(< 1.1.5)升级请注意:旧版的 peerDependencies 会让 npm 自动把旧版
@deepseek-ai/*核心包装进 profile 的 node_modules 根部,遮蔽宿主新版导致启动崩溃(registerFileReceiptResolver报错)。1.1.5 起已修复(全部标记为 optional peer)。如已中招:删掉 profile 下node_modules/@deepseek-ai和package-lock.json,再用 pnpm 重装;或改用下方dsh plugin --profile web add dsh-usage-glm-cn一键安装(推荐)。
然后在 ~/.dsh/profiles/web/cordis.patch.yml 追加:
- insert:
- id: glm-cn-usage
name: 'dsh-usage-glm-cn'重启 / 刷新 web GUI 生效。
# 一条命令装到 DSH(自动写 patch,幂等)
dsh plugin --profile web add dsh-usage-glm-cn
# git 安装
dsh plugin --profile web add github:jooey/dsh-usage-glm-cn
# 一键脚本
./install.sh # Linux / macOS
.\install.ps1 # WindowsUsage 使用
- 对话里输入
/usage-glm-cn→ 完整配额报告(含 MCP 月度配额) - 选中 GLM 模型 → 右下角读条出现
右下角读条:
Rolling 1.0% (4h 16m) · Weekly 19.0% (1d 17h 50m) · Off-peak 50%Troubleshooting
ZAI_CODING_CN_API_KEY is not configured—— 检查~/.dsh/.credentials.yaml- 读条不显示 —— 确认当前选中的是 GLM 模型,再硬刷新(
Ctrl+Shift+R)
English
Put your Z.ai / ZhipuAI GLM Coding Plan quota right inside the DSH conversation UI: type /usage-glm-cn for a full report, and while a GLM model is selected, a live chip sits in the bottom-right of the composer — auto-refreshed every minute. Hides itself automatically on other models.
- Composer chip:
Rolling x% (countdown) · Weekly x% (countdown) · Peak / Off-peak 50% /usage-glm-cncommand: 5-hour rolling window + weekly quota + MCP monthly quota, each with a reset countdown- Peak/off-peak hint: peak = Beijing weekdays 14:00–18:00 (100% point deduction); all other times, including weekends, deduct at 50% — the chip shows the live window
- Key safety: resolved host-side only, never inlined into the browser
- Invitation: BigModel.cn — 20M free tokens for new sign-ups, GLM-5.3 flagship included
Prerequisites
- DSH installed (Node.js >= 20):
npm install -g @deepseek-ai/dsh - A BigModel API key in
~/.dsh/.credentials.yaml(the same key used by the GLM Coding Plan):
ZAI_CODING_CN_API_KEY: <your key>(Set ZHIPUAI_BASE_URL=https://api.z.ai for the global endpoint.)
Install
cd ~/.dsh/profiles
npm install dsh-usage-glm-cn --save --registry=https://registry.npmjs.org⚠️ Upgrading from < 1.1.5? Older versions declared peer dependencies that made npm auto-install outdated
@deepseek-ai/*core packages into the profile's node_modules root, shadowing the newer host packages and crashing startup (registerFileReceiptResolvererror). Fixed since 1.1.5 (all marked optional peers). If affected: deletenode_modules/@deepseek-aiandpackage-lock.jsonin the profile, reinstall with pnpm — or usedsh plugin --profile web add dsh-usage-glm-cnbelow instead (recommended).
Then append to ~/.dsh/profiles/web/cordis.patch.yml:
- insert:
- id: glm-cn-usage
name: 'dsh-usage-glm-cn'Restart / refresh the web GUI to activate.
MIT License · Welcome a ⭐ Star!
