feat: add /stats dialog with token usage statistics#10234
feat: add /stats dialog with token usage statistics#10234ajjucoder wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, here are the potentially related PRs: Related PRs Found:
These PRs are related to statistics and token tracking features, though they appear to be addressing different aspects of the stats display (sidebar stats vs. the new No direct duplicates were found - PR #10234 appears to be the only PR specifically implementing a |
- Add StatsAggregator module for aggregating session stats with daily breakdown - Add ActivityHeatmap component (GitHub-style contribution graph) - Add DialogStats component with: - 7-day, 30-day, 1-year view modes (Shift+R to cycle) - Activity heatmap visualization - Side-by-side 7-day and 30-day token summaries - Model usage breakdown with bar charts - Project filter toggle (Shift+P) - Register /stats slash command - Add stats_view keybind (<leader>S)
3c216fb to
d50833f
Compare
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
Closes #6767
Summary
Implements the
/statscommand feature request with comprehensive token usage statistics:This addresses the feature request for visual statistics similar to Claude Code.
Changes
packages/opencode/src/stats/aggregator.tspackages/opencode/src/cli/cmd/tui/component/activity-heatmap.tsxtint()for color intensitypackages/opencode/src/cli/cmd/tui/component/dialog-stats.tsxpackages/opencode/src/cli/cmd/tui/app.tsx/statsslash command registrationpackages/sdk/js/src/gen/types.gen.tsstats_viewkeybind typepackages/sdk/js/src/v2/gen/types.gen.tsstats_viewkeybind typeUsage
Type
/statsin the OpenCode TUI to open the statistics dialog.Features Implemented (from #6767)