Codex Shift is a small CLI and macOS menu bar app that runs Codex with isolated
CODEX_HOME directories, so you can switch between work and personal Codex
account contexts.
Codex stores local state such as config, auth, logs, and sessions under
CODEX_HOME. By giving each account its own home directory, we can switch
contexts without copying or editing auth files directly.
npm install
npm link
cxs add company
cxs add personal
cxs delete personal
cxs add personal
cxs login company
cxs login personal
cxs run company
cxs run personalInstall the Electron development dependency first:
npm installThen start the macOS menu bar app:
npm run trayThe tray app reads the same profiles as the CLI. From the menu bar you can:
- create a new profile by entering a profile name
- delete a profile after a confirmation prompt
- show experimental Codex usage status next to each profile
- show the most recently opened profile's primary remaining usage next to the tray icon
- open each profile's actions from its submenu
- activate the existing Codex macOS app from a profile submenu
- run Login in Browser for a selected profile, with Terminal login as a fallback
- open the profiles folder
The menu bar app needs the Codex CLI for Login in Browser and Login in
Terminal. It detects common Homebrew, npm/nvm, Volta, and pnpm installation
locations. If your installation is elsewhere, launch the app with
CXS_CODEX_PATH set to the full path of the codex executable.
By default, the tray looks for an app named Codex. You can override that name
when launching the tray:
CXS_CODEX_APP_NAME="Codex" \
npm run trayOpen App launches Codex with the selected profile's CODEX_HOME when Codex is
not already running. If Codex is already running, the tray asks whether to keep
the existing workspace active or quit and reopen Codex with the selected profile.
Profile-specific terminal execution is also available through cxs run.
The tray app refreshes Codex usage state every 10 minutes and immediately after launching Codex from the tray. Each profile displays one of these states:
Needs login
Unknown
Last known
This is intentionally separate from the OpenAI API usage/costs API. The app uses
the selected profile's ChatGPT auth token to call Codex usage endpoints observed
in the local Codex client. If the request or parser fails, the app keeps the last
known parsed value when one exists and otherwise shows Unknown.
For a distributable macOS build:
npm run pack:macThis project is currently distributed without an Apple Developer ID certificate or Apple notarization. macOS therefore marks the app as quarantined after it is downloaded from GitHub; this is expected and does not mean the DMG is corrupted.
- Open the downloaded DMG and drag
Codex Shift.appintoApplications. - In Finder, Control-click
Codex Shift.app, then choose Open and confirm.
If macOS instead reports that the app is damaged, remove the download quarantine
attribute after copying it to Applications:
xattr -dr com.apple.quarantine "/Applications/Codex Shift.app"Then open the app normally. Only run this command for a release you downloaded from this repository.
Release builds use an explicit ad-hoc signature and disable the hardened runtime because they are not Developer ID signed. This makes the unsigned-build intent clear, but it does not replace Apple signing or notarization; a Developer ID signed and notarized release is required for a warning-free macOS installation.
In the packaged app's menu bar menu, enable Launch at login to start Codex Shift automatically when you sign in to macOS. Disable the same item to remove it from the macOS login items list. This option is unavailable while running the app in development mode.
cxs add <profile> [--label <name>]
cxs delete <profile>
cxs list
cxs use <profile>
cxs current
cxs path <profile>
cxs env <profile>
cxs login <profile>
cxs run [profile] [-- <codex args...>]
cxs exec [profile] -- <prompt or codex exec args...>If you omit the profile for run or exec, the CLI shows a numbered profile
list in the terminal:
cxs run
cxs exec -- "review this change"Profiles:
~/.codex-profiles/<profile>
Current profile state:
~/Library/Application Support/Codex Shift/current-profile.json
For tests or custom layouts, override these paths:
CXS_PROFILES_DIR=/tmp/codex-profiles \
CXS_STATE_DIR=/tmp/codex-shift-state \
cxs add company- Add a Tauri menu bar app that calls this CLI core.
- Add account labels and icons in a small settings UI.
- Improve the experimental Codex usage parser as response shapes evolve.
- Add shell integration helpers such as
codex-companyandcodex-personal.