The engine behind Tokitoki: one static binary that scans the local data of your AI coding agents, Claude Code, Codex, GitHub Copilot, Gemini CLI and a dozen more, and uploads their token usage and cost to your dashboard, grouped by project and shown next to your coding time.
Runs once per invocation, or continuously as an OS service. No daemon, no runtime, no config file to write.
Download a binary from the releases page for macOS, Linux, or Windows (amd64 / arm64), or build from source:
make build
./bin/tokitoki versionEvery release ships a checksums.txt; verify with sha256sum --check.
The Tokitoki desktop apps and editor plugins bundle this CLI, so you only need to install it yourself for headless machines or scripting.
# Save your API key (from https://tokitoki.dev/settings).
tokitoki set key <API_KEY>
# Scan and upload once.
tokitoki
# Or keep it running in the background.
tokitoki service install
tokitoki service startsync [OPTIONS] Scan and upload usage (default command)
service <action> install | uninstall | start | stop | restart | status
set key <API_KEY> Store API key
set hostname <NAME> Name this machine on the dashboard
get key | hostname | dashboard-url Retrieve settings
verify key [<KEY>] Test an API key
stats [--days N] Local usage stats as JSON
upload enable | disable Turn uploading on or off
update Install the latest version
version Show version
Run tokitoki help <command> for details.
Options:
--provider-dir PROVIDER=DIR Scan a specific provider directory; repeatable
--interval DURATION Sync interval in service mode
--check-update Self-update after the sync
Set TOKITOKI_NO_TELEMETRY=1 to disable the anonymous install ping.
Every run is recorded in ~/.tokitoki/log/tokitoki.log — JSON lines, rotated
at 5 MB with three backups kept. When a sync misbehaves, that file is the
first thing to look at: each run logs when it started and finished, what the
scan found, what each upload batch returned, and any failure at the level it
deserves.
The log's ERROR lines — and only those — are forwarded to your Tokitoki
server, so that an install which has stopped uploading can say why. ERROR
is reserved for faults the server cannot see for itself: the local queue will
not open, a provider's files cannot be read, a run crashed or was killed. A
report carries the line, the few lines the same run logged before it, and for
a crash the stack trace; your home directory is replaced with ~ first, though
a path beneath it can still name a project or file. It is sent with your API
key when one is set, at most once every ten minutes, and a fault that keeps
happening is reported once a day with a count. This is part of the upload
service rather than telemetry, so TOKITOKI_NO_TELEMETRY does not govern it;
tokitoki upload disable does — with uploading off, nothing leaves the
machine.
Every uploaded event is labelled with this machine's hostname (without its
domain), so the dashboard can split time by machine. tokitoki set hostname <NAME> overrides it; TOKITOKI_HOSTNAME in the environment overrides both,
for containers and CI runners whose hostname is a random id.
On Linux the service is a systemd timer. Run service install with sudo
on servers to install system units that survive reboots; without it, a user
unit is installed. macOS and Windows use launchd and Windows services.
Claude Code, Codex, GitHub Copilot, Gemini CLI, Kimi, Qwen, OpenClaw, Pi,
Amp, Droid, Kilo, Hermes, Codebuff, OpenCode, Goose, WorkBuddy. Default directories are
scanned automatically; use --provider-dir to add or override one.
By default a project is the repository the work happens in, whichever
editor or agent reported it: an agent that cds into apps/web/src, an
editor opened on a monorepo package, and a Git worktree all count toward
the repository around them. Outside any repository the project is the folder
the editor or agent was opened in. A repository at your home directory (a
dotfiles repo) only claims home itself and its dot-folders, so ~/workspace
and the like are never filed under it. tokitoki project --project-folder DIR
shows what a folder resolves to.
To pin a stable name across machines and editors, add a .tokitoki file to
the project root:
customer-portal
release/2026
Line one is the project name, line two (optional) the branch. {project}
expands to the repository's name (Git, Mercurial, or Subversion), e.g.
my-company/{project}.
Without that second line, the branch comes from the Git checkout itself: the one it had checked out when the work happened, read from its reflog. Editors and AI agents get the same answer, whatever branch an agent's own log claims.
VS Code · macOS · Windows. All of them bundle this CLI. The overview lives at github.com/tokitoki-dev.
Work on dev; releases are tagged from main. See
RELEASING.md.
Local builds report to http://localhost:9093 and keep state in
~/.tokitoki-dev; check with tokitoki server-url and tokitoki data-dir.