Skip to content

[Feature] feat: Add token and quota usage display at the bottom of the CLI (inspired by Claude Code) #1137

@Felixqaq

Description

@Felixqaq

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 $team and $plan.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions