中文说明在前,English follows below.
CodexBar Quota Menu Bar 是一个独立的 macOS 菜单栏额度查看工具,用来重新展示 CodexBar 已经生成在本机的额度数据。
它不是 CodexBar 官方插件,也不会修改 CodexBar 原程序。原版 CodexBar 仍负责登录、认证、账号切换、额度刷新和本地数据生成;本工具只负责把这些本地展示数据用更适合日常查看的菜单栏 UI 展示出来。
- Codex 账号额度显示。
- Claude 账号额度显示。
- 多个 Codex 账号列表展示。
- Codex CLI 当前账号标记。
- 为避免授权文件副本不同步,本工具不提供账号切换;请使用原版 CodexBar 设置中的“系统”下拉框切换。
- 邮箱脱敏展示。
- 断网或 CodexBar 刷新失败时,优先显示 DIY 记录的最后一次成功额度快照。
- 左键点击菜单栏图标打开额度面板,右键点击可刷新或退出。
请到 GitHub Releases 下载最新的安装包:
CodexBarQuotaMenuBar-macOS-arm64.zip
使用方式:
- 下载并解压 zip。
- 双击
CodexBarQuotaMenuBar.app启动。 - 启动后不会出现在 Dock,只会显示在 macOS 菜单栏。
- 如果 macOS 首次提示无法验证开发者,请在 Finder 中右键 App,选择
打开,再确认打开。
当前安装包面向 Apple Silicon Mac,最低支持 macOS 13。
使用前请先安装并运行原版 CodexBar。
建议顺序:
- 先启动原版 CodexBar,让它完成登录和额度刷新。
- 再启动
CodexBarQuotaMenuBar.app。 - 日常只看 DIY 菜单栏图标即可。
如果原版 CodexBar 没有运行,本工具可能只能显示旧数据,或者显示暂无数据。
本工具遵守以下边界:
- 不修改
/Applications/CodexBar.app。 - 不修改 CodexBar 配置。
- 不备份、复制或替换
~/.codex/auth.json。 - 不上传任何本地数据。
- 额度百分比、Reset 时间和
Not started yet判断只来自 CodexBar 本地额度数据。 - 不明文输出、记录或展示 Token、
id_token、refresh token、Cookie、OAuth secret、API Key。 - 不使用
auth.json推导额度百分比、Reset 时间或额度状态。 - 展示邮箱时会脱敏。
本工具读取的本地额度展示数据包括:
~/Library/Group Containers/Y5PE65HELJ.com.steipete.codexbar/widget-snapshot.json
~/Library/Application Support/CodexBar/managed-codex-accounts.json
~/Library/Application Support/CodexBar/codex-account-snapshots.json
~/Library/Application Support/com.steipete.codexbar/history/codex.json
~/Library/Application Support/com.steipete.codexbar/history/claude.json
本工具还会维护一个自己的最后一次成功 Codex 快照缓存:
~/Library/Application Support/CodexBarQuotaMenuBar/last-good-codex-snapshots.json
该缓存只保存每个 Codex 账号最新一条成功额度快照,后续成功刷新会覆盖旧值,不会追加历史。缓存不保存完整邮箱、Token、Cookie、API Key 或授权文件内容。
为了判断当前 Codex CLI 使用中的账号,并兜底识别邮箱和套餐类型,本工具会只读访问:
~/.codex/auth.json
Codex/CodexBar 授权配置只作为账号身份辅助来源,不作为额度来源。本工具不会写入授权文件;需要切换账号时,请使用原版 CodexBar 设置中的“系统”下拉框,由 CodexBar 负责保全和更新授权。
- 左键点击菜单栏图标:打开或关闭额度面板。
- 右键点击菜单栏图标:显示
刷新和退出。 - 面板右上角刷新按钮:立即重新读取本地额度数据。
- 面板右上角
x:退出菜单栏工具。 - Codex 账号右侧
Active:表示当前 Codex CLI 正在使用该账号。 - 切换账号:前往原版 CodexBar 设置,使用“系统”下拉框。
启动后可以检查:
- 菜单栏是否出现图标。
- 左键点击后是否弹出额度面板。
- Codex 和 Claude 账号是否正常显示。
- Codex 账号数量是否与 CodexBar 一致。
- 5 小时、1 周等额度百分比是否与 CodexBar 一致。
- 邮箱是否已经脱敏。
- 当前 Codex CLI 账号是否显示
Active,其他账号是否没有Switch按钮。
如果不想继续使用:
- 右键点击菜单栏图标。
- 选择
退出。 - 删除
CodexBarQuotaMenuBar.app。
本工具不会修改 CodexBar 原程序、CodexBar 配置或 Codex 授权文件,不需要恢复相关配置。
需要 Xcode Command Line Tools。
swift build -c release生成可下载 App 包:
./scripts/package_app.sh打包结果在:
dist/CodexBarQuotaMenuBar-macOS-arm64.zip
CodexBar Quota Menu Bar is an independent macOS menu bar app that presents local quota data already generated by CodexBar.
It is not an official CodexBar plugin and it does not modify the original CodexBar app. CodexBar still handles login, authentication, account switching, quota refresh, and local data generation. This app only provides a cleaner menu bar UI for daily quota checks.
- Display quota usage for Codex accounts.
- Display quota usage for Claude accounts.
- Show multiple Codex accounts.
- Mark the currently active Codex CLI account.
- To avoid stale auth-file copies, this app does not switch accounts. Use the
Systemdropdown in the original CodexBar settings instead. - Mask email addresses in the UI.
- Show the DIY last successful quota snapshot when offline or when CodexBar refresh fails.
- Left-click the menu bar icon to open the quota panel; right-click to refresh or quit.
Download the latest package from GitHub Releases:
CodexBarQuotaMenuBar-macOS-arm64.zip
How to use:
- Download and unzip the package.
- Double-click
CodexBarQuotaMenuBar.app. - The app does not show a Dock icon. It only appears in the macOS menu bar.
- If macOS warns that the developer cannot be verified, right-click the app in Finder, choose
Open, and confirm.
The current package targets Apple Silicon Macs and requires macOS 13 or later.
Install and run the original CodexBar first.
Recommended order:
- Start CodexBar and let it refresh account quota data.
- Start
CodexBarQuotaMenuBar.app. - Use the DIY menu bar icon for daily checks.
If CodexBar is not running, this app may only show stale data or no data.
This app follows these boundaries:
- It does not modify
/Applications/CodexBar.app. - It does not modify CodexBar settings.
- It does not back up, copy, or replace
~/.codex/auth.json. - It does not upload any local data.
- Quota percentages, reset times, and
Not started yetare derived only from CodexBar local quota data. - It does not print, log, or display tokens,
id_token, refresh tokens, cookies, OAuth secrets, or API keys. - It does not use
auth.jsonto infer quota percentages, reset times, or quota status. - Email addresses are masked in the UI.
The app reads these local quota display data files:
~/Library/Group Containers/Y5PE65HELJ.com.steipete.codexbar/widget-snapshot.json
~/Library/Application Support/CodexBar/managed-codex-accounts.json
~/Library/Application Support/CodexBar/codex-account-snapshots.json
~/Library/Application Support/com.steipete.codexbar/history/codex.json
~/Library/Application Support/com.steipete.codexbar/history/claude.json
The app also maintains its own last successful Codex snapshot cache:
~/Library/Application Support/CodexBarQuotaMenuBar/last-good-codex-snapshots.json
This cache stores only one latest successful quota snapshot per Codex account. Successful refreshes overwrite previous values instead of appending history. It does not store full email addresses, tokens, cookies, API keys, or auth file contents.
To detect the active Codex CLI account and use email and plan type as fallback identity metadata, the app reads this file without writing to it:
~/.codex/auth.json
Codex/CodexBar auth configuration is used only as account identity metadata, not as a quota source. This app never writes auth files. To switch accounts, use the System dropdown in the original CodexBar settings so CodexBar can preserve and update the auth state safely.
- Left-click the menu bar icon: open or close the quota panel.
- Right-click the menu bar icon: show
RefreshandQuit. - Refresh button in the panel: reload local quota data.
xbutton in the panel: quit the menu bar app.Activeon a Codex account: indicates the account currently used by Codex CLI.- To switch accounts, open the original CodexBar settings and use the
Systemdropdown.
After launching, check:
- The menu bar icon appears.
- Left-click opens the quota panel.
- Codex and Claude accounts are displayed.
- The Codex account count matches CodexBar.
- Quota percentages, such as 5-hour and 1-week windows, match CodexBar.
- Email addresses are masked.
- The current Codex CLI account shows
Active, and other accounts do not show aSwitchbutton.
To stop using the app:
- Right-click the menu bar icon.
- Choose
Quit. - Delete
CodexBarQuotaMenuBar.app.
This app does not modify the original CodexBar app, CodexBar settings, or Codex auth files, so there is nothing to restore.
Xcode Command Line Tools are required.
swift build -c releaseBuild a downloadable app package:
./scripts/package_app.shThe package will be created at:
dist/CodexBarQuotaMenuBar-macOS-arm64.zip