Branch: feat/cli-rich-stats
Priority: Highest
Parent Epic: #145
Type: Story
Dependencies: #146 (Data Collection Infrastructure)
Description
Enhance the dev stats command to display rich, formatted statistics in the terminal. Replace plain text output with tables, colors, and organized sections. Add language breakdown, component type counts, and package-level insights for monorepos.
This provides immediate value to users without requiring a web browser.
Acceptance Criteria
Technical Requirements
Dependencies:
{
"cli-table3": "^0.6.3",
"chalk": "^5.3.0",
"terminal-size": "^4.0.0"
}
Output Sections:
- Overview (files, components, vectors, last scan)
- Languages (formatted table with files, components, LOC)
- Component Types (formatted table)
- Packages (if monorepo detected)
- Health (color-coded indicators)
Monorepo Detection:
- Check for
package.json with workspaces field
- Check for
pnpm-workspace.yaml
- Check for
lerna.json
Testing:
- Unit tests for formatting functions
- Integration tests with real indexer output
- Snapshot tests for output format
- Test on various terminal widths
Files to Create:
packages/cli/src/commands/dashboard.ts
packages/cli/src/utils/formatters.ts
packages/cli/src/utils/__tests__/formatters.test.ts
Files to Modify:
packages/cli/src/commands/stats.ts
packages/cli/src/index.ts
packages/cli/package.json
Branch:
feat/cli-rich-statsPriority: Highest
Parent Epic: #145
Type: Story
Dependencies: #146 (Data Collection Infrastructure)
Description
Enhance the
dev statscommand to display rich, formatted statistics in the terminal. Replace plain text output with tables, colors, and organized sections. Add language breakdown, component type counts, and package-level insights for monorepos.This provides immediate value to users without requiring a web browser.
Acceptance Criteria
dev statsdisplays language breakdown in a formatted table--format jsonflag maintains JSON outputdev dashboardcommand as alias for enhanced statsTechnical Requirements
Dependencies:
{ "cli-table3": "^0.6.3", "chalk": "^5.3.0", "terminal-size": "^4.0.0" }Output Sections:
Monorepo Detection:
package.jsonwithworkspacesfieldpnpm-workspace.yamllerna.jsonTesting:
Files to Create:
packages/cli/src/commands/dashboard.tspackages/cli/src/utils/formatters.tspackages/cli/src/utils/__tests__/formatters.test.tsFiles to Modify:
packages/cli/src/commands/stats.tspackages/cli/src/index.tspackages/cli/package.json