@zle13/pi-codex-auth0.2.5
OpenAI Codex multi-account switcher and quota monitor extension for Pi Coding Agent
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@zle13/pi-codex-auth
OpenAI Codex multi-account switcher and 5-hour/weekly quota monitor for Pi Coding Agent, integrating @loongphy/codex-auth with Pi's auth, footer, and below-editor quota bar.
Prerequisites
Install @loongphy/codex-auth globally and register your accounts:
npm install -g @loongphy/codex-auth
codex-auth login
# Optional: set friendly aliases
codex-auth alias set <query> work
codex-auth alias set <query> personal
If npm installs the CLI but your shell can’t find it, add $(npm prefix -g)/bin to PATH.
Installation
pi install npm:@zle13/pi-codex-auth
pi -e npm:@zle13/pi-codex-auth # try for one session
Features
- Fast switching & autocomplete: switch via interactive TUI picker (
/codex-auth), alias, email substring, row number (/codex-auth 1), or previous-account toggle (/codex-auth -), with full tab completion. - Live quota & credit tracking: displays remaining 5-hour and weekly rate limits, reset countdowns, and credit balances—refreshed at session start and after Codex responses (throttled to 90s; force anytime with
/codex-auth refresh). - Footer badge & below-editor bar: shows a compact status badge (
codex #work · 5h 95% · 7d 99%) in Pi's footer (promoted to Line 1 by@zle13/pi-footer) and a subtle quota line below the editor. Toggle settings persist in~/.pi/agent/codex-auth.json. - Live file watcher: detects external
codex-authswitches from other terminals and updates Pi immediately. - Managed OAuth sync: leaves standalone Pi and Codex logins alone unless the
codex-authregistry verifies the account. Background imports skip expired tokens and never replace same-account credentials with a token that expires sooner. A deliberate/codex-auth switchcan still select a managed account whose access token needs refreshing.
Commands
| Command | Description |
|---|---|
/codex-auth |
Open the interactive TUI account picker |
/codex-auth - |
Switch back to the previously active account |
/codex-auth <query> / switch <query> |
Switch by alias, email fragment, row number, account name, or - |
/codex-auth list / status |
Show all accounts, 5h & weekly quotas, and credit balances |
/codex-auth alias set <query> <alias> |
Set an alias for an account |
/codex-auth alias clear <query> |
Clear an account's alias |
/codex-auth sync |
Sync verified managed credentials between ~/.codex and Pi |
/codex-auth refresh |
Fetch the active account's current quota immediately |
/codex-auth widget on|off |
Toggle the quota bar below the editor |
/codex-auth footer on|off |
Toggle the footer status badge |
License
MIT — see LICENSE.