Repository navigation
aweswitch usage shows quota usage for Codex official accounts — remaining credits, per-window limits with progress bars, and reset times — in human-readable or JSON output. The new usage command reads the same auth credentials apply and account login already manage, so no extra setup is needed.
Highlights
- New
aweswitch usage [accounts...]command: pass account names or--all-codexto select every official account - Human output renders each quota window as a labeled progress bar (
[ ████··· ] 73% left (resets 09:00 on 18 Sep)) --jsonoutputs the normalized payload; sensitive credential fields are redacted--all-codexflag queries every Codex official account in one call- Per-account errors surface cleanly (
account: error: ...) without aborting the whole run - New
src/aweswitch/usage.pymodule: credential loading fromauth.jsonor account blob, quota fetch via Codex's/backend-api/wham/usageendpoint (plus best-effort/backend-api/wham/profiles/me), payload normalization intoplan/windows/credits/token_profile reset_unix_timestampconverted to local time in human output; bare-number credits accepted; top-leveltoken_profilesurfaced- Credential loading hardened: access token validated as non-empty string, fallback blob accepted, never writes files
- CLI integration:
usageregistered as a reserved profile name, errors redacted via existingSECRET_REpattern,--jsonflag handled alongside the command's own--json - Full test coverage:
tests/test_usage.py(transport stubs, credential edge cases, payload normalization, progress bar math, window labels) andtests/test_aweswitch.py(CLI wiring,--all-codex, redaction, error paths)