Skip to content

Add --stats flag to show session statistics #3

@Ascendral

Description

@Ascendral

Problem

There's no way to see aggregate statistics about CodeBot usage — total sessions, total tool calls, total tokens used, etc.

Expected behavior

$ codebot --stats
CodeBot AI Usage Stats

  Sessions:     42
  Tool calls:   1,847
  Tokens used:  2.4M
  Total cost:   $12.50
  Last session: 2026-03-17

Files likely involved

  • src/cli/args.ts — add --stats flag
  • src/cli.ts — add handler
  • src/metrics.ts — has MetricsCollector with aggregate data

Acceptance criteria

  • codebot --stats prints aggregate usage stats and exits with code 0
  • Reads from the existing metrics/audit system
  • Should complete in under 1 second

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions