npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sriinnu/tokmeter

v1.1.0

Published

Token usage tracking for AI coding agents — parsers, CLI, and TUI

Readme


@sriinnu/tokmeter is the unified package for tracking token consumption across 16+ AI coding agents. It bundles the core parsing/aggregation engine, the CLI, and the interactive TUI into a single install with subpath exports.

Scans local session files from Claude Code, Cursor, Codex CLI, Gemini CLI, OpenCode, Amp, Roo Code, Kilo Code, and more. Breaks down usage by project, model, provider, and day. Computes real-time cost estimates powered by @sriinnu/kosha-discovery.

Install

npm install @sriinnu/tokmeter

Or run directly without installing:

npx @sriinnu/tokmeter

Subpath Exports

| Import path | What you get | | -------------------------- | -------------------------------------- | | @sriinnu/tokmeter | Core engine — parsers, aggregation, pricing | | @sriinnu/tokmeter/cli | CLI entry point and helpers | | @sriinnu/tokmeter/tui | Interactive terminal UI with charts |

Binaries

| Command | Description | | --------------- | ---------------------------------- | | tokmeter | CLI — tables, JSON, filters, digest | | tokmeter-tui | Interactive TUI dashboard |

Usage

Core API

import { TokmeterCore } from "@sriinnu/tokmeter";

const core = new TokmeterCore();

// Scan all session files
const records = await core.scan();

// Get per-project breakdown
const projects = core.getAllProjects();
// => [{ project: "my-app", totalTokens: 842000, totalCost: 1.23, ... }]

// Get per-model costs
const models = core.getModelCosts();

// Get daily usage trend
const daily = core.getDailyBreakdown();

// Get overall stats
const stats = core.getStats();
// => { totalTokens, totalCost, activeDays, longestStreak, ... }

Filtering

// Today only
const today = await core.scan({ today: true });

// Last 7 days
const week = await core.scan({ week: true });

// Specific date range
const range = await core.scan({
  since: "2025-01-01",
  until: "2025-01-31",
});

// Single provider
const claude = await core.scan({
  providers: ["claude-code"],
});

// Single project
const project = await core.scan({
  project: "my-app",
});

Pricing

import { PricingService } from "@sriinnu/tokmeter";

const pricing = new PricingService();
await pricing.init();

const info = await pricing.getPricing("claude-sonnet-4-20250514");
// => { inputPerMillion: 3.00, outputPerMillion: 15.00, cacheReadPerMillion: 0.30, ... }

CLI

# Default overview — project table + totals
tokmeter

# Per-model breakdown
tokmeter models

# Daily usage over time
tokmeter daily

# Overall statistics
tokmeter stats

# Weekly cost digest with trends
tokmeter digest

# Filter by date
tokmeter --today
tokmeter --week
tokmeter --month
tokmeter --since 2025-01-01 --until 2025-03-31

# Filter by provider
tokmeter --claude
tokmeter --cursor
tokmeter --codex

# Filter by project
tokmeter models --project my-app

# JSON output (pipe to jq, scripts, etc.)
tokmeter --json
tokmeter models --json

# Pricing lookup
tokmeter pricing claude-sonnet-4-20250514

# Cleanup old session data
tokmeter cleanup --project old-app --backup
tokmeter restore --latest

TUI

# Launch the interactive terminal dashboard
tokmeter-tui

The TUI provides a real-time interactive view with navigable project/model/daily panels and inline charts.

Supported Providers

Claude Code, OpenCode, Codex CLI, Gemini CLI, Cursor, Amp, Droid, OpenClaw, Pi, Kimi, Qwen, Roo Code, Kilo Code, Kilo CLI, Mux, Windsurf, and more.

Author

Srinivas Pendela@sriinnu

License

MIT