Native multi-account ChatGPT OAuth profiles and per-account usage
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Use case
Codex users may need to work with personal, work, or client ChatGPT accounts without repeatedly replacing CODEX_HOME or ending the current session.
Proposed behavior
- Persist several named ChatGPT OAuth profiles locally.
-
- Provide account list/status/select/enable/disable/remove workflows.
-
-
- Provide an in-session /account TUI menu and /account login.
-
-
-
-
- Show per-account usage percentage, backend-provided window duration, and reset time.
-
-
-
-
-
-
- Fetch usage with the selected profile own bearer and ChatGPT-Account-Id.
-
-
-
-
-
-
-
-
- Keep usage viewing read-only: it must not switch the active account or refresh credentials.
-
-
-
-
-
-
-
-
-
-
- Treat failed usage reads as unavailable/unknown, not as exhausted quota.
-
-
-
-
-
-
-
-
-
-
-
-
- Make logout explicit and local-profile-only.
-
-
-
-
-
-
Prototype
I implemented a working prototype in my public fork:
https://github.com/ALV0612/codex/tree/feat/native-multi-account-auth
The branch includes account-pool storage, CLI/TUI integration, account-bound usage reads, TTL/version-aware caching, safe error handling, and focused tests.
Validation completed:
- per-account usage isolation test
-
- usage failure handling test
-
-
- credential-version cache invalidation test
-
-
-
-
- TUI account-menu rendering test
-
-
-
-
-
-
- cargo check -p codex-tui
-
-
-
-
-
-
-
-
- release binary build
I understand this repository currently restricts pull requests to collaborators, so I am sharing the implementation and design here for consideration rather than opening an external PR.
- release binary build
-
-
-
-
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the account-pool storage, CLI/TUI integration, and account-bound usage reads described in the prototype, then run the listed focused tests and cargo check -p codex-tui. Done should include named profile workflows, isolated per-account usage with safe failure handling, explicit local logout, and the stated TUI and build validations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, authentication, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100