I built a small CLI that reads the logs your agents already keep and prints a thermal-printer receipt in the terminal, plus a PNG. It reads OpenCode, Claude Code and Codex CLI.
The OpenCode part, since that's what this sub cares about:
- it reads opencode.db ($XDG_DATA_HOME/opencode, otherwise ~/.local/share/opencode) with Node's built-in node:sqlite, opened readOnly. Needs Node 22.13+, on older Node it skips OpenCode with a note and does the rest
- one row per assistant step, so nothing gets counted twice
- when the price table doesn't know your model (reseller, local, whatever), it uses the cost OpenCode itself recorded. If that's 0 or missing, the receipt says "no price" instead of pretending it was free. That's what the * next to my $221 means
- OpenCode 2's new tables are read for usage, but not yet for the fun counters like interrupts
The picture is my real receipt. OpenCode $221 at API prices, Claude Code a lot more, and Codex 9 cents, which tells you how much I use Codex.
Run it: npx github:glmn-ai/vibereceipt (not on npm yet). --demo if you want to see it on sample data first.
No network code, zero dependencies, the only file it writes is the PNG. No prompts or project names on the receipt.
Disclosure: I built it. Same people as nsq, which I posted here a couple of days ago. MIT: https://github.com/glmn-ai/vibereceipt
If your OpenCode total looks off next to what OpenCode itself shows you, please tell me. With all the providers people run through OpenCode, that's the part I trust least.