tokitoki-cli

module
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2026 License: Apache-2.0

README

tokitoki-cli

Command-line uploader for Tokitoki. It scans the local data directories of AI coding tools (Claude Code, Codex, Copilot, Gemini CLI and others), and uploads usage events to your Tokitoki dashboard.

Runs once per invocation, or continuously as an OS service.

Install

Download a binary from the releases page for macOS, Linux, or Windows (amd64 / arm64), or build from source:

make build
./bin/tokitoki version

The Tokitoki desktop apps and editor plugins bundle this CLI, so you only need to install it yourself for headless machines or scripting.

Usage

# 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 start
sync [OPTIONS]                Scan and upload usage (default command)
service <action>              install | uninstall | start | stop | restart | status
set key <API_KEY>             Store API key
get key | dashboard-url       Retrieve stored 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.

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.

Supported tools

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.

Project names

By default the project name comes from the IDE or agent. 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 nearest Git, Mercurial, or Subversion root folder name, e.g. my-company/{project}.

Development

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.

License

Apache License 2.0

Directories

Path Synopsis
cmd
tokitoki command
Command tokitoki scans local Claude Code/Codex usage files and uploads the resulting events to the local Tokitoki server.
Command tokitoki scans local Claude Code/Codex usage files and uploads the resulting events to the local Tokitoki server.
internal
agentdata
Package agentdata reads the JSON, JSONL and on-disk layouts that local AI agents write their logs in.
Package agentdata reads the JSON, JSONL and on-disk layouts that local AI agents write their logs in.
agentdb
Package agentdb reads the SQLite databases that local AI agents store their sessions in.
Package agentdb reads the SQLite databases that local AI agents store their sessions in.
buildinfo
Package buildinfo carries the values stamped into release binaries.
Package buildinfo carries the values stamped into release binaries.
cli
Package cli implements Tokitoki's one operation: scan local AI usage files and upload them to the local server.
Package cli implements Tokitoki's one operation: scan local AI usage files and upload them to the local server.
config
Package config carries the build-time identity of this binary's local state.
Package config carries the build-time identity of this binary's local state.
deviceauth
Package deviceauth exchanges the device's API key for a one-time browser login URL, so front-ends can open the web dashboard already signed in.
Package deviceauth exchanges the device's API key for a one-time browser login URL, so front-ends can open the web dashboard already signed in.
machineid
Package machineid derives a stable, anonymous identifier for this machine from the identity the operating system already maintains.
Package machineid derives a stable, anonymous identifier for this machine from the identity the operating system already maintains.
projectfile
Package projectfile resolves explicit project identity files for usage events.
Package projectfile resolves explicit project identity files for usage events.
providertest
Package providertest holds the fixtures and assertions provider packages share in their tests.
Package providertest holds the fixtures and assertions provider packages share in their tests.
selfupdate
Package selfupdate replaces the running tokitoki binary with the newest published release.
Package selfupdate replaces the running tokitoki binary with the newest published release.
telemetry
Package telemetry reports that this machine has Tokitoki installed and whether an API key is configured.
Package telemetry reports that this machine has Tokitoki installed and whether an API key is configured.
usagedb
Package usagedb persists usage events and their upload queue state in a local SQLite database.
Package usagedb persists usage events and their upload queue state in a local SQLite database.
usagestats
Package usagestats aggregates locally stored usage events into the report behind `tokitoki stats`.
Package usagestats aggregates locally stored usage events into the report behind `tokitoki stats`.
pkg
agentlib
Package agentlib exposes Tokitoki's local usage sync engine for native front-ends.
Package agentlib exposes Tokitoki's local usage sync engine for native front-ends.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL