Skip to content
tokmeterGet Tokmeter

Tokmeter / Start

Install

The CLI, the daemon and MCP server, and the macOS menu bar app.

Requires Node.js 18+. Tools that keep their history in SQLite — OpenCode, Kilo CLI, Cursor, Zed, Codex Desktop, Antigravity — need Node 22.13+ (or 23.4+) for its built-in node:sqlite; on older Node those sources stay empty. Reading session files needs no provider credentials; pricing lookups fetch a public catalog, and --light skips them.

Try it without installing

npx -y @sriinnu/tokmeter --today

CLI + TUI

npm install -g @sriinnu/tokmeter
tokmeter --today
tokmeter-tui

Daemon, MCP server, statusline

These live in @sriinnu/tokmeter-mcp:

npm install -g @sriinnu/tokmeter-mcp
tokmeter-mcp daemon start      # warm aggregation daemon (HTTP 9877, WS 9876)
tokmeter-mcp serve             # MCP server over stdio
tokmeter-mcp statusline        # one statusline tick

MCP client config (stdio):

{ "command": "npx", "args": ["-y", "@sriinnu/tokmeter-mcp", "serve"] }

For Claude Code, register it with its CLI instead of editing a file:

claude mcp add tokmeter --scope user -- npx -y @sriinnu/tokmeter-mcp serve

Since 1.15.0, tokmeter-mcp install-mcp runs claude mcp add for you. Older versions wrote the entry to ~/.claude/settings.json, which Claude Code doesn’t load MCP servers from; if you set it up that way, delete that entry.

tokmeter-mcp install-all sets up the statusline and the MCP server for every supported editor (tokmeter-mcp editors lists them). Releases up to 1.19.3 also added Claude Code PreToolUse “guard” hooks that pointed at scripts which don’t exist on your machine; nothing installs them any more, and tokmeter-mcp install-hooks is now a no-op. If you ran install-hooks or install-all on one of those releases, upgrade first, then run tokmeter-mcp uninstall-hooks: it removes only those guard entries and leaves your own hooks alone.

The default command launches a terminal UI, so the MCP entry point is the serve subcommand. On macOS, tokmeter-mcp daemon install-agent installs a launchd LaunchAgent so the daemon auto-starts at login and respawns on crash.

After upgrading to 1.19.2, restart the daemon so its protected HTTP and WebSocket listeners replace the older process:

tokmeter-mcp daemon restart
tokmeter-mcp daemon status

The token is created under ~/.tokmeter/daemon/; keep that directory private. Existing Tokmeter settings and caches are tightened to owner-only permissions as the new version uses them. No provider credentials are needed.

macOS menubar app

Apple silicon, macOS 14+.

brew install --cask sriinnu/homebrew-tap/tokmeterbar

Or download TokmeterBar-<version>.zip from GitHub Releases and move it to /Applications. The app auto-updates via Sparkle from a signed appcast.

Something wrong or out of date? This page is generated from its source on GitHub, at the revision this site was checked against.