feat(cli): show official OAuth quota via hermes usage - #93282
feat(cli): show official OAuth quota via hermes usage#93282lorencato23 wants to merge 2 commits into
Conversation
Add a script-friendly quota command that reuses fetch_account_usage() for Codex, Claude, OpenRouter, and Nous. Surface the same snapshot as a one-line summary on hermes auth status and hermes status --all. Providers without a public quota API (including SuperGrok) report unsupported instead of a guessed number. Failures stay unavailable and do not crash status output. Closes NousResearch#33094
Overall: solid CLI surface for official quota data, with genuinely good test coverage (aliases, dispatch, exit codes, compact-line formatting). Points to consider:
Minor: |
Give _format_reset an include_local flag instead of splitting prose. Print an explicit empty-install message instead of only Grok unsupported. Show Claude and OpenRouter usage on hermes status --all and prefetch those official windows in parallel.
Summary
Add a non-interactive official quota surface so users do not have to open ChatGPT / Claude / OpenRouter to see remaining 5h and weekly allowance.
hermes usage [provider] [--json]hermes auth status <provider>hermes status --allReuses
fetch_account_usage()(Codex, Claude OAuth, OpenRouter, Nous). No new provider endpoints. SuperGrok /xai-oauthprintsunsupportedbecause xAI does not publish a quota API.This is not the CLI/TUI status-bar work in #44506 / #53375.
Closes #33094
Related: #57476
Test plan
python3 -m pytest tests/hermes_cli/test_usage_cmd.py tests/agent/test_account_usage.py tests/hermes_cli/test_status.py -q(27 passed)hermes usage openai-codex --jsonagainst a signed-in Codex accounthermes auth status openai-codexshows a usage linehermes usage grokreports unsupported without making an HTTP call