-
Notifications
You must be signed in to change notification settings - Fork 518
Description
Is your feature request related to a problem? Please describe.
CodexBar is fantastic for real-time monitoring of AI platform quotas directly in the menu bar. However, tracking usage trends over time (e.g., long-term token consumption, monthly cost analysis, or plotting usage curves) currently requires writing custom scripts to regularly poll the CLI and parse the output manually.
Describe the solution you'd like
I would love to see native support for exporting metrics in the standard Prometheus text format. This would allow users to easily integrate their usage data into standard observability stacks like Prometheus + Grafana.
Two potential implementations to consider:
- CLI format flag (Recommended & Less intrusive): Add a command like
codexbar --format prometheus. Users can set this up as a cron job to output to a file, which can then be automatically scraped by the Prometheus Node Exporter'stextfile collector. - Built-in lightweight HTTP Server (Optional): A toggle in the Settings to expose a local HTTP endpoint (e.g.,
http://localhost:9090/metrics) that serves standard Prometheus plain-text metrics.
Example Output:
# HELP codexbar_requests_remaining Remaining requests/messages for the provider
# TYPE codexbar_requests_remaining gauge
codexbar_requests_remaining{provider="claude", window="session"} 42
codexbar_requests_remaining{provider="cursor", window="monthly"} 150
# HELP codexbar_resets_in_seconds Time in seconds until the next limit reset
# TYPE codexbar_resets_in_seconds gauge
codexbar_resets_in_seconds{provider="claude", window="session"} 3600
# HELP codexbar_token_cost_total Estimated token cost in USD
# TYPE codexbar_token_cost_total counter
codexbar_token_cost_total{provider="vertexai"} 0.15
Describe alternatives you've considered
Currently, the only alternative is building a custom wrapper service that executes codexbar via CLI, parses the custom output, and exposes a /metrics endpoint. Native support would significantly simplify this workflow, especially for those using the Linux CLI builds.
Additional context
This feature would drastically expand CodexBar's use cases. For example, users could build centralized Grafana dashboards to monitor AI expenses across all providers (Claude, Codex, Cursor, etc.) or set up Alertmanager to trigger notifications before a session or weekly quota is completely exhausted.