-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Feature] feat: Add token and quota usage display at the bottom of the CLI (inspired by Claude Code) #1137
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
What does this PR do?
This PR introduces a real-time token and quota usage display at the bottom of the terminal during an active oh-my-codex session. The UX is heavily inspired by Claude Code, providing a clean and non-intrusive way to monitor API consumption directly within the CLI.
Why is this change needed?
Currently, users have limited visibility into their API costs and token consumption while running tasks in Codex. By surfacing this information directly in the footer (HUD), developers can effortlessly track their usage and remaining quota without breaking their workflow or needing to log into the provider's dashboard.
Key Changes
- Usage Tracker: Added logic to extract and accumulate token metrics (
prompt_tokens,completion_tokens,total_tokens) from the API response payload. - CLI Footer UI: Implemented a persistent status bar at the bottom of the terminal to display the current session's usage and quota details.
- Rendering Adjustments: Updated the terminal rendering loop to ensure the usage display anchors securely to the bottom and does not interfere with the main conversational output or long-running workflows like
$teamand$plan.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request