ai-usage
A small terminal program that works as a fuel gauge for AI services: how much you've used, how much is left and when it refills, always in view. My first Go project.
What it does
ai-usage is a small program that lives in the terminal and does one simple thing: it always shows, at a glance, how much you have left of each AI service your agents rely on. It works like a car's fuel gauge, but for AI services: how much you've used, how much is left and when it refills. Green when you're fine, red when you're running low. It watches Codex, MiniMax and z.ai, checking all three at once so you never have to open a website to know where you stand.
Why I built it
AI services cap your usage by hours, and when the tank runs dry mid-task, the agent just stops. It happens all the time when you work with agents every day, and finding out late costs hours. With this widget the gauge is always in view, so nobody runs out of fuel by surprise.
My first Go project
The program is written in Go, a language in the C family, and this was my first complete project with it. I went one step further too: Term, the terminal I use — a beta with a plugin system, like browser extensions — now carries a plugin of mine that puts the gauge in the bottom bar of every window. Always visible, without taking any working space.
What this project shows
- Integrating external services: every provider hands over its data differently; the program queries all of them at once and translates them into a single format that can be read at a glance or consumed by other software.
- Design that adapts: if the window is narrow, the information stacks in columns; if it's wide, everything fits on one line.
- Quality checked on its own: the project has automated tests and a test kitchen (called CI) that compiles and verifies the code on every change, for Mac and Linux, so nobody has to rely on memory.
- Security from the start: access keys never enter the code, and before even thinking about opening the project to the public I ran a secrets review over the entire change history.
- Documented to be continued: the project's vocabulary, decisions and working plan are all written down, so someone else — or another agent — can pick it up and carry on.
Status
Finished and in daily use since day one. The code is private for now; the plan is to open it soon, with a history cleanup first and an installable first release for macOS and Linux.