codex-profiles manages multiple Codex accounts from one WSL user by giving each account its own CODEX_HOME while selectively sharing local continuity state.
This avoids brittle auth.json swapping while keeping local history, sessions, and resume behavior usable across accounts.
Using one ~/.codex for multiple accounts is awkward because:
- refresh tokens rotate, so copying
auth.jsonback and forth is fragile resumedepends on local state, not just remote auth- account switching should not destroy local continuity
codex-profiles solves that by splitting state into:
- per-profile auth and account-local files
- a shared local continuity area for history, sessions, and thread index state
The public example config is profiles.toml.example.
Example setup:
- default profile:
main - known profiles:
main,work,research,personal2 - aliases:
p1->mainp2->workp3->researchp4->personal2
Discover aliases directly:
codex-profiles aliases
codex-profiles aliases --jsonDiscover names and aliases together:
codex-profiles list --namesInstall directly from GitHub with pipx:
pipx install git+https://github.com/ecochran76/codex-profiles.git
codex-profiles --helpUpgrade later with:
pipx upgrade codex-profilesFor a repo checkout, install local helper artifacts:
codex-profiles install --shell zshCheck the active profile:
codex-profiles whichSwitch to another profile:
codex-profiles use p2Start Codex using the current profile:
codex-profile
codex-profile resume --lastStart Codex using a specific profile:
codex-profile p4Check overall health:
codex-profiles status
codex-profiles doctorSelection precedence:
- explicit CLI profile argument
CODEX_PROFILE- persisted current profile from
codex-profiles use ... default_profilefromprofiles.toml
Concurrency:
- multiple simultaneous Codex sessions are allowed when they use the same profile
- different active profiles are blocked from running at the same time
Completion:
codex-profilescompletes command namescodex-profileand several subcommands complete aliases and profile names
Safer launcher behavior:
codex-profile p2treatsp2as a profile because it is a known aliascodex-profile worktreatsworkas a profile because it is a known profilecodex-profile resume --lasttreatsresumeas a Codex argument, not a new profile- accidental junk profiles like
codex-resumeorcodex-whichshould no longer be created by normal launcher use
~/.codex/
shared/
config.toml
skills/
rules/
sessions/
history.jsonl
state_5.sqlite
state_5.sqlite-wal
state_5.sqlite-shm
codex-main/
auth.json
memories/
config.toml -> ../shared/config.toml
skills -> ../shared/skills
rules -> ../shared/rules
sessions -> ../shared/sessions
history.jsonl -> ../shared/history.jsonl
state_5.sqlite -> ../shared/state_5.sqlite
state_5.sqlite-wal -> ../shared/state_5.sqlite-wal
state_5.sqlite-shm -> ../shared/state_5.sqlite-shm