prodex
prodex is a CLI wrapper for codex that separates multiple profiles by giving each one its own CODEX_HOME.
Install from crates.io:
For the shorter version, see QUICKSTART.md.
In short:
- one
prodexprofile = oneCODEX_HOMEdirectory - login is still handled by
codex prodexmanages profiles, the active profile, built-in quota checks, and launchingcodex
The mental model is similar to browser profiles, but for codex.
Quick Start
1. Install
Package page:
https://crates.io/crates/prodex
2. Import your current codex profile
If you already have an active login in ~/.codex:
This will:
- copy
~/.codexinto a new managed profile - store the profile in
~/.prodex/profiles/main - set
mainas the active profile
3. Log in and let prodex create the profile
If you want a fresh login, prodex can create or reuse a profile automatically from the account email:
This will:
- run
codex loginin a temporary isolatedCODEX_HOME - resolve the logged-in account email from the ChatGPT
id_tokenstored inauth.json - create a managed profile whose name is derived from that email
- reuse the existing profile instead of creating a duplicate when that email is already registered
- switch the active profile to the reused or newly created profile
If the email-derived profile name is already taken by a different account, prodex keeps the email uniqueness rule and creates a suffixed name such as main_example.com-2.
If you want to target a specific existing profile name instead:
Use prodex login --profile <name> when you want a fixed profile name, or when you are not using the ChatGPT login flow that writes an email-bearing id_token.
prodex login still delegates the actual authentication flow to codex.
4. View all quotas
Example MAIN column:
5h 37/100 used | weekly 12/100 used
5. Select the active profile and run codex
Or run directly with a specific profile:
Requirements
prodex relies on the following binaries:
codex
Quick check:
If you want to audit the prodex environment:
How It Works
prodex stores its own state in:
~/.prodex
The main structure is:
state.json: the list of profiles and the active profileprofiles/<name>: the managedCODEX_HOMEfor each profile
Authentication is still stored by codex inside each profile's auth.json.
Most Common Commands
Profile Management
Install from crates.io:
Add an empty profile:
Import from ~/.codex:
List all profiles:
Select the active profile:
Remove a profile:
Remove a profile and its managed home:
Login/Logout
Log in and auto-create or reuse a unique profile based on the email you use:
This only works when the login flow writes a ChatGPT id_token with an email claim into auth.json.
Log in to a specific profile:
Log out from a specific profile:
Quota
Show quota for one profile:
Show raw quota JSON:
View all profiles at once:
Run codex
Run codex with the active profile:
Run codex with arguments:
Run with a specific profile:
Temporarily disable auto-rotate:
Skip quota preflight:
Quota Behavior
Before prodex run launches codex, prodex tries to check quota for the selected profile.
Before a profile is considered safe to use, prodex requires both the 5h and weekly quota windows to be present and still below 100/100.
If that profile does not clearly have remaining required quota:
prodex runtries to rotate to the next ready profile by default, including when you pass--profile- if you want the command to stay blocked on that profile instead, use
--no-auto-rotate - it prints the missing, unknown, or exhausted quota reasons
- it suggests other profiles that appear ready, when available
If auto-rotate succeeds, the active profile is updated to the profile that was used.
Important Notes
- quota checks are built into
prodexand use the ChatGPT backend endpoint used by Codex - ChatGPT quota can only be read when the profile uses ChatGPT auth, not an API key
prodex loginwithout--profiledepends on being able to read the ChatGPT account email fromtokens.id_tokeninauth.json- if a profile uses API key auth,
quota --allwill showerrorfor that profile prodexdoes not replacecodex; it only acts as a launcher and profile manager
Environment Variables
Override the prodex state location:
PRODEX_HOME=/path/to/prodex-home
Override the codex binary:
PRODEX_CODEX_BIN=/path/to/codex
Override the default ChatGPT quota base URL:
CODEX_CHATGPT_BASE_URL=https://chatgpt.com/backend-api
Development
Run during development:
Tests: