Time and token tracking for Gemini CLI
Gemini CLI keeps each session in ~/.gemini/tmp/<project>/chats. inlinr reads them and turns them into time, the lines its file tools wrote and token counts per project, next to your editor time, Claude Code and Codex.
Get it on GitHubSet it up
Already use the inlinr plugin for Claude Code? Nothing to install: it reads Gemini CLI sessions on the same machine. Otherwise, with Node 18 or later, download the script:
Terminalcurl -fsSL https://github.com/inlinrhq/inlinr-claude-code/raw/main/dist/index.js -o inlinr.jsConnect this machine, then open the link and approve with GitHub:
Terminalnode inlinr.js activate --editor gemini-cliAdd inlinr's two hooks to Gemini CLI's settings:
Terminalnode inlinr.js setup gemini-cli
What gets recorded
- Time spent in each session, per project and branch
- Lines added and removed by its file tools, from Gemini CLI's own diff
- Input, cached and output tokens, thinking included, and the model
Good to know
- What leaves the machine is paths, line and token counts, the model and the session's id: no prompt, no reply, no file contents.
- Sessions from before you activate stay on your machine.
- setup adds an AfterAgent and a SessionEnd hook, named inlinr, to ~/.gemini/settings.json.
- Gemini sessions show tokens without a cost for now: inlinr prices only the models whose rates it has checked, and Google's are not among them yet.
Never file contents, prompts or replies. The full list of what is sent · Tracking Claude Code, Codex and Gemini CLI: terminal, desktop, IDE and cloud
Questions about Gemini CLI
Which lines count as written by Gemini?
Does Gemini CLI wait for inlinr after each turn?
Are thinking tokens counted?
Which versions of Gemini CLI are read?
Read also
- IntegrationTime and token tracking for CodexTrack OpenAI Codex sessions, from the CLI or the desktop app, per project: time, the lines its patches changed and its token counts.Open
- AI usageReading a token bill: four prices, and the cache that is most of itFour counts, four prices, and a cache that re-reads the whole conversation every turn. How to read them without being off several times over.7 min read
- ProductAI coding analyticsWhich assistant wrote how much of each project, with tokens and cost per week.Open
Start tracking Gemini CLI
Free for solo use. Sign in with GitHub, install, and your first session shows up on the dashboard.
No card to start · no source code leaves your machine