npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

claude-code-glm-statusline

v1.0.3

Published

Claude Code statusline for GLM Coding Plan subscribers — shows model, context usage, and API quota in real-time

Readme

claude-code-glm-statusline

English | 中文

Claude Code 自定义状态栏,专为 智谱 GLM Coding Plan 订阅用户设计。

实时显示模型信息、上下文使用率、5 小时 / 7 天配额用量,让你对 API 消耗一目了然。

效果预览

preview

📁 statusline | 🧠 glm-5.1 | 📋42% ██████░░░░ | ⏳5h 62% 2h30m | 📅7d 45% 5d12h | 🕐13:16
  • 目录名 — 当前工作目录
  • 模型 — 当前使用的 GLM 模型
  • 上下文 — 上下文窗口使用率,带颜色进度条(绿→黄→红)
  • 5h 配额 — 5 小时滑动窗口 Token 用量 + 重置倒计时
  • 7d 配额 — 7 天滑动窗口 Token 用量 + 重置倒计时
  • 时间 — 当前时间

前置条件

安装用量查询插件: 推荐使用智谱官方一键安装助手自动配置:

npx @z_ai/coding-helper

进入向导后选择 插件市场 → 安装 glm-plan-usage 插件即可。

也可手动安装:

claude plugin marketplace add zai-org/zai-coding-plugins
claude plugin install glm-plan-usage@zai-coding-plugins

详见 智谱官方文档 - 用量查询插件一键安装助手

快速安装

npx claude-code-glm-statusline

安装完成后重启 Claude Code 即可看到状态栏。

手动安装

如果 npx 不可用,可以手动安装:

  1. 下载 src/statusline.mjs~/.claude/ 目录:
curl -o ~/.claude/statusline.mjs https://raw.githubusercontent.com/Darkycl/claude-code-glm-statusline/main/src/statusline.mjs
  1. 编辑 ~/.claude/settings.json,添加 statusLine 配置:
{
  "statusLine": {
    "type": "command",
    "command": "node ~/.claude/statusline.mjs"
  }
}

Windows 用户使用完整路径:

{
  "statusLine": {
    "type": "command",
    "command": "node C:/Users/<your-username>/.claude/statusline.mjs"
  }
}

配置环境变量

确保 ~/.claude/settings.json 中的 env 已配置智谱 API:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "<your-api-token>"
  }
}

卸载

  1. 编辑 ~/.claude/settings.json,删除 statusLine 字段
  2. 删除 ~/.claude/statusline.mjs~/.claude/quota_cache.json
rm ~/.claude/statusline.mjs ~/.claude/quota_cache.json

工作原理

  • 脚本从 Claude Code 的 stdin 读取 JSON 数据,提取模型和上下文信息
  • 配额数据通过智谱平台 API (/api/monitor/usage/quota/limit) 获取
  • 配额数据缓存 5 分钟,避免频繁请求
  • 使用 ANSI 颜色编码和 Unicode 字符渲染进度条

常见问题

Q: 状态栏没有显示配额信息?

确保 ANTHROPIC_BASE_URL 指向 https://open.bigmodel.cn/api/anthropic,且 ANTHROPIC_AUTH_TOKEN 已正确设置。

Q: 支持 Anthropic 官方 API 吗?

配额显示功能依赖智谱平台的专属 API。如果你使用 Anthropic 官方 API,上下文使用率和模型信息仍然可以正常显示。

Q: 支持 Windows 吗?

支持。安装脚本会自动检测操作系统并使用正确的路径格式。

协议

MIT