Skip to content

theconomicat/Codex-Usage

Repository files navigation

Codex-Usage

한국어 README

macOS menu bar usage meter for OpenAI Codex.

Codex-Usage menu bar preview

Codex-Usage reads local Codex session logs from ~/.codex and keeps remaining 5-hour and weekly quota visible directly in the menu bar. You do not need to click the menu bar item to see the numbers. It is local-only and does not read Codex auth tokens.

Download

Download the latest macOS zip

Unzip it, then open Codex-Usage.app. If macOS blocks the first launch, right-click the app and choose Open.

What It Shows

The menu bar item is two compact circular gauges. The number inside each ring is remaining quota:

(79)   (96)

Left: 5-hour window. Right: weekly window.

Clicking the item opens a compact menu:

5h · 79% · reset 2h
1w · 96% · reset 6d

Launch at Login
Refresh
Quit Codex-Usage

Data Source

Codex-Usage reads only known local Codex usage logs:

~/.codex/sessions/**/*.jsonl
~/.codex/archived_sessions/*.jsonl

It looks for event_msg entries where payload.type == "token_count" and reads payload.rate_limits.primary and payload.rate_limits.secondary.

It does not read ~/.codex/auth.json.

Install From Source

Requirements:

  • macOS 13+
  • Xcode command line tools
  • OpenAI Codex app or CLI already used on this Mac

Build and open the app:

git clone https://github.com/theconomicat/Codex-Usage.git
cd Codex-Usage
./Scripts/package_app.sh
open ./Codex-Usage.app

To keep it installed, move Codex-Usage.app to /Applications.

Releases

Pushing a version tag builds the app on GitHub Actions and uploads Codex-Usage-macos.zip to a GitHub Release automatically.

git tag v0.1.0
git push origin v0.1.0

To build the same zip locally:

./Scripts/package_app.sh
ditto -c -k --norsrc --keepParent Codex-Usage.app Codex-Usage-macos.zip

Development

Print the latest local usage without opening the menu bar app:

swift run CodexUsage -- --print

Run tests:

swift test

Build an app bundle:

./Scripts/package_app.sh
open ./Codex-Usage.app

Notes

The Codex local JSONL format is not a public API, so this project treats parsing as best-effort and keeps the reader small and easy to update.

If a reset time passes before Codex writes a fresh log entry, Codex-Usage resets that window locally instead of showing stale usage.

License

MIT

About

Codex usage for macOS.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors