Integrations

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 GitHub

Set it up

  1. 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:

    Terminal
    curl -fsSL https://github.com/inlinrhq/inlinr-claude-code/raw/main/dist/index.js -o inlinr.js
  2. Connect this machine, then open the link and approve with GitHub:

    Terminal
    node inlinr.js activate --editor gemini-cli
  3. Add inlinr's two hooks to Gemini CLI's settings:

    Terminal
    node 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?

The ones its file tools report in their own diff: what the model added and removed. If you change a proposed edit before accepting it, your changes are not credited to the model.

Does Gemini CLI wait for inlinr after each turn?

No. Gemini CLI waits for its hooks, so the hook starts inlinr in the background and returns at once.

Are thinking tokens counted?

Yes, as output tokens, the way Google bills them.

Which versions of Gemini CLI are read?

Those that write sessions as JSON Lines, after 0.38. Sessions from Gemini CLI 0.38 and older, one JSON file each, are not read.

Read also

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