Track Gemini CLI token usage
Counted through burnlog wrap. One prefix on the command you were going to run anyway, and every call is measured from the response Google sends back.
Counting Gemini CLI in under a minute
- 01Prefix the command$ burnlog wrap -- gemini
wrap sets GOOGLE_GEMINI_BASE_URL and GEMINI_BASE_URL at a loopback server for the lifetime of that command, and unsets them after.
- 02Work normally
Requests forward to Google over ordinary HTTPS. The usage field on each response is read on the way back, then bucketed by model.
- 03Sync when you're done$ burnlog sync
Events are written to the local sink as they happen, so an offline session still counts and uploads later.
Why there's no log to read
Some agents write their usage to a readable file, and burnlog reads it. Gemini CLI does not, which leaves exactly two options: guess, or measure the traffic. burnlog measures.
The measurement is the provider's own accounting, not an estimate — the same usage object Google computes the bill from. A tokenizer-based approximation would be wrong in both directions and would drift with every model revision.
It's the same mechanism for everything else
wrap is agent-agnostic: aider, opencode, a Python script, a cron job, a homegrown agent. If it reads the standard base-URL variables — and virtually every SDK does — its tokens can be counted without that tool knowing burnlog exists.
Anything that writes to ~/.burnlog/events/*.jsonl is picked up on the next sync, in any language, without waiting for a burnlog release. That open sink is how a tool burnlog has never heard of still lands on the board.
What burnlog can't see
Put Gemini CLI on the board
One command. It scans, shows you your numbers, and only then asks for an account.