The account manager OpenAI forgot to ship
Because OpenAI's Codex CLI assumes you only have one identity.

What it does
codex-auth is a Zig-built CLI that manages multiple OpenAI Codex identities from the terminal. It stores credentials, lets you swap the active account, and tracks usage limits across profiles. It supports the Codex CLI, VS Code extension, and the standalone Codex App.
The interesting bit
The tool ships through npm despite being written in Zig, and it offers two refresh modes for usage data: a live API mode that pings OpenAI’s servers directly, and a safer local-only mode that scrapes rollout logs. The experimental app command even tries to hot-swap accounts without restarting the Codex App by injecting a forked CLI via environment variables.
Key highlights
- Supports account listing, switching, aliasing, and bulk import or export of auth tokens
- Can rebuild the account registry from scattered auth files
- Offers both API-backed and local-only usage refresh; the latter avoids sending tokens to OpenAI but may lag by hours
- Includes a live TUI mode with configurable refresh intervals
- Experimental app launcher targets seamless switching for new and resumed chats
Caveats
- Account switches for the Codex CLI and Codex App require a client restart to take effect
- The
appcommand is explicitly experimental and may break your Codex App installation - API-backed usage refresh sends your ChatGPT access token to OpenAI endpoints, which the README warns could violate terms of service
- Documentation is currently based on v0.3.x, but some described commands may not exist in the latest release
Verdict Worth a look if you manage multiple Codex accounts and are tired of manual credential shuffling. Skip it if you only have one account or if “experimental” and “may break your app” make you nervous.
Frequently asked
- What is Loongphy/codex-auth?
- Because OpenAI's Codex CLI assumes you only have one identity.
- Is codex-auth open source?
- Yes — Loongphy/codex-auth is open source, released under the MIT license.
- What language is codex-auth written in?
- Loongphy/codex-auth is primarily written in Zig.
- How popular is codex-auth?
- Loongphy/codex-auth has 2.4k stars on GitHub and is currently accelerating.
- Where can I find codex-auth?
- Loongphy/codex-auth is on GitHub at https://github.com/Loongphy/codex-auth.