|
1 | | -# tokenusage |
| 1 | +# tokenusage (`tu`) |
2 | 2 |
|
3 | | -NPM distribution for [`tokenusage`](https://github.com/hanbu97/tokenusage). |
| 3 | +Blazing-fast Rust token usage tracker for **Claude Code** and **Codex**. |
| 4 | + |
| 5 | +- Unified report across Claude + Codex |
| 6 | +- Fast parallel scan + cache |
| 7 | +- CLI table, TUI, GUI (`iced` + `tiny-skia`) |
| 8 | +- Live monitor with progress bars |
| 9 | + |
| 10 | +Repository: [github.com/hanbu97/tokenusage](https://github.com/hanbu97/tokenusage) |
| 11 | +Crate: [crates.io/crates/tokenusage](https://crates.io/crates/tokenusage) |
4 | 12 |
|
5 | 13 | ## Install |
6 | 14 |
|
7 | 15 | ```bash |
8 | | -npm i -g tokenusage |
| 16 | +npm install -g tokenusage |
| 17 | +``` |
| 18 | + |
| 19 | +## Quick Start |
| 20 | + |
| 21 | +```bash |
| 22 | +# Daily report (default) |
| 23 | +tu |
| 24 | + |
| 25 | +# Source-specific |
| 26 | +tu codex |
| 27 | +tu claude |
| 28 | + |
| 29 | +# Date filter |
| 30 | +tu --since 2026-02-01 --until 2026-02-28 |
| 31 | + |
| 32 | +# Weekly / monthly |
| 33 | +tu weekly --start-of-week monday |
| 34 | +tu monthly |
| 35 | + |
| 36 | +# Live monitor |
| 37 | +tu live |
| 38 | +tu live codex |
| 39 | +tu live claude |
| 40 | + |
| 41 | +# GUI dashboard |
| 42 | +tu gui |
9 | 43 | ``` |
10 | 44 |
|
11 | | -## Usage |
| 45 | +## Screenshots |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +## Why `tu` |
| 51 | + |
| 52 | +- Real-world benchmark vs `ccusage` on local Codex logs: |
| 53 | +- About **34.5x faster (cold)** and **131.1x faster (warm)** |
| 54 | +- Rust-native startup, parallel parsing, incremental cache reuse |
| 55 | + |
| 56 | +## Data Sources (default) |
| 57 | + |
| 58 | +- Claude: |
| 59 | +- `~/.config/claude/projects` |
| 60 | +- `~/.claude/projects` |
| 61 | +- Codex: |
| 62 | +- `~/.codex/sessions` |
| 63 | +- `~/.config/codex/sessions` |
| 64 | + |
| 65 | +You can override with: |
| 66 | + |
| 67 | +- `--claude-projects-dir <PATH>` (repeatable) |
| 68 | +- `--codex-sessions-dir <PATH>` (repeatable) |
| 69 | + |
| 70 | +## Config |
| 71 | + |
| 72 | +Default config search: |
| 73 | + |
| 74 | +1. `./.tu/tu.json` |
| 75 | +2. `~/.config/tu/tu.json` |
| 76 | +3. `~/.config/tokenusage/tokenusage.json` |
| 77 | + |
| 78 | +Explicit config: |
12 | 79 |
|
13 | 80 | ```bash |
14 | | -tu --help |
| 81 | +tu --config /path/to/tu.json |
15 | 82 | ``` |
| 83 | + |
| 84 | +## License |
| 85 | + |
| 86 | +MIT |
0 commit comments