Skip to content

v0.7.1

Latest

Choose a tag to compare

@github-actions github-actions released this 17 Sep 12:38

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-codex to select every official account
  • Human output renders each quota window as a labeled progress bar ([ ████··· ] 73% left (resets 09:00 on 18 Sep))
  • --json outputs the normalized payload; sensitive credential fields are redacted
  • --all-codex flag queries every Codex official account in one call
  • Per-account errors surface cleanly (account: error: ...) without aborting the whole run
  • New src/aweswitch/usage.py module: credential loading from auth.json or account blob, quota fetch via Codex's /backend-api/wham/usage endpoint (plus best-effort /backend-api/wham/profiles/me), payload normalization into plan / windows / credits / token_profile
  • reset_unix_timestamp converted to local time in human output; bare-number credits accepted; top-level token_profile surfaced
  • Credential loading hardened: access token validated as non-empty string, fallback blob accepted, never writes files
  • CLI integration: usage registered as a reserved profile name, errors redacted via existing SECRET_RE pattern, --json flag 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) and tests/test_aweswitch.py (CLI wiring, --all-codex, redaction, error paths)