slopmeter 0.1.0 → 0.3.0
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 +25 -1
- package/dist/cli.js +1039 -134
- package/dist/cli.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -69,6 +69,8 @@ Render only Codex usage:
|
|
|
69
69
|
npx slopmeter --codex
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
When provider flags are present, `slopmeter` only loads those providers and only prints availability for those providers.
|
|
73
|
+
|
|
72
74
|
Render a dark-theme SVG:
|
|
73
75
|
|
|
74
76
|
```bash
|
|
@@ -84,8 +86,13 @@ npx slopmeter --dark --format svg --output ./out/heatmap-dark.svg
|
|
|
84
86
|
## Data locations
|
|
85
87
|
|
|
86
88
|
- Claude Code: `$CLAUDE_CONFIG_DIR/*/projects` or `~/.config/claude/projects`, `~/.claude/projects`
|
|
89
|
+
- 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
|
|
90
|
+
- 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
|
|
87
91
|
- Codex: `$CODEX_HOME/sessions` or `~/.codex/sessions`
|
|
88
|
-
- Open Code: `$OPENCODE_DATA_DIR/storage/message` or `~/.local/share/opencode/storage/message`
|
|
92
|
+
- 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`
|
|
93
|
+
|
|
94
|
+
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.
|
|
95
|
+
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.
|
|
89
96
|
|
|
90
97
|
## Exit behavior
|
|
91
98
|
|
|
@@ -93,6 +100,23 @@ npx slopmeter --dark --format svg --output ./out/heatmap-dark.svg
|
|
|
93
100
|
- If provider flags are passed and a requested provider has no data, the command exits with an error.
|
|
94
101
|
- If no provider has data, the command exits with an error.
|
|
95
102
|
|
|
103
|
+
## Environment variables
|
|
104
|
+
|
|
105
|
+
- `SLOPMETER_FILE_PROCESS_CONCURRENCY`: positive integer file-processing limit for Claude Code and Codex JSONL files. Default: `4`.
|
|
106
|
+
- `SLOPMETER_MAX_JSONL_RECORD_BYTES`: byte cap for Claude Code and Codex JSONL records, OpenCode JSON documents, and OpenCode SQLite `message.data` payloads. Default: `67108864` (`64 MB`).
|
|
107
|
+
|
|
108
|
+
## JSONL record handling
|
|
109
|
+
|
|
110
|
+
- Claude Code and Codex JSONL files are streamed through the same bounded record splitter; `slopmeter` does not materialize whole files in memory.
|
|
111
|
+
- Oversized Claude Code JSONL records fail the file with a clear error that names the file, line number, byte cap, and `SLOPMETER_MAX_JSONL_RECORD_BYTES`.
|
|
112
|
+
- OpenCode prefers the current SQLite store (`opencode.db`) and falls back to the legacy file-backed message layout.
|
|
113
|
+
- OpenCode legacy JSON message files are read through a bounded JSON document reader before `JSON.parse`.
|
|
114
|
+
- OpenCode SQLite `message.data` payloads use the same byte cap before `JSON.parse`.
|
|
115
|
+
- Oversized OpenCode JSON documents and SQLite message payloads fail clearly with the source path or row label, byte cap, and `SLOPMETER_MAX_JSONL_RECORD_BYTES`.
|
|
116
|
+
- Only Codex `turn_context` and `event_msg` `token_count` records are parsed for usage aggregation.
|
|
117
|
+
- Oversized irrelevant Codex records are skipped and reported in a warning summary.
|
|
118
|
+
- 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`.
|
|
119
|
+
|
|
96
120
|
## License
|
|
97
121
|
|
|
98
122
|
MIT
|