Skip to content

Story: Enhanced CLI Statistics with Rich Formatting #147

@prosdev

Description

@prosdev

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

  • dev stats displays language breakdown in a formatted table
  • Component type counts shown with visual formatting
  • Package-level stats displayed for monorepos (auto-detected)
  • Health indicators use colors (green/yellow/red)
  • Tables use appropriate column widths and alignment
  • Optional --format json flag maintains JSON output
  • New dev dashboard command as alias for enhanced stats
  • Output is readable on various terminal widths (min 80 cols)
  • Help text updated with new features

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    pkg:clipackages/cli - commands

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions