CodexBar iOS
🇨🇳 简体中文
iPhone companion app for CodexBar. This fork ships the iOS app and a matching Mac companion build so your provider usage, cost, reset windows, widgets, and quota notifications can move from the Mac to the iPhone over iCloud.
This repository is centered on the iOS app, but it builds on the upstream Mac app. Install the iOS app from the App Store and the paired Mac build from our Releases page. The original CodexBar Mac project and its full provider documentation are preserved below.
codexbarios.o1xhack.com · Mac app — GitHub Releases · @o1xhack
CodexBar 🎚️ — May your tokens never run out.
Every AI coding limit, in your menu bar.
Tiny macOS 14+ menu bar app that keeps AI coding-provider limits visible and shows when each window resets. See the supported providers below. One status item per provider, or Merge Icons mode with a provider switcher. No Dock icon, minimal UI, dynamic bar icons.
Why
- Plan around resets. Per-provider session, weekly, and monthly windows with countdowns to the next reset — stop guessing whether to start that long task.
- Credits, spend, and cost scans. Credit balances, Admin API spend dashboards, provider billing summaries, and local cost scans where the source exposes enough detail.
- Live status. Provider status polling surfaces incident badges in the menu and an indicator overlay on the bar icon.
- Privacy-first. Reuses existing provider sessions — OAuth, device flow, API keys, browser cookies, local files — so no passwords are stored.
Install
Requirements
GitHub Releases
Download: https://github.com/steipete/CodexBar/releases
Homebrew
brew install --cask codexbar
CLI Tarballs (macOS/Linux)
Homebrew formula (Linux today):
brew install steipete/tap/codexbar
Arch Linux AUR package:
yay -S codexbar-cli
Or download release tarballs from GitHub Releases:
- macOS:
CodexBarCLI-v<tag>-macos-arm64.tar.gz, CodexBarCLI-v<tag>-macos-x86_64.tar.gz
- Linux (glibc):
CodexBarCLI-v<tag>-linux-aarch64.tar.gz, CodexBarCLI-v<tag>-linux-x86_64.tar.gz
- Linux (static musl):
CodexBarCLI-v<tag>-linux-musl-aarch64.tar.gz, CodexBarCLI-v<tag>-linux-musl-x86_64.tar.gz
Linux support via Omarchy: community Waybar module and TUI, driven by the codexbar executable.
First run
- Open Settings → Providers and enable what you use.
- Install/sign in to the provider sources you rely on: CLIs, browser sessions, OAuth/device flow, API keys, local app files, or provider apps depending on the provider.
- Optional: Settings → Providers → Codex → OpenAI cookies (Automatic or Manual) to add dashboard extras.
Set API keys from the CLI
Provider toggles and API keys live in the resolved CodexBar config file. New installs use
~/.config/codexbar/config.json; existing ~/.codexbar/config.json installs still load from the legacy path. You can
script the same provider list that Settings → Providers uses:
codexbar config providers
codexbar config enable --provider grok
codexbar config disable --provider cursor
For API-key providers, store a key without opening Settings:
printf '%s' "$ELEVENLABS_API_KEY" | codexbar config set-api-key --provider elevenlabs --stdin
set-api-key trims the piped value, stores it with restrictive config-file permissions, and enables the provider by default. Use --no-enable to only save the key, or --api-key <key> for one-off local scripts where shell history is not a concern.
See CLI configuration for the full flow.
Providers
- Codex — OAuth API or local Codex CLI, plus optional OpenAI web dashboard extras.
- OpenAI — Admin API key usage/cost graphs with legacy credit-balance fallback.
- Azure OpenAI — API key, endpoint, and deployment validation probe.
- Claude — OAuth API, browser cookies, or CLI PTY fallback; session and weekly usage where available.
- Cursor — Browser session cookies for plan + usage + billing resets.
- OpenCode — Browser cookies for workspace subscription usage.
- OpenCode Go — Usage API, browser fallback, and local SQLite cost history.
- Alibaba Coding Plan — Web cookies or API key for coding-plan quotas.
- Alibaba Token Plan — Bailian browser/manual cookies for token-plan credits.
- Qwen Cloud — 5-hour and weekly individual Token Plan usage via browser/manual cookies.
- Gemini — OAuth-backed quota API using Gemini CLI credentials (no browser cookies).
- Antigravity — Local language server probe, CLI HTTPS source, and Google OAuth fallback (experimental).
- Langdock — Selected Edge, Chrome, or Safari profile → personal included session and weekly limits (
web, macOS).
- Soniox — Organization API key for prepaid USD balance and monthly spend against the organization budget.
- X API — Browser or manual console.x.com cookies for prepaid and free credits, including negative balances.
- Future AGI — API key and secret key (billing-period usage, allowances, and estimated cost).
- LithosAI — Browser or manual console cookies for prepaid USD balance and optional UTC spend.
- WorkBuddy — Chrome or manual www.workbuddy.cn cookies for the monthly credits allowance, plan name, and cycle reset.
- Tavily — API key for account-plan, per-key, and pay-as-you-go credit totals.
- Linkup — API key for the current prepaid USD credit balance.
- TinyApi — Browser or manual session cookies for aggregate available credits.
- Exa — Team Management service key plus an explicit API key ID for month-to-date USD spend.
- Cosmic AI — Explicit Personal Access Token and Project ID for separate project AI input/output counters and allowances.
Icon & Screenshot
The menu bar icon is a tiny usage meter. Bar meaning is provider-specific, and errors/stale data can dim the icon or
show an incident indicator.
Features
- Multi-provider menu bar with per-provider toggles (Settings → Providers).
- Provider-specific usage meters with reset countdowns.
- Optional Codex web dashboard enrichments (code review remaining, usage breakdown, credits history).
- Inline spend and usage charts for API-backed providers such as OpenAI, Claude Admin API, OpenRouter, LiteLLM, z.ai, MiniMax, Mistral, and AWS Bedrock.
- Codex and Claude Plan Usage menus show a quota burndown from recorded snapshots, with the capture time and an even-use guide. The existing utilization history remains below it, and the line fills in as the app collects samples.
- Configurable cost-usage scans for Codex + Claude, plus reused chart UI for supported provider histories. Codex history uses a WAL-enabled SQLite store capped at 25,000 retained session entries and 256 MiB.
- A persistent Settings → Usage & Spend view for local estimates, grouped by native currency and provider. Accounts, history sources, model breakdowns, and daily/hourly trends retain incomplete-history labels and privacy controls.
- Provider status polling with incident badges in the menu and icon overlay.
- Merge Icons mode to combine providers into one status item + switcher, including stacked first-line status for two enabled built-in providers.
- Display controls for provider icons, labels, bars, reset-time style, and highest-usage auto-selection.
- Fresh installs default to Adaptive refresh. Existing users keep every valid stored choice, while legacy unset or
invalid preferences resolve to 5 minutes. Manual and fixed 1m, 2m, 5m, 15m, and 30m alternatives remain available.
- Bundled CLI (
codexbar) for scripts and CI (including codexbar cost --provider codex, claude, or both for local cost usage); macOS and Linux CLI builds available.
- WidgetKit widgets for supported providers.
- Localized app and website with a shared 23-language catalog, automatic website detection, persistent pickers, and RTL support.
- Linux desktop app and Omarchy widget are available alongside the macOS app and CLI.
- Optional session quota notifications and weekly-reset confetti.
- Privacy-first: on-device parsing by default; browser cookies are opt-in and reused (no passwords stored).
Privacy note
Wondering if CodexBar scans your disk? It doesn’t crawl your filesystem; it reads a small set of known locations (browser cookies/local storage, provider config files, local JSONL logs) when the related features are enabled. Plain Adaptive refresh never inspects local agent activity. The separate Adaptive (agent-aware) option asks before inspecting the running-process list (including command lines) to identify Codex/Claude and reading bounded known-session metadata. Declining returns to plain Adaptive. When allowed with Agent Sessions hidden, CodexBar retains only the latest activity time and discards session paths and identities. Provider tokens and token-account settings live in the CodexBar config file with restrictive file permissions. See the discussion and audit notes in issue #12.
macOS permissions (why they’re needed)
- Full Disk Access (optional): only required to read Safari cookies/local storage for web-based providers. If you don’t grant it, use another supported browser, manual cookies/API keys, OAuth, or CLI/local sources where that provider supports them.
- Keychain access (prompted by macOS):
Chromium cookie import needs the browser’s Safe Storage item, and an explicitly enabled Claude OAuth repair may
read Claude Code’s own Keychain item. Background CodexBar paths fail or skip instead of requesting authorization;
a user-initiated import or repair can still show the macOS prompt. Settings → Advanced → Disable Keychain
access blocks CodexBar-owned Keychain operations and browser decryption, but cannot constrain provider-owned CLIs
that CodexBar launches. Manual cookie headers, API keys, and file-backed sources remain alternatives where
supported. See Keychain prompts for Allow Once vs. Always Allow, recurring grants, and
safe troubleshooting.
- Files & Folders prompts (folder/volume access): CodexBar launches provider CLIs and local probes for some providers. If those helpers read a project directory or external drive, macOS may ask CodexBar for that folder/volume (e.g., Desktop or an external volume). This is driven by the helper’s working directory, not background disk scanning.
- What we do not request in the background: no Screen Recording or Accessibility permissions; user-triggered helper actions may ask macOS for Automation permission to open Terminal. No passwords are stored (browser cookies are reused when you opt in).
Docs
Getting started (dev)
- Clone the repo and open it in Xcode or run the scripts directly.
- Launch once, then toggle providers in Settings → Providers.
- Install/sign in to provider sources you rely on (CLIs, browser cookies, OAuth/device flow, API keys, or local app/config files).
- Optional: set OpenAI cookies (Automatic or Manual) for Codex dashboard extras.
Build from source
Requires macOS 14+ and Swift 6.2+.
./Scripts/package_app.sh # builds CodexBar.app in-place with ad-hoc signing
open CodexBar.app
Dev loop:
./Scripts/compile_and_run.sh
./Scripts/compile_and_run.sh --test # also run the sharded test suite before packaging/relaunching
make check # SwiftFormat + SwiftLint
make docs-list # list docs with frontmatter summaries
CLI install:
# after installing CodexBar.app in /Applications
./bin/install-codexbar-cli.sh
Related
- ✂️ Trimmy — “Paste once, run once.” Flatten multi-line shell snippets so they paste and run.
- 🧳 MCPorter — TypeScript toolkit + CLI for Model Context Protocol servers.
- 🧿 oracle — Ask the oracle when you're stuck. Invoke GPT-5 Pro with a custom context and files.
Looking for a Windows version?
Linux desktop integration?
- CodexBar GTK — Community GTK4/libadwaita front-end with usage, spending, and agent sessions from the CodexBar Linux CLI.
- codexbar-waybar — Waybar custom module + GTK4 popover for Hyprland / Sway / other Wayland compositors, built on top of the bundled Linux CLI.
- codexbar-cosmic-applet — Native COSMIC (System76) desktop panel applet with a tab per provider, pace projections, and cost/token stats, built on top of the bundled Linux CLI.
- Codexbar GNOME — GNOME Shell extension that brings CodexBar usage into the desktop panel.
- codexbar-cinnamon-applet — Linux Mint Cinnamon panel applet powered by CodexBar's JSON output.
- noctalia-codex-usage — Noctalia/Quickshell plugin that shows Codex 5-hour and weekly usage limits, built on top of the bundled Linux CLI.
- KodexBar — KDE Plasma widget that shows CodexBar usage in the Plasma panel, built on top of the bundled Linux CLI.
- codexbar-plasmoid — KDE Plasma 6 widget for CodexBar's meter icon, provider switcher, quota windows, pace, credits, local cost, and status, powered by the bundled Linux CLI.
- CodexBar Plasma — KDE Plasma 6 widget with multi-provider views, account selection, cost history, notifications, configurable providers, and installable
.plasmoid releases, powered by the bundled Linux CLI.
- CodexBar AgentView — KDE Plasma 6 widget with usage meters, agent-session search, terminal focus, and kitty session restoration, powered by the bundled Linux CLI.
Desk display
- AI Monitor — ESP32 desk display (Cheap Yellow Display) plus a macOS companion app that shows Claude, ChatGPT, Gemini, Copilot, Cursor and Antigravity limits as rings or bars, fed over USB by the bundled CLI. No Wi-Fi on the device, 3D-printable case.
- TokenTV — Python host that shows Claude and Codex 5-hour and weekly limits on compatible 240×240 Wi-Fi desk clocks (GeekMagic SmallTV style), using the bundled CLI or
codexbar serve. It uploads rendered screens to the clock's stock photo album without changing its firmware.
Status bar & terminal integration
-
showy-quota — always-on AI plan quota strips for SketchyBar, tmux, and Zellij (standalone WASM plugin), built on codexbar serve / the bundled CLI.
-
AI Usage Limits — Elgato Stream Deck integration for macOS: shows a selected CodexBar provider, account, and configurable quota or payload metrics on keys and Stream Deck+ dials, using local codexbar serve.
-
ccx — macOS menu bar companion for Claude Code/Codex task handoff, using codexbar usage --provider both --format json for quota warnings.
Phone & web
- Starbridge — Community-maintained Android and web app that displays quota windows from the CodexBar CLI on macOS and Linux, with optional quota alerts.
- Notify! CodexBar — Community-maintained macOS companion that reads CodexBar CLI or local
codexbar serve output and sends selected usage through Notify! for iPhone/iPad widgets, Live Activities, and quota notifications.
Credits
Inspired by ccusage (MIT), specifically the cost usage tracking.
License
MIT • Peter Steinberger (steipete)