Skip to content

feat: show token/elapsed summary after one-shot text runs - #288

Merged
Patel230 merged 1 commit into
mainfrom
feat/print-usage-footer
Sep 7, 2026
Merged

feat: show token/elapsed summary after one-shot text runs#288
Patel230 merged 1 commit into
mainfrom
feat/print-usage-footer

Conversation

@Patel230

@Patel230 Patel230 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

graycode -p "prompt" (text mode) discarded the stream usage event and printed no completion summary. Now captures the final usage and renders a muted footer to stderr on completion:

tokens: 1234 in · 567 out · cache 89 read · 12 write · 8s

stderr keeps stdout pure for scripts; JSON/stream-json output paths are unchanged.

Verification

  • go build ./..., go vet ./cmd/, gofumpt -l clean.
  • go test ./... exit 0 (full suite).
  • New TestPrintTextUsageFooter covers rendering, cache inclusion/omission, and nil-usage no-op.

Text-mode --print previously discarded the stream usage event. Capture the
final usage and render a muted token/elapsed footer to stderr on completion,
so interactive one-shot runs report cost while stdout stays pure for scripts.
JSON/stream-json output is unchanged.
@Patel230
Patel230 merged commit 8593fda into main Sep 7, 2026
25 of 26 checks passed
@Patel230
Patel230 deleted the feat/print-usage-footer branch September 7, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant