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

coding-usage-bar

v0.6.2

Published

macOS menu bar usage monitor for Claude Code, Codex, GLM, DeepSeek, and MiniMax.

Readme

Coding Usage Bar

English · 简体中文

在 macOS 菜单栏监控 Claude Code、Codex 和其他 AI 编程套餐用量。

Coding Usage Bar 在 macOS 菜单栏展示多个 AI 编程 Provider 的套餐用量

Coding Usage Bar 同时支持 Claude Code、OpenAI Codex、GLM(智谱 AI)、DeepSeek、MiniMax 和 Kimi(Moonshot AI)。它不只展示百分比,还会结合短周期和周额度判断当前节奏是偏慢、正常、偏快,还是已经接近限额。

Claude Code 与 Codex 的数据直接读取它们在本机产生的文件,不需要额外登录,也不会上传使用记录。GLM、DeepSeek 和 MiniMax 的 API Key 只保存在 ~/.coding-usage-bar/config.json,并直接请求对应 Provider 的额度接口。Kimi 的 Key 优先读 ~/.coding-usage-bar/config.json,未配置时回退到 ~/.config/claude-lanes/config.env 中指向 kimi.com 的 lane。

真实 SwiftBar 菜单

菜单栏标题与下拉面板均截自正在运行的 SwiftBar 插件,仅叠加纯色桌面背景;动画复现菜单的展开与收起,不修改截图中的用量数据。

快速开始

npx coding-usage-bar install
coding-usage-bar doctor
coding-usage-bar status

安装器会创建:

  • ~/.coding-usage-bar/app 稳定运行副本
  • ~/.local/bin/coding-usage-bar 命令入口
  • 每 5 分钟采集一次用量的 launchd 任务
  • 写入 SwiftBar 当前插件目录的菜单栏插件

安装结束时会自动验收菜单栏是否就绪,最后一行出现 Menu bar ready 即表示图标已出现在菜单栏右上角。

常见问题

安装后菜单栏没有图标?

  1. 执行 coding-usage-bar doctor --fix:自动重启 SwiftBar、补装菜单栏插件、补加 SwiftBar 登录项、补采 status 数据。
  2. macOS 可能把菜单栏图标折叠隐藏了:系统设置 → 控制中心 → 菜单栏,检查隐藏区。
  3. 如果 macOS 弹过 System Events 的"自动化"权限框且被拒绝,SwiftBar 将无法开机自启:在 系统设置 → 隐私与安全性 → 自动化 中放行,再执行一次 coding-usage-bar install。

核心特点

  • 一个菜单栏同时查看多个 AI 编程 Provider
  • 按账户实际下发的滚动窗口分析使用节奏;部分 Codex 账户当前只提供 7d
  • Claude Code、Codex 本地优先,不依赖额外遥测服务
  • 展示层只读稳定的 status.json,不会在打开菜单时临时访问数据源
  • 接近限额或燃烧节奏异常时发送系统通知
  • 国产套餐规则内置:GLM Coding Plan 与 DeepSeek 的峰谷时段按北京时间计算,法定节假日按国办通知处理,CLI、下拉菜单和卡片都会显示当前是高峰还是谷时、几折、几点切换
  • GLM 新版 Coding Plan 按积分(CREDIT_LIMIT)计量时自动识别,标注"按积分计量",5h/7d 百分比不会因为套餐换代而失真。该识别基于现有套餐观测到的 CREDIT_LIMIT 形状,尚未用真实 V3 积分制账号实测;V3 用户可在 issue 里贴脱敏的 coding-usage-bar status --refresh 输出帮助确认

峰谷时段

| Provider | 高峰(北京时间) | 谷时 | 法定节假日 | |---|---|---|---| | DeepSeek API | 周一至周五 09:00–12:00、14:00–18:00 | 高峰价的 50% | 全天谷时 | | GLM Coding Plan | 周一至周五 14:00–18:00 | 积分按 50% 抵扣 | 官方规则未排除,按工作日字面处理 |

依据 DeepSeek 定价页与 GLM Coding Plan 概览。2026 年节假日表来自国办发明电〔2025〕7号;调休上班的周末仍按周末处理,因为两家都把规则写成"周一至周五"。限时活动(如双节全天谷时)不建模。峰谷只说明厂商此刻怎么计费,不改变燃烧节奏分析。

完整命令、Provider 配置和实现边界请查看英文 README。

交互式安装结束后,工具可能询问是否为 GitHub 仓库加 Star。该提示默认选择 No([y/N]),只有用户明确输入 y/yes 且本机 GitHub CLI 已登录时才会修改远端账户状态。

开发验证

npm ci
npm test
npm run build
npm pack

License

MIT

各 Provider 名称与商标归其权利人所有。本项目独立开发,与 Anthropic、OpenAI、智谱 AI、DeepSeek、MiniMax、Moonshot AI 无隶属或背书关系。Provider 标识仅用于识别,不适用项目 MIT License,详见 THIRD_PARTY_NOTICES.md。