How sumit1612/pi-usage works
pi-usage turns local pi session logs into token, context, and cost analytics through a shared aggregation engine, surfaced in a standalone CLI and pi’s interactive /usage dashboard. The README documents views, filters, exports, budget checks, and live refresh; sampled source confirms the extension’s call into the core and the core’s session-processing behavior. The CLI implementation was not sampled, so its documented relationship to the core is cited to the README. Formatting is shown as a distinct runtime capability; its caller was not verified.
Main entry points: core.js Usage aggregation · pi-usage CLI analytics · usage.ts Usage dashboard
Components 8
Local Inputs
- Session logs
Usage Engine
- Usage aggregation
lib/core.js
User Interfaces
- CLI analytics
bin/pi-usage - Usage dashboard
extensions/usage.ts
Terminal Formatting
- CLI formatting
lib/presentation.js
Other components
- Pi user
- CLI user
- Pi agent
Connections 6
- CLI user → CLI analytics: runs commands
README.md - Pi user → Pi agent: uses
README.md - Pi agent → Usage dashboard: opens /usage
README.md - Session logs → Usage aggregation: reads logs
README.md - Usage dashboard → Usage aggregation: loads aggregates
extensions/usage.ts - CLI analytics → Usage aggregation: uses shared engine
README.md