中文说明在前,English follows below.
CodexBar Quota Menu Bar 是一个独立的 macOS 菜单栏额度查看工具,用来重新展示 CodexBar 已经生成在本机的额度数据。
它不是 CodexBar 官方插件,也不会修改 CodexBar 原程序。原版 CodexBar 仍负责登录、认证、额度刷新和本地数据生成;本工具只负责把这些本地展示数据用更适合日常查看的菜单栏 UI 展示出来,并增加 Codex 账号切换入口。
- Codex 账号额度显示。
- Claude 账号额度显示。
- 多个 Codex 账号列表展示。
- Codex CLI 当前账号标记。
- Codex CLI 账号切换:点击
Switch后,把 CodexBar 托管账号的授权文件切换到当前 Codex CLI 使用的账号。 - 邮箱脱敏展示。
- 断网或 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 配置。
- 不上传任何本地数据。
- 额度百分比、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 授权配置只作为账号身份辅助来源,不作为额度来源。
点击 Switch 切换 Codex 账号时,本工具会:
- 先备份当前
~/.codex/auth.json到~/.codex/auth-backups/。 - 再把 CodexBar 托管的目标账号授权文件复制为新的
~/.codex/auth.json。 - 不会改动 CodexBar 原程序和 CodexBar 配置。
- 左键点击菜单栏图标:打开或关闭额度面板。
- 右键点击菜单栏图标:显示
刷新和退出。 - 面板右上角刷新按钮:立即重新读取本地额度数据。
- 面板右上角
x:退出菜单栏工具。 - Codex 账号右侧
Switch:切换当前 Codex CLI 账号。 - Codex 账号右侧
Active:表示当前 Codex CLI 正在使用该账号。
启动后可以检查:
- 菜单栏是否出现图标。
- 左键点击后是否弹出额度面板。
- Codex 和 Claude 账号是否正常显示。
- Codex 账号数量是否与 CodexBar 一致。
- 5 小时、1 周等额度百分比是否与 CodexBar 一致。
- 邮箱是否已经脱敏。
- 点击
Switch后,重开终端运行 Codex CLI,是否切换到目标账号。
如果不想继续使用:
- 右键点击菜单栏图标。
- 选择
退出。 - 删除
CodexBarQuotaMenuBar.app。
如果使用过 Switch 并想恢复之前的 Codex CLI 账号,可以从下面目录找回备份:
~/.codex/auth-backups/
本工具没有修改 CodexBar 原程序,不需要恢复 CodexBar。
需要 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, quota refresh, and local data generation. This app only provides a cleaner menu bar UI for daily quota checks and adds a Codex account switching shortcut.
- Display quota usage for Codex accounts.
- Display quota usage for Claude accounts.
- Show multiple Codex accounts.
- Mark the currently active Codex CLI account.
- Switch the active Codex CLI account by clicking
Switch. - 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 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, use email and plan type as fallback identity metadata, and support account switching, the app reads:
~/.codex/auth.json
Codex/CodexBar auth configuration is used only as account identity metadata, not as a quota source.
When you click Switch, the app will:
- Back up the current
~/.codex/auth.jsonto~/.codex/auth-backups/. - Copy the selected CodexBar-managed account auth file to
~/.codex/auth.json. - Leave the original CodexBar app and CodexBar settings untouched.
- 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.Switchon a Codex account: switch the active Codex CLI account.Activeon a Codex account: indicates the account currently used by Codex CLI.
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.
- After clicking
Switch, restart your terminal and confirm Codex CLI uses the selected account.
To stop using the app:
- Right-click the menu bar icon.
- Choose
Quit. - Delete
CodexBarQuotaMenuBar.app.
If you used Switch and want to restore a previous Codex CLI account, check the backups in:
~/.codex/auth-backups/
This app does not modify the original CodexBar app, so there is nothing to restore in CodexBar.
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