Usage export as CSV: by period and by place, person, key and model, from the rollups

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilker ManapandClaude Opus 5.5 committed 2026-10-04 16:49:04 +02:00
1 parent 15a7237a02
commit 57739d736a
11 files changed
+428 -2

No files matched your search

+6 -1
View File
@@ -536,6 +536,11 @@ func (m consoleModel) key(k tea.KeyMsg) (tea.Model, tea.Cmd) {
case cOrgs:
m.createOrgForm()
}
case "e":
if m.menu == cUsage {
m.usageExportForm()
return m, nil
}
case "right", "l":
if m.menu == cUsage {
m.usageBy = (m.usageBy + 1) % len(usageGroupings)
@@ -1092,7 +1097,7 @@ func (m consoleModel) panel() (title, body, keys string) {
compactNum(u.Errors), fmt.Sprintf("%.2f", float64(u.CostMicros)/1e6)})
}
if m.inPanel {
keys = "↑↓ row · → grouping · ← back · Q leave"
keys = "↑↓ row · → grouping · E export as CSV · ← back · Q leave"
}
return "Usage", head + table([]string{"WHO", "REQUESTS", "TOKENS", "ERRORS", "SPENT"}, rows, m.row, pw, m.inPanel), keys
case cQuotas: