codex-switcher-11arkan
v2.1.4
Published
Interactive React + Ink CLI for running codex with isolated CODEX_HOME profiles.
Maintainers
Readme
Codex Switcher (React + Ink)
Interactive CLI to run codex with isolated CODEX_HOME profiles so multiple accounts can stay signed in and usable at the same time.
Stack
- React
- Ink
- TypeScript
- Node.js
Install
npm installInstall from npm
npm install -g codex-switcher-11arkan
codex-switcherBuild
npm run buildStart interactive CLI
# runs the Ink UI menu
npm run dev
# or after build
node dist/index.jsProduction usage
codex-switcher
codex-switcher usage --period monthCore commands
# list profiles
node dist/index.js list
# add profiles
node dist/index.js add work
node dist/index.js add personal
# login each profile
node dist/index.js login work
node dist/index.js login personal
# run codex in this terminal
node dist/index.js run work
# run codex in parallel (new terminal window)
node dist/index.js run work --new-window
node dist/index.js spawn personal -- chat
# switch account used by main while keeping main threads/settings in place
# (swaps auth artifacts with target profile and updates user CODEX_HOME)
node dist/index.js switch-main work
# login status for all profiles in one list
node dist/index.js status
# model-wise token + cost breakdown from local Codex session data
node dist/index.js usage
node dist/index.js usage work
# period views
node dist/index.js usage --period day
node dist/index.js usage --period month
node dist/index.js usage main --period monthAutomatic main profile detection
On startup, if main is missing, the app checks default CODEX_HOME (%USERPROFILE%\.codex unless CODEX_HOME is already set).
If that location is already logged in, it auto-registers as profile main.
Data locations
- Profile definitions:
%APPDATA%\CodexSwitcher\profiles.json - Default profile homes:
%USERPROFILE%\.codex-switcher\profiles\<profile-name>
Development
npm install
npm run typecheck
npm run build
npm run release:checkCI and release automation
- CI runs on every push/PR via
.github/workflows/ci.yml. - npm publish runs automatically on push to
mainwhenpackage.jsonversion is unpublished. RequiresNPM_TOKENsecret.
Contributing and policies
- See CONTRIBUTING.md
- See CODE_OF_CONDUCT.md
- See SECURITY.md
- See CHANGELOG.md
Notes
- Multiple Codex sessions are supported simultaneously via
--new-window/spawn. - Profile storage is lock-protected to avoid concurrent write corruption.
usageshows rows per model withinput,cached input,output,totaltokens,thread count, and estimated USD cost.- Cost uses standard API text-token pricing fetched at runtime from OpenAI docs: Pricing.
- Pricing is cached locally in-memory (success: 6h, fetch failure: 5m retry window).
- If a model is missing from the local pricing map, its row is still shown but cost is
n/a. - In interactive mode, profile creation uses typing; login/open/remove now use selectable profile lists.
switch-main <profile>keepsmainhome fixed and swaps auth artifacts (auth.json,cap_sid) betweenmainand target profile, somainthreads/settings remain in place.- After
switch-main, userCODEX_HOMEis updated on Windows so plaincodexfollowsmainin new terminals. - In interactive mode,
Usageopens a submenu with model view, daily cost view, and monthly cost view.
