feat: add macOS menu bar wrapper (contrib) - #8
Open
anlvdt wants to merge 29 commits into
Open
Conversation
A lightweight Python menu bar app using rumps that wraps the codex-account-switcher CLI for a native macOS menu bar experience. Features: - ⚡ persistent menu bar icon showing current account - One-click account switching with auto Codex restart - Non-destructive 'Add New Account' flow - Delete saved snapshots from menu - Auto-start on login via LaunchAgent - Usage/quota display per account Files: - contrib/macos-menubar/codex_switcher.py — main app - contrib/macos-menubar/setup.sh — install script (venv + LaunchAgent) - contrib/macos-menubar/requirements.txt — deps (rumps) - contrib/macos-menubar/README.md — documentation
Owner
|
Since this is python and would introduce a dependency I would say it makes most sense to keep it in your own fork for now. This way the releases can simply be installed stand-alone, the python wrapper would complicate that. And since this is 100% Rust for now, I'd like to keep it that way. In case you want to re-do that in rust, you're more than welcome to open another PR! The feature is, of course, great though! |
…es with switch notifications
…ic Codex restarts in background auto-switch
…polish Add native tray Add New Account session, regenerate macOS icons and app packaging scripts, and improve quota UX (Past reset label, auto-refresh wording). Auto-switch now refreshes usage before switching, notifies even when Codex is closed, and runs an immediate check when enabled from tray. Co-authored-by: Cursor <cursoragent@cursor.com>
Add budget-based pick-best switching inspired by community tools, plus login/save, current, rename labels, JSON import/export bundles, switch activity logging, tray best-quota action, and startup usage refresh. Co-authored-by: Cursor <cursoragent@cursor.com>
Expose refresh-usage CLI, TUI actions for batch quota refresh, best-quota switch, and account labels, plus ZIP import/export via bundle.json archives. Co-authored-by: Cursor <cursoragent@cursor.com>
External volumes may not be mounted when LaunchAgents run at login; wait for the binary and bootstrap the agent so startup registration sticks. Co-authored-by: Cursor <cursoragent@cursor.com>
Score switch targets by remaining quota, reject rate-limited or stale cache entries, and only switch when the target materially improves on the current account. Add near-limit threshold and adaptive poll settings. Co-authored-by: Cursor <cursoragent@cursor.com>
Defer auto-switch while Codex is running, add Cancel/Wait/Switch now prompts in TUI and tray, fix tray icon lifecycle with detached spawn and background tasks, and add open-menubar.command launcher. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Duplicate tray spawns and binaries on external volumes caused silent exits. Install a boot-volume copy, detach with setsid, flock the tray lock, and restart via pid-aware launcher instead of broad pkill. Co-authored-by: Cursor <cursoragent@cursor.com>
… exits Point LaunchAgent at the installed menubar binary, ensure launchctl bootstrap when enabled, stop open-menubar from killing a live tray, and wait up to 120s for Codex to finish before urgent quota auto-switches. Co-authored-by: Cursor <cursoragent@cursor.com>
…ter readability in tray
…e raw workspace UUIDs
…h UX Ship a local web Overview + popover dashboard, Cursor/Claude usage and cookie import, and process handling only at switch time (no always-on blockers banner). Fix Claude tray quota when live identity has no email, and prefer non-blocking status polls for keychain/CLI timeouts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A lightweight Python menu bar app that wraps the
codex-account-switcherCLI, providing a native macOS menu bar experience for quick account switching — no TUI needed.Features
How it works
The wrapper calls
codex-account-switcherCLI commands (status --json,list --json,save,activate,delete) under the hood, so all auth management is handled by the existing Rust implementation.Files
Install
cd contrib/macos-menubar chmod +x setup.sh ./setup.shRequirements
codex-account-switcherCLI on PATHMenu
Motivation
Many macOS users prefer a persistent menu bar icon over a TUI for quick account switching. This wrapper provides that experience while leveraging the existing CLI for all auth operations.