Skip to content

Commit 82df214

Browse files
AgentSealiamtoruk
andauthored
docs: cover --from/--to, avgCostPerSession, and semgrep guard (#99)
README gains a --from/--to example in the Usage block, a dedicated 'Date range filtering' subsection, and a note that JSON projects[] now includes avgCostPerSession. CHANGELOG opens an Unreleased section crediting @lfl1337 for PRs #78 and #80. Flags the projects.csv column-order shift (Avg/Session now between Cost and Share) so consumers parsing by position read by header instead. Co-authored-by: AgentSeal <hello@agentseal.org>
1 parent c634b10 commit 82df214

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Added
6+
- **`codeburn report --from/--to`.** Filter sessions to an exact `YYYY-MM-DD` date range (local time). Either flag alone is valid: `--from` alone runs from the given date through end-of-today, `--to` alone runs from the earliest data through the given date. Inverted ranges or malformed dates exit with a clear error. In the TUI, pressing `1`-`5` still switches to the predefined periods. Credit: @lfl1337 (PR #80).
7+
- **`avgCostPerSession` in reports.** JSON `projects[]` entries gain an `avgCostPerSession` field and `export -f csv` adds an `Avg/Session (USD)` column to `projects.csv`. Column order in `projects.csv` is now `Project, Cost, Avg/Session, Share, API Calls, Sessions` -- scripts parsing by column position should read by header instead. Credit: @lfl1337 (PR #80).
8+
9+
### Security
10+
- **Semgrep CI guard against prototype pollution regressions.** New `.github/workflows/ci.yml` runs a bracket-assign guard on `src/providers/` and `src/parser.ts` on every push to main and every PR. Blocks re-introducing `$MAP[$KEY] = $MAP[$KEY] ?? $INIT` patterns on `{}`-initialized maps. `categoryBreakdown` in `parser.ts` switched to `Object.create(null)` for consistency with its sibling breakdown maps. Credit: @lfl1337 (PR #78).
11+
312
## 0.7.3 - 2026-04-18
413

514
### Changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ codeburn today # today's usage
4949
codeburn month # this month's usage
5050
codeburn report -p 30days # rolling 30-day window
5151
codeburn report -p all # every recorded session
52+
codeburn report --from 2026-04-01 --to 2026-04-10 # exact date range
5253
codeburn report --format json # full dashboard data as JSON
5354
codeburn report --refresh 60 # auto-refresh every 60 seconds
5455
codeburn status # compact one-liner (today + month)
@@ -72,7 +73,7 @@ codeburn month --format json # this month as JSON
7273
codeburn report -p 30days --format json # 30-day window
7374
```
7475

75-
The JSON includes all dashboard panels: overview (cost, calls, sessions, cache hit %), daily breakdown, projects, models with token counts, activities with one-shot rates, core tools, MCP servers, and shell commands. Pipe to `jq` for filtering:
76+
The JSON includes all dashboard panels: overview (cost, calls, sessions, cache hit %), daily breakdown, projects (with `avgCostPerSession`), models with token counts, activities with one-shot rates, core tools, MCP servers, and shell commands. Pipe to `jq` for filtering:
7677

7778
```bash
7879
codeburn report --format json | jq '.projects'
@@ -113,6 +114,19 @@ codeburn export --project inventory # export only "inventory" proje
113114

114115
The `--project` and `--exclude` flags work on all commands and can be combined with `--provider`.
115116

117+
### Date range filtering
118+
119+
Beyond the preset periods, specify an exact window with `--from` and `--to` (`YYYY-MM-DD`, local time):
120+
121+
```bash
122+
codeburn report --from 2026-04-01 --to 2026-04-10 # explicit window
123+
codeburn report --from 2026-04-01 # this date through today
124+
codeburn report --to 2026-04-10 # earliest data through this date
125+
codeburn report --from 2026-04-01 --to 2026-04-10 --format json
126+
```
127+
128+
Either flag alone is valid. Inverted or malformed dates exit with a clear error. In the TUI, the custom range sets the initial load only -- pressing `1`-`5` switches back to predefined periods.
129+
116130
### Supported providers
117131

118132
| Provider | Data location | Status |

0 commit comments

Comments
 (0)