Codex MeterEnglish · Português See your Codex account, quota and token usage in the VS Code Activity Bar.
The data comes from the official Codex App Server, the JSON-RPC interface the Codex IDE extension also uses. The extension never reads How it worksThe extension starts
Details:
Which
|
| Setting | Default | |
|---|---|---|
codexMeter.codexPath |
"" |
Path to the codex executable |
codexMeter.refreshIntervalSeconds |
120 |
Polling interval (minimum 30) |
codexMeter.display |
used |
Whether bars show used or remaining percentage |
codexMeter.statusBar |
true |
Shows 5% · 60% in the status bar |
codexMeter.localTokenFallback |
true |
Uses local session logs when account/usage/read is unavailable |
Commands: Codex Meter: Refresh, Restart Codex App Server, Show Log and Open Settings.
Development
npm install
npm test # compile + unit tests (node:test)
# F5 in VS Code → "Run Extension"
npm run package # builds codex-meter-<version>.vsix
src/
├─ extension.ts activation, commands, config wiring
├─ UsageController.ts owns the App Server connection, polling, notifications
├─ codex/
│ ├─ AppServerClient.ts JSON-RPC over stdio (spawn, framing, timeouts, restart)
│ ├─ AccountService.ts account/read
│ ├─ UsageService.ts account/rateLimits/read, account/usage/read (+ fallback)
│ ├─ LocalSessionUsage.ts token estimate from rollout logs
│ └─ resolveCodex.ts picks the codex executable
├─ views/
│ ├─ UsageViewProvider.ts WebviewViewProvider (CSP + nonce)
│ ├─ StatusBar.ts
│ └─ viewState.ts pure data → display strings (unit-tested)
├─ models/ wire types from `codex app-server generate-ts`
└─ util/ formatting, token stats
media/ webview script, theme-aware CSS, activity bar icon
To check the protocol types against your installed Codex, run codex app-server generate-ts --out ./schema.