CodexBar is a macOS menu bar app for Codex usage visibility.
This fork (net-snix/CodexBar) is intentionally Codex-only in active runtime behavior, with a performance and battery focus.
- Runtime scope: Codex only.
- App target: macOS menu bar app first.
- Secondary target: Linux/macOS CLI output for scripts/CI.
- Current branch keeps some legacy provider code/docs in-tree as reference, but provider iteration is restricted to Codex.
Compared to upstream, this fork currently applies these practical deltas:
UsageProvider.allCasesresolves tocodexonly, so refresh/provider loops run Codex only.- refresh, status polling, and token refresh loops execute only for enabled providers (now effectively Codex).
- Codex credits fetch is integrated into provider refresh (no extra standalone credits refresh pass).
- widget timeline reload is snapshot-diffed and minimum-interval throttled.
- release automation includes GitHub Actions for:
- signed/notarized macOS app releases
- Linux CLI release artifacts
- Codex session and weekly usage with reset times.
- Codex credits in app + CLI output.
- Codex source fallback strategy:
- OpenAI web dashboard (cookie-based, optional)
- Codex CLI RPC (
codex app-server) - Codex CLI PTY fallback (
/status)
- OpenAI status indicator integration.
- local token/cost usage scan from Codex session logs.
- Widget snapshot persistence for Codex usage.
codexbarCLI for terminal and CI workflows.
- macOS 14+ for the menu bar app.
- Xcode + Swift toolchain for local builds.
codexCLI installed and authenticated for CLI/RPC data paths.
swift build -c release
./Scripts/package_app.sh
open CodexBar.app./Scripts/compile_and_run.shCodexBar.app ships CodexBarCLI at:
CodexBar.app/Contents/Helpers/CodexBarCLI
Optional symlink:
ln -sf "$PWD/CodexBar.app/Contents/Helpers/CodexBarCLI" /usr/local/bin/codexbarExamples:
codexbar usage --provider codex
codexbar usage --provider codex --format json --pretty
codexbar usage --provider codex --source cli
codexbar usage --provider codex --status
codexbar cost --provider codex --format json --prettyThis fork prioritizes lower background churn:
- provider fan-out reduced to Codex runtime path
- duplicate credits refresh path removed
- widget timeline reloads avoided when snapshot did not materially change
- widget timeline reload frequency minimum interval enforced
For even lower background activity, use Settings to:
- increase refresh interval
- disable status checks
- run manual refresh only
File: .github/workflows/release-macos.yml
Triggers:
release.published(uploads assets directly to release)workflow_dispatch(uploads artifacts to the workflow run)
Required repository secrets:
APPLE_DEVELOPER_ID_CERT_P12_BASE64APPLE_DEVELOPER_ID_CERT_PASSWORDAPP_IDENTITY(recommended)APP_STORE_CONNECT_API_KEY_P8APP_STORE_CONNECT_KEY_IDAPP_STORE_CONNECT_ISSUER_IDSPARKLE_PRIVATE_KEY
File: .github/workflows/release-cli.yml
Triggers:
release.publishedworkflow_dispatch
Build matrix:
linux-x64(ubuntu-24.04)linux-arm64(ubuntu-24.04-arm)
CodexBar reads only targeted Codex-related paths as needed:
~/.codex/auth.json(OAuth/token flow)~/.codex/sessions/**and~/.codex/archived_sessions/**(cost usage)- optional browser cookies when OpenAI web dashboard mode is enabled
No broad disk crawling. Cookie usage is opt-in.
- Full Disk Access may be needed for Safari cookie import.
- Keychain prompts can occur for browser safe-storage decryption.
- Accessibility / Screen Recording / Automation permissions are not required.
docs/codex.md- Codex data sources and fetch detailsdocs/providers.md- provider strategy map (includes codex-only runtime note)docs/refresh-loop.md- refresh timing + lifecycle behaviordocs/cli.md- CLI behavior and flagsdocs/RELEASING.md- release checklist and signing/notarization flow
MIT