slopmeter 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -2
- package/dist/cli.js +370 -71
- package/dist/cli.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# slopmeter
|
|
2
2
|
|
|
3
|
-
`slopmeter` is a Node.js CLI that scans local Claude Code, Codex,
|
|
3
|
+
`slopmeter` is a Node.js CLI that scans local Claude Code, Codex, Cursor, Open Code, and Pi Coding Agent usage data and generates a contribution-style heatmap for the rolling past year.
|
|
4
4
|
|
|
5
5
|
## Requirements
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ slopmeter
|
|
|
24
24
|
## Usage
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
-
slopmeter [--all] [--claude] [--codex] [--opencode] [--dark] [--format png|svg|json] [--output ./heatmap-last-year.png]
|
|
27
|
+
slopmeter [--all] [--claude] [--codex] [--cursor] [--opencode] [--pi] [--dark] [--format png|svg|json] [--output ./heatmap-last-year.png]
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
By default, the CLI:
|
|
@@ -37,7 +37,9 @@ By default, the CLI:
|
|
|
37
37
|
|
|
38
38
|
- `--claude`: include only Claude Code data
|
|
39
39
|
- `--codex`: include only Codex data
|
|
40
|
+
- `--cursor`: include only Cursor data
|
|
40
41
|
- `--opencode`: include only Open Code data
|
|
42
|
+
- `--pi`: include only Pi Coding Agent data
|
|
41
43
|
- `--all`: merge all providers into one combined graph
|
|
42
44
|
- `--dark`: render the image with the dark theme
|
|
43
45
|
- `-f, --format <png|svg|json>`: choose the output format
|
|
@@ -70,6 +72,18 @@ Render only Codex usage:
|
|
|
70
72
|
npx slopmeter --codex
|
|
71
73
|
```
|
|
72
74
|
|
|
75
|
+
Render only Cursor usage:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npx slopmeter --cursor
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Render only Pi Coding Agent usage:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npx slopmeter --pi
|
|
85
|
+
```
|
|
86
|
+
|
|
73
87
|
Render one merged graph across all providers:
|
|
74
88
|
|
|
75
89
|
```bash
|
|
@@ -96,7 +110,9 @@ npx slopmeter --dark --format svg --output ./out/heatmap-dark.svg
|
|
|
96
110
|
- Older Claude Code layouts: falls back to `$CLAUDE_CONFIG_DIR/stats-cache.json`, `~/.config/claude/stats-cache.json`, or `~/.claude/stats-cache.json` for days not present in project logs
|
|
97
111
|
- Earliest Claude Code activity fallback: uses `$CLAUDE_CONFIG_DIR/history.jsonl`, `~/.config/claude/history.jsonl`, or `~/.claude/history.jsonl` to mark activity-only days when token totals are unavailable
|
|
98
112
|
- Codex: `$CODEX_HOME/sessions` or `~/.codex/sessions`
|
|
113
|
+
- Cursor: reads `cursorAuth/accessToken` and `cursorAuth/refreshToken` from `$CURSOR_STATE_DB_PATH`, `$CURSOR_CONFIG_DIR/User/globalStorage/state.vscdb`, `~/Library/Application Support/Cursor/User/globalStorage/state.vscdb` (macOS), `%APPDATA%/Cursor/User/globalStorage/state.vscdb` (Windows), or `~/.config/Cursor/User/globalStorage/state.vscdb` (Linux), then loads usage from Cursor's CSV export endpoint
|
|
99
114
|
- Open Code: prefers `$OPENCODE_DATA_DIR/opencode.db` or `~/.local/share/opencode/opencode.db`, and falls back to `$OPENCODE_DATA_DIR/storage/message` or `~/.local/share/opencode/storage/message`
|
|
115
|
+
- Pi Coding Agent: `$PI_CODING_AGENT_DIR/sessions` or `~/.pi/agent/sessions`
|
|
100
116
|
|
|
101
117
|
When Claude Code falls back to `stats-cache.json`, the daily input/output/cache split is reconstructed from Claude's cached model totals because the older layout does not keep per-request usage logs.
|
|
102
118
|
When Claude Code falls back to `history.jsonl`, those days are rendered as activity-only cells and do not affect the token totals shown in the header.
|
|
@@ -105,6 +121,7 @@ When Claude Code falls back to `history.jsonl`, those days are rendered as activ
|
|
|
105
121
|
|
|
106
122
|
- If no provider flags are passed, `slopmeter` renders every provider with available data.
|
|
107
123
|
- If `--all` is passed, `slopmeter` loads all providers and renders one combined graph with merged totals, streaks, and model rankings.
|
|
124
|
+
- Pi Coding Agent usage is derived from assistant messages in Pi session logs, grouped by the model that handled each turn.
|
|
108
125
|
- If provider flags are passed and a requested provider has no data, the command exits with an error.
|
|
109
126
|
- If no provider has data, the command exits with an error.
|
|
110
127
|
|
|
@@ -124,6 +141,7 @@ When Claude Code falls back to `history.jsonl`, those days are rendered as activ
|
|
|
124
141
|
- Only Codex `turn_context` and `event_msg` `token_count` records are parsed for usage aggregation.
|
|
125
142
|
- Oversized irrelevant Codex records are skipped and reported in a warning summary.
|
|
126
143
|
- Oversized relevant Codex records fail the file with a clear error that names the file, line number, byte cap, and `SLOPMETER_MAX_JSONL_RECORD_BYTES`.
|
|
144
|
+
- Pi Coding Agent session logs are streamed and only assistant messages are parsed for usage aggregation.
|
|
127
145
|
|
|
128
146
|
## License
|
|
129
147
|
|