ccost 0.2.2 → 0.3.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 +12 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -46,7 +46,7 @@ ccost sl --chart 5h # rate limit chart
|
|
|
46
46
|
|
|
47
47
|
| Flag | Description |
|
|
48
48
|
|------|-------------|
|
|
49
|
-
| `--per <dim>` | Group by: `day`, `hour`, `month`, `session`, `project`, `model`. Up to 2 for nested grouping. Default: `--per day --per model`. |
|
|
49
|
+
| `--per <dim>` | Group by: `day`, `hour`, `month`, `session`, `project`, `model`, `subagent`. Up to 2 for nested grouping. Default: `--per day --per model`. |
|
|
50
50
|
| `--order <order>` | Sort: `asc` (default) or `desc`. |
|
|
51
51
|
|
|
52
52
|
Two-level grouping creates parent-child rows, e.g. `--per day --per model` shows each day with per-model breakdowns.
|
|
@@ -268,6 +268,12 @@ ccost --per month --output csv --filename usage.csv
|
|
|
268
268
|
# Two-level: project > model
|
|
269
269
|
ccost --per project --per model --table full
|
|
270
270
|
|
|
271
|
+
# Subagent cost breakdown
|
|
272
|
+
ccost --per subagent --cost decimal
|
|
273
|
+
|
|
274
|
+
# Session > subagent: see subagent cost within each session
|
|
275
|
+
ccost --per session --per subagent
|
|
276
|
+
|
|
271
277
|
# Copy JSON to clipboard
|
|
272
278
|
ccost --copy json
|
|
273
279
|
|
|
@@ -342,7 +348,7 @@ struct LoadOptions {
|
|
|
342
348
|
session: Option<String>,
|
|
343
349
|
}
|
|
344
350
|
|
|
345
|
-
enum GroupDimension { Day, Hour, Month, Session, Project, Model }
|
|
351
|
+
enum GroupDimension { Day, Hour, Month, Session, Project, Model, Subagent }
|
|
346
352
|
|
|
347
353
|
struct GroupedData {
|
|
348
354
|
label: String,
|
|
@@ -380,7 +386,7 @@ Reads JSONL conversation logs from Claude Code's local storage:
|
|
|
380
386
|
- `~/.claude/projects/*/` (session files and `subagents/`)
|
|
381
387
|
- `~/.config/claude/projects/*/` (alternate location)
|
|
382
388
|
|
|
383
|
-
Both are scanned and deduplicated via symlink detection. Subagent transcripts are found in both the old (`<project>/subagents/`) and new (`<project>/<session-uuid>/subagents/`) directory structures.
|
|
389
|
+
Both are scanned and deduplicated via symlink detection. Subagent transcripts are found in both the old (`<project>/subagents/`) and new (`<project>/<session-uuid>/subagents/`) directory structures. Each record carries an `agent_id` (the subagent file stem, or empty for the main session), enabling `--per subagent` grouping.
|
|
384
390
|
|
|
385
391
|
### Deduplication
|
|
386
392
|
|
|
@@ -391,9 +397,10 @@ Streaming entries share the same `messageId:requestId` key with increasing `outp
|
|
|
391
397
|
Per-record cost via model-to-price lookup:
|
|
392
398
|
1. Exact match
|
|
393
399
|
2. Strip date suffix (`-YYYYMMDD` / `@YYYYMMDD`), retry
|
|
394
|
-
3.
|
|
400
|
+
3. Case-insensitive exact match (with and without date suffix)
|
|
401
|
+
4. Case-insensitive substring match
|
|
395
402
|
|
|
396
|
-
Bundled
|
|
403
|
+
Bundled pricing includes Claude, GLM, Kimi, and MiniMax (popular coding LLMs with official Claude Code-compatible API endpoints) from LiteLLM. Use `--live-pricing` for latest or `--pricing-data` for custom.
|
|
397
404
|
|
|
398
405
|
### `ccost` vs `ccost sl`
|
|
399
406
|
|