Resources
15Install
npx skillscat add sriinnu/tokmeter Install via the SkillsCat registry.
SKILL.md
tokmeter
Use Tokmeter when another app, agent, or automation needs local token/cost telemetry from AI coding assistants.
Canonical package names
Always use the published npm scope below.
@sriinnu/tokmeter-core@sriinnu/tokmeter-cli@sriinnu/tokmeter-tui@sriinnu/tokmeter-web@sriinnu/drishti
Choose the right surface
| Need | Use | Why |
|---|---|---|
| Embedded programmatic access in Node/Bun | @sriinnu/tokmeter-core |
Lowest-level API with scan, aggregation, pricing, cleanup, and restore support |
| Shell / CI / script automation | @sriinnu/tokmeter-cli --json |
Stable machine-readable contract without writing parser code |
| Convenience wrappers around common queries | @sriinnu/tokmeter-cli imports |
Exposes summary, project, model, daily, stats, pricing, digest, cleanup, and restore helpers |
| Live token/cost answers inside an AI workflow | @sriinnu/drishti |
MCP server, daemon, statusline, and live tracker APIs |
| Human exploration | @sriinnu/tokmeter-tui or @sriinnu/tokmeter-web |
Best for interactive/manual inspection |
Recommended integration order
- If your AI platform can speak MCP, use
@sriinnu/drishti. - If you need batch automation or CI checks, call
@sriinnu/tokmeter-cli --json. - If you need one reusable in-process scan, use
@sriinnu/tokmeter-core. - If you want convenience helpers without shelling out, import from
@sriinnu/tokmeter-cli.
Quick examples
Shell / CI
npx @sriinnu/tokmeter-cli --json
npx @sriinnu/tokmeter-cli models --json --project tokmeter
npx @sriinnu/tokmeter-cli digest --json --period weekConvenience methods
import {
loadTokmeterSummary,
loadTokmeterProjects,
loadTokmeterStats,
lookupTokmeterPricing,
} from "@sriinnu/tokmeter-cli";
const summary = await loadTokmeterSummary({ month: true });
const projects = await loadTokmeterProjects({ project: "command-relay" });
const stats = await loadTokmeterStats({ week: true, light: true });
const pricing = await lookupTokmeterPricing("claude-sonnet-4-20250514");Direct core usage
import { TokmeterCore } from "@sriinnu/tokmeter-core";
const core = new TokmeterCore();
await core.scan({ providers: ["codex", "claude-code"], since: "2026-04-01" });
const summary = core.getSummary();Integration notes
- Tokmeter reads local session files; there is no hosted backend requirement.
TokmeterSummaryis the best high-level contract for downstream apps and dashboards.light/--lightskips pricing lookups when token counts are enough.@sriinnu/drishtiis the preferred live surface for other AI assistants.
References
README.mddocs/consuming-tokmeter.mdpackages/core/src/index.tspackages/cli/src/index.tspackages/mcp/src/index.ts