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

@dhtmdgkr/llm-meter

v1.0.5

Published

A CLI tool that provides unified analysis of local token usage across three AI coding tools: Claude Code, Codex CLI, and Gemini CLI.

Downloads

541

Readme

llm-meter

A CLI tool that provides unified analysis of local token usage across three AI coding tools: Claude Code, Codex CLI, and Gemini CLI.

All analysis is performed locally — no external API calls.

Usage

# Daily usage (default)
pnpm dlx @dhtmdgkr/llm-meter
npx @dhtmdgkr/llm-meter
bunx @dhtmdgkr/llm-meter

# Monthly usage
pnpm dlx @dhtmdgkr/llm-meter monthly

# Specify date range
pnpm dlx @dhtmdgkr/llm-meter daily --from 2026-03-01 --to 2026-03-02

# Filter by provider
pnpm dlx @dhtmdgkr/llm-meter daily --from 2026-03-01 --provider claude

# Per-model breakdown
pnpm dlx @dhtmdgkr/llm-meter daily --from 2026-03-01 --verbose

# JSON output
pnpm dlx @dhtmdgkr/llm-meter daily --from 2026-03-01 --json

Options

| Option | Description | |--------|-------------| | --from <date> | Start date (YYYY-MM-DD), default: 30 days ago | | --to <date> | End date (YYYY-MM-DD), default: today | | --provider <name> | Filter by provider: claude, codex, gemini | | --verbose | Show per-model breakdown | | --json | Output as JSON |

Output Example

sample

Data Sources

| Provider | Local Path | Format | |----------|-----------|--------| | Claude Code | ~/.claude/projects/**/*.jsonl | JSONL, message.usage from type: "assistant" records | | Codex CLI | ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl | JSONL, last token_count cumulative value per session | | Gemini CLI | ~/.gemini/tmp/**/session-*.json | JSON, tokens from type: "gemini" entries in messages[] |

Pricing Model

Uses LiteLLM-based pricing data (same as ccusage).

| Model | Input $/MTok | Output $/MTok | Cache Create $/MTok | Cache Read $/MTok | |-------|:-----------:|:------------:|:------------------:|:----------------:| | Claude Opus 4 | $5.00 | $25.00 | $6.25 | $0.50 | | Claude Sonnet 4 | $3.00 | $15.00 | $3.75 | $0.30 | | Claude Haiku 4.5 | $1.00 | $5.00 | $1.25 | $0.10 | | GPT-5.3 Codex | $1.75 | $14.00 | - | $0.175 | | GPT-5.4 | $2.50 | $15.00 | - | $0.25 | | Codex Mini | $1.50 | $6.00 | - | $0.375 | | o3 | $2.00 | $8.00 | - | $0.50 | | o4-mini | $1.10 | $4.40 | - | $0.275 | | Gemini 2.5 Pro | $1.25 | $10.00 | - | $0.125 | | Gemini 2.5 Flash | $0.30 | $2.50 | - | $0.03 |

Tiered pricing applies above 200K tokens (Claude Opus/Sonnet, Gemini 2.5 Pro) and 272K tokens (GPT-5.4).

Testing

bun test

Compatibility with ccusage

The Claude Code portion produces identical results to ccusage:

  • LiteLLM pricing model
  • Local timezone-based date grouping
  • Includes subagent files

Project Structure

src/
  index.ts                  # CLI entry point
  cli/
    commands/daily.ts       # daily subcommand
    commands/monthly.ts     # monthly subcommand
    commands/shared.ts      # shared data collection logic
    options.ts              # CLI option definitions
    output/table.ts         # terminal table formatter
    output/json.ts          # JSON output formatter
  core/
    types.ts                # shared types
    aggregator.ts           # daily/monthly aggregation
    date-utils.ts           # date utilities
  providers/
    base.ts                 # abstract base class
    claude.ts               # Claude Code parser
    codex.ts                # Codex CLI parser
    gemini.ts               # Gemini CLI parser
    registry.ts             # provider registry
  pricing/
    models.ts               # per-model pricing database
    calculator.ts           # cost calculation (tiered pricing)
tests/
  fixtures/                 # synthetic test data
  providers/                # provider unit tests
  core/                     # aggregation unit tests

License

MIT