May your tokens never run out—keep Codex limits in view.
Tiny macOS 15+ menu bar app that shows how much Codex usage you have left (5‑hour + weekly windows) and when each window resets. No Dock icon, minimal UI, dynamic bar icon in the menu bar. No extra login—uses your existing Codex CLI session/logs.
- Reads the newest
rollout-*.jsonlin~/.codex/sessions/...and extracts the latesttoken_countevent (used_percent,window_minutes,resets_at). - Shows 5h + weekly windows, last-updated time, your ChatGPT account email + plan (decoded locally from
~/.codex/auth.json), and a configurable refresh cadence. - Horizontal bar icon: top bar = 5h window, bottom hairline = weekly window. Filled portion shows “percent left” and dims on errors.
- CLI-only: does not hit chatgpt.com or browsers; keeps tokens on-device.
- Auto-update via Sparkle (Check for Updates… menu item, auto-check enabled). Feed defaults to GitHub Releases appcast (replace SupublicEDKey with your Ed25519 public key).
- Ready-to-run zips are published in GitHub Releases: https://github.com/steipete/CodexBar/releases
swift build -c release # or debug for development
./Scripts/package_app.sh # builds CodexBar.app in-place
open CodexBar.appRequirements:
- Codex CLI ≥ 0.55.0 installed and logged in (
codex --version). - At least one Codex prompt this session so
token_countevents exist (otherwise you’ll see “No usage yet”).
Menu → “Refresh every …” presets: Manual, 1 min, 2 min (default), 5 min. Manual still allows “Refresh now.”
export APP_STORE_CONNECT_API_KEY_P8="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
export APP_STORE_CONNECT_KEY_ID="ABC123XYZ"
export APP_STORE_CONNECT_ISSUER_ID="00000000-0000-0000-0000-000000000000"
./Scripts/sign-and-notarize.shOutputs CodexBar-0.1.0.zip ready to ship. Adjust APP_IDENTITY in the script if needed.
~/.codex/auth.json is decoded locally (JWT only) to show your email + plan (Pro/Plus/Business). Nothing is sent anywhere.
- If the newest session log has no
token_countyet, you’ll see “No usage yet.” Run one Codex prompt and refresh. - If Codex changes the event schema, percentages may fail to parse; the menu will show the error string.
- Only arm64 build is scripted; add
--arch x86_64if you want a universal binary.
- Update version in Scripts/package_app.sh, Scripts/sign-and-notarize.sh, About panel (CodexBarApp) and CHANGELOG.md
- Run swiftlint & swiftformat
- swift test / swift build -c release
- ./Scripts/package_app.sh release
- ./Scripts/sign-and-notarize.sh (arm64)
- Verify .app:
spctl -a -t exec -vv CodexBar.app;stapler validate CodexBar.app - Generate Sparkle appcast with notarized zip using your Ed25519 key; upload appcast + zip to Releases; set SUPublicEDKey in Info.plist
- Upload
CodexBar-<version>.zipto GitHub Releases and tag - README download link points to the new release
See CHANGELOG.md.
- Trimmy: menu-bar clipboard flattener for multi-line shell snippets.