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

@aiusage/controller

v0.1.1

Published

CLI tool for tracking and syncing Claude Code & Codex token usage.

Readme

@aiusage/controller

@aiusage/controller is the AIUsage command-line tool for:

  • scanning local Claude Code and Codex token usage
  • printing local usage summaries for the last 7 days, 30 days, 90 days, or all history
  • scheduling automatic sync to an AIUsage Worker
  • diagnosing configuration and connectivity issues

Install

npm install -g @aiusage/controller

Or run it directly with npx:

npx @aiusage/controller --help

After installation:

aiusage --help

Commands

report

Local usage report. No cloud upload required.

aiusage report --range 7d
aiusage report --range 1m
aiusage report --range 3m
aiusage report --range all
aiusage report --range 7d --json

Reads data from ~/.claude/projects (Claude Code) and ~/.codex (Codex).

The report includes events, token breakdowns (input / cache read / cache write / output / reasoning), grouped totals by source, daily trend, top models, and estimated USD cost based on public pricing.

scan

Scan a single day and print the breakdown.

aiusage scan --date 2026-03-31
aiusage scan --date 2026-03-31 --json

Defaults to yesterday when --date is omitted.

init

Initialize local configuration.

aiusage init --server https://your-worker.example.com --site-id your-site-id

health

Test connectivity to the Worker.

aiusage health

enroll

Register this device with the Worker.

aiusage enroll \
  --server https://your-worker.example.com \
  --site-id your-site-id \
  --enroll-token your-enroll-token \
  --device-name "MacBook Pro"

sync

Upload closed-day data to the Worker. Covers the last 7 days by default.

aiusage sync
aiusage sync --date 2026-03-31
aiusage sync --lookback 14

schedule

Manage automatic sync. Uses launchd on macOS and cron on Linux.

aiusage schedule            # show status
aiusage schedule on         # enable, default every 1 hour
aiusage schedule on --every 2h
aiusage schedule on --every 30m
aiusage schedule off        # disable

Supported intervals: 10m1d. As long as your machine is awake for one interval within a day, yesterday's data will be uploaded.

doctor

Run diagnostic checks on configuration, server connectivity, scanner directories, and schedule status.

aiusage doctor

config set

Manage local settings.

aiusage config set device.alias "MacBook Pro 工作机"
aiusage config set privacy.projectVisibility masked
aiusage config set project.alias /Users/me/Projects/MyApp MyApp

Configuration

Config file: ~/.aiusage/config.json

Sync log (when scheduled): ~/.aiusage/sync.log

License

MIT