Claude Code status line

Glm Quota Line

A lightweight CLI for showing GLM Coding Plan quota in the Claude Code status line.

33 stars 7 forksStatus lines Source

Install

Install
npx glm-quota-line

Found in the project README. Check it for setup steps after installing.

From source
git clone https://github.com/deluo/glm-quota-line.git

From the README

glm-quota-line

  为 Claude Code 打造的智谱 GLM Coding Plan 配额监控工具
  让你专注编码而不用频繁切换窗口检查配额

  English

核心价值

数据精准同步官网 → 状态栏实时显示 → 智能配速警示

安装后,Claude Code 底部状态栏会自动显示配额:

一眼看清:
- 套餐剩余量(91%)和进度条
- 周配额消耗情况(47%)+ 理论预算阴影(▒)
- 距离重置时间(14:47)
- 上下文窗口用量(45%)

超速时自动变色警示,避免配额耗尽中断工作流。

30 秒快速开始

一次性查询(无需安装):

状态栏集成(推荐):

安装完成。可以随时在终端运行 glm-quota-line 快速查看用量,无需启动 Claude Code。

升级版本:

常见工作流

📊 我想快速查看配额

🎨 我想定制状态栏样式

推荐方式:使用交互式配置(实时预览效果)

手动配置参见快速定制

🤖 我想更换模型或调整上下文窗口

🔧 我想在脚本中调用

输出结构化 JSON 数据:

⚠️ 配额用完了或显示异常

参见故障排查

快速定制

推荐方式:交互式配置

操作方式:
- ↑↓ 选择组件,Enter 进入编辑,Tab 切换样式,Space 开关显示
- g 进入全局选项(主题、显示模式、极简模式、原始数值、重置时间格式)
- s 保存,q 退出

常用配置(非交互式)

风格主题

风格对比:

显示内容

配色逻辑:

配额百分比会根据剩余量自动变色:
- 🟢 绿色 — 剩余 >= 60%
- 🟡 黄色 — 剩余 30%–60%
- 🔴 红色 — 剩余  1.3x 理论值

高级配置选项(点击展开)

工作日设置

设置每周工作日数量(1-7),用于计算周配额的理论预算和配速分析。默认 5 天。

原始数值模式

直接显示原始数值,不显示百分比。

自定义鉴权

当 Claude Code 运行在代理或网关后面时,可手动覆盖鉴权信息:

清除:glm-quota-line config unset auth-token / base-url。

鉴权优先级(从高到低):
1. config set 持久化的值
2. 环境变量 ANTHROPIC_AUTH_TOKEN / ANTHROPIC_BASE_URL
3. ~/.claude/settings.json 中的 env 字段

恢复出厂配置

一键重置用户配置,保留安装状态(不卸载状态栏/hook)。

- 默认重置范围:所有全局配置项、组件布局、自定义模型映射
- --models 限定只清 modelMap,其它配置不动
- 非交互环境(无 TTY)必须加 --yes,否则报错退出
- 重置后状态栏仍正常工作——模型映射会回退到包内默认表

高级功能

模型映射管理(新模型支持)

管理模型的上下文窗口大小映射。上下文窗口用量百分比基于此映射计算。

list 输出示例:

* 标记表示用户自定义的映射。

双层结构设计:
- 包内 data/models.json 作为默认底层
- ~/.claude/glm-quota-line.json 里的 modelMap 作为用户覆盖层(运行时逐键覆盖)

优势:智谱发布新模型时,无需等待 npm 包更新——直接 model set   写入本地覆盖层即可立刻生效。

想清空所有自定义模型映射、回到包内默认表:执行 glm-quota-line config reset --models --yes。

Agent / 自动化接口

如果你是 AI agent(Claude Code / Cursor / Codex)或脚本作者,以下接口保证稳定:

约定:
- 退出码:成功 0,失败 1
- 副作用标注:每个命令标为 read(只读)、write(改配置)、mutating(改 Claude Code 集成)、interactive(需 TTY)
- 非阻塞:所有命令都不会卡住等待输入
- 只读查询:glm-quota-line --json 输出结构化配额数据

典型 agent 工作流:先 commands --json 了解能力 →…
Read the full README on GitHub

How status lines work

  • A status line is a command Claude Code runs to draw the bar under the prompt. It gets the session as JSON on stdin (model, folder, cost, context) and prints one or more lines.
  • Point the statusLine setting in ~/.claude/settings.json at it: { "statusLine": { "type": "command", "command": "<the command from the README>" } }.
  • Or run /statusline inside Claude Code and describe what you want.
Claude Code docs

Details

Language
JavaScript
License
MIT
Last updated
29 October 2026
Topics
claude-codecoding-planglmquotastatusline

FAQ

What is Glm Quota Line?

A lightweight CLI for showing GLM Coding Plan quota in the Claude Code status line. It is a status line for Claude Code, from deluo/glm-quota-line on GitHub.

How do I install Glm Quota Line?

Run npx glm-quota-line, then follow the setup in the README.

Is Glm Quota Line popular?

deluo/glm-quota-line has 33 GitHub stars and 7 forks. It was last updated on 29 October 2026.

More status lines

Browse the most popular Claude Code mods, all status lines, or the skills and MCP server directories.