slopmeter 0.2.0 → 0.4.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 CHANGED
@@ -24,7 +24,7 @@ slopmeter
24
24
  ## Usage
25
25
 
26
26
  ```bash
27
- slopmeter [--claude] [--codex] [--opencode] [--dark] [--format png|svg|json] [--output ./heatmap-last-year.png]
27
+ slopmeter [--all] [--claude] [--codex] [--opencode] [--dark] [--format png|svg|json] [--output ./heatmap-last-year.png]
28
28
  ```
29
29
 
30
30
  By default, the CLI:
@@ -38,6 +38,7 @@ By default, the CLI:
38
38
  - `--claude`: include only Claude Code data
39
39
  - `--codex`: include only Codex data
40
40
  - `--opencode`: include only Open Code data
41
+ - `--all`: merge all providers into one combined graph
41
42
  - `--dark`: render the image with the dark theme
42
43
  - `-f, --format <png|svg|json>`: choose the output format
43
44
  - `-o, --output <path>`: write output to a custom path
@@ -69,6 +70,14 @@ Render only Codex usage:
69
70
  npx slopmeter --codex
70
71
  ```
71
72
 
73
+ Render one merged graph across all providers:
74
+
75
+ ```bash
76
+ npx slopmeter --all
77
+ ```
78
+
79
+ When provider flags are present, `slopmeter` only loads those providers and only prints availability for those providers.
80
+
72
81
  Render a dark-theme SVG:
73
82
 
74
83
  ```bash
@@ -84,15 +93,38 @@ npx slopmeter --dark --format svg --output ./out/heatmap-dark.svg
84
93
  ## Data locations
85
94
 
86
95
  - Claude Code: `$CLAUDE_CONFIG_DIR/*/projects` or `~/.config/claude/projects`, `~/.claude/projects`
96
+ - 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
+ - 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
98
  - Codex: `$CODEX_HOME/sessions` or `~/.codex/sessions`
88
- - Open Code: `$OPENCODE_DATA_DIR/storage/message` or `~/.local/share/opencode/storage/message`
99
+ - 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`
100
+
101
+ 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
+ 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
103
 
90
104
  ## Exit behavior
91
105
 
92
106
  - If no provider flags are passed, `slopmeter` renders every provider with available data.
107
+ - If `--all` is passed, `slopmeter` loads all providers and renders one combined graph with merged totals, streaks, and model rankings.
93
108
  - If provider flags are passed and a requested provider has no data, the command exits with an error.
94
109
  - If no provider has data, the command exits with an error.
95
110
 
111
+ ## Environment variables
112
+
113
+ - `SLOPMETER_FILE_PROCESS_CONCURRENCY`: positive integer file-processing limit for Claude Code and Codex JSONL files. Default: `4`.
114
+ - `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`).
115
+
116
+ ## JSONL record handling
117
+
118
+ - Claude Code and Codex JSONL files are streamed through the same bounded record splitter; `slopmeter` does not materialize whole files in memory.
119
+ - 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`.
120
+ - OpenCode prefers the current SQLite store (`opencode.db`) and falls back to the legacy file-backed message layout.
121
+ - OpenCode legacy JSON message files are read through a bounded JSON document reader before `JSON.parse`.
122
+ - OpenCode SQLite `message.data` payloads use the same byte cap before `JSON.parse`.
123
+ - 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`.
124
+ - Only Codex `turn_context` and `event_msg` `token_count` records are parsed for usage aggregation.
125
+ - Oversized irrelevant Codex records are skipped and reported in a warning summary.
126
+ - 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`.
127
+
96
128
  ## License
97
129
 
98
130
  MIT