Skip to content

CLI: Enhanced verbose report with terminal markdown rendering #55

@sanggggg

Description

@sanggggg

Motivation

Current verbose reports display qualitative insights as plain text and quantitative metrics in basic table format. Terminal markdown rendering would provide richer formatting (bold, lists, code blocks) for better readability, and improved panel layouts would make metrics easier to scan.

User Story

As a retrochat user, I want to see reports with rich terminal formatting so that insights are more readable and quantitative metrics are better organized visually.

Requirements

Markdown Rendering for Qualitative Content

  • Render insights, patterns, and recommendations with terminal markdown
  • Support: bold, italic, lists, code blocks, headers
  • Preserve existing structure but add visual richness
  • Libraries: termimad or comrak for terminal rendering

Enhanced Quantitative Metrics Layout

  • Better panel/column splitting for metrics
  • Visual separators between metric categories
  • Improved hierarchy with colors and spacing
  • Tables or grid layout for multi-dimensional data

CLI Interface

cargo run -- analyze insights --verbose  # Default enhanced rendering
cargo run -- analyze insights --format markdown  # Explicit markdown format
cargo run -- analyze insights --plain  # Fallback to current plain format

Technical Implementation

Files to Modify

  • src/cli/analytics.rs - Add markdown rendering functions
  • Cargo.toml - Add termimad or comrak dependency
  • src/services/analytics/formatters.rs (new) - Formatting utilities

Approach

  1. Add termimad or comrak to dependencies
  2. Create markdown renderer wrapper
  3. Update qualitative output rendering:
    • Insights → markdown lists with bold headers
    • Patterns → formatted bullet points
    • Recommendations → numbered lists with emphasis
  4. Enhance quantitative metrics display:
    • Use ratatui-like panels/blocks for CLI
    • Add visual separators (─, │, ┌, ┐)
    • Color-code scores (green high, yellow medium, red low)
    • Table layout for multi-metric views

Library Options

  • termimad: Purpose-built for terminal markdown, good styling
  • comrak: CommonMark compliant, more features
  • Recommendation: Start with termimad for simplicity

Example Output Structure

╭─ Qualitative Insights ──────────────────────────╮
│ **Key Insights**                                 │
│   • Strong focus on testing and quality         │
│   • Comprehensive error handling implemented    │
│                                                  │
│ **Recommendations**                              │
│   1. Consider adding integration tests          │
│   2. Document new error handling patterns       │
╰──────────────────────────────────────────────────╯

╭─ Quantitative Scores ────────────────────────────╮
│ Overall        █████████░ 92                     │
│ Code Quality   ██████████ 98                     │
│ Productivity   ████████░░ 85                     │
╰──────────────────────────────────────────────────╯

Acceptance Criteria

  • Terminal markdown library integrated (termimad or comrak)
  • Qualitative insights render with rich formatting
  • Quantitative metrics use enhanced panel layout
  • Visual separators and hierarchy implemented
  • Color coding for scores and emphasis
  • --plain flag preserves old behavior
  • Performance remains acceptable for large reports
  • Works across different terminal emulators
  • Documented in CLI help text

Related Code References

  • Current report output: src/cli/analytics.rs:48-200
  • Qualitative formatting: src/cli/analytics.rs:122-160
  • Quantitative formatting: src/cli/analytics.rs:162-200
  • CLI args: src/cli/mod.rs:30-50

Priority

Medium-High - Significantly improves report readability and user experience

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions