Use multiple Codex accounts locally without changing how the official Codex CLI works.
The installed commands are still short:
cx # run Codex with automatic account selection
cxa # same idea, explicit auto mode
cxr # resume the last conversation
cx-setup # create account folders and shared statenpm install -g github:rmqg/codex-multi-accountUpdate with the same command.
Create account folders. Replace 3 with your account count.
cx-setup --accounts 3 --migrateLog in once per account:
CODEX_HOME="$HOME/.codex-account1" codex login
CODEX_HOME="$HOME/.codex-account2" codex login
CODEX_HOME="$HOME/.codex-account3" codex loginCheck everything:
cx status
cx quotacx-setup does not symlink config.toml: each account can need its own
login/provider/profile defaults. If your shared ~/.codex/config.toml contains
top-level user-only settings such as notify, setup syncs them into every
account config and removes them from the shared config so Codex will not treat
them as unsupported project-local settings.
cx quota shows a weighted weekly total first, then one weekly bar and reset time for each account.
It identifies the weekly quota by Codex's reported 10080-minute window instead of assuming primary or secondary means a fixed quota type.
When Codex does not report a capacity for the weekly window, that account is counted as one equal-weight unit and the total label says so.
Quota probes use a 30s timeout, 3 attempts, and a 1500ms retry delay by default; tune CX_LIMIT_TIMEOUT_MS, CX_LIMIT_RETRIES, and CX_LIMIT_RETRY_DELAY_MS if your network is unstable.
During one auto-switched task, model/profile/reasoning defaults stay with the task.
New Codex task runs leave service_tier unset so Codex can use the selected model's default without unsupported-tier warnings.
If you use /fast or /fast on during the task, retries inherit service_tier="fast"; /fast off removes that override instead of changing reasoning effort.
If the interrupted session records a later reasoning effort, for example from /slow or turn context, retries keep that reasoning effort too.
Run Codex:
cxa
cx exec "explain this repo"
cxrInstall the direct codex wrapper so plain codex also auto-trusts the current project:
cx-setup --install-codex-wrapper --forceLicense: GPL-3.0-only.