Skip to content

jasonliu1199/CodexAccSwitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codex Account Switch (CodexAccSwitch)

Codex account switcher for OpenAI Codex CLI on macOS. Manage multiple Codex auth.json profiles, switch accounts safely, and launch a menu bar switcher app.

Keywords: codex account switcher, codex auth manager, codex profile switch, openai codex account switch, codex menubar app.

Codex account switching toolkit with:

  • CLI (codex-account-switch)
  • macOS Menu Bar app (Codex Account Switch.app)

What it does

  • Saves current Codex auth as a named profile
  • Switches active auth to another saved profile
  • Backs up current auth before each switch
  • Shows which profile is currently active
  • Works with default ~/.codex and custom CODEX_HOME

Install

From this repo root:

chmod +x ./codex-account-switch

Optional global command:

ln -s "$(pwd)/codex-account-switch" /usr/local/bin/codex-account-switch

Usage

./codex-account-switch save work
./codex-account-switch save personal
./codex-account-switch list
./codex-account-switch switch personal
./codex-account-switch status
./codex-account-switch rename personal alt
./codex-account-switch delete alt

macOS Menu Bar App

Build the app bundle:

./build-menubar-app.sh

Launch it:

open "./dist/Codex Account Switch.app"

Or one command build + launch:

./run-menubar.sh

Menu features:

  • Show active profile in menu bar (Cdx:<name>)
  • Click a profile to switch (requests quit, then auto reopens after Codex is fully closed)
  • Save current auth as a new profile
  • Delete saved profiles
  • Open profile folder in Finder

Storage layout

Default Codex home: ~/.codex

  • Profiles: ~/.codex/account-switch/profiles/*.json
  • Backups: ~/.codex/account-switch/backups/auth-YYYYmmdd-HHMMSS.json
  • Active auth: ~/.codex/auth.json

You can override the location with CODEX_HOME:

CODEX_HOME=/path/to/custom/.codex ./codex-account-switch list

Safety notes

  • Profile names are limited to: letters, numbers, ., _, -
  • Auth files are chmod to 600 when possible.
  • This tool copies files only; it does not edit token contents.

About

Codex account switcher for OpenAI Codex CLI: save and switch auth.json profiles with backup and a macOS menu bar app.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors