Skip to content

Add crufty tui #11

@EncodePanda

Description

@EncodePanda

Description:
Introduce a new subcommand crufty tui that launches an interactive Terminal User Interface (TUI) for exploring, selecting, and cleaning build artifacts. The TUI should provide a user-friendly way to do what crufty scan and crufty clean currently support, but in an interactive navigable view.

Feature Requirements:

  • Add a new CLI subcommand:

    crufty tui
    
  • Launch a full-screen TUI where:

    • Artifacts (e.g., target/, node_modules/) are displayed in a list or tree-like structure.
    • Each entry shows:
      • Relative path to the artifact
      • Detected language or type (e.g., [Rust], [Scala])
      • Estimated size (e.g., 419.6 MB)
    • Total size is summarized at the bottom.
    • Users can:
      • Navigate with keyboard (arrow keys or j/k)
      • Select/deselect items for deletion (e.g., with spacebar)
      • Filter or search through artifacts
      • Confirm deletion with a keypress (d or a confirmation dialog)
  • Only selected artifacts are deleted when user confirms action.

  • UI should remain responsive even for large projects with many folders.

Technical Notes:

  • Consider using ratatui or crossterm for TUI rendering.
  • The logic should reuse existing scanning and cleaning internals (scan and clean code paths) to ensure consistency.

Why this feature?
This will improve usability for developers who prefer a visual and interactive terminal experience over pure CLI commands. It will also reduce accidental deletion by giving users more visibility and control over what gets removed.

Example interface

┌────────────────────────────────────────────────────────────┐
│                   Crufty Artifact Cleaner                  │
├─────┬────────────────────────────────┬────────────┬────────┤
│ [X] │ ./dist                         │   3.2 MB   │        │
│ [ ] │ ./build                        │   2.1 MB   │        │
│ [X] │ ./.next                        │   8.5 MB   │        │
│ [ ] │ ./node_modules/.cache          │  12.7 MB   │        │
│ [ ] │ ./.turbo                       │   4.4 MB   │        │
│ [ ] │ ./apps/frontend/.next          │  15.6 MB   │        │
│ [X] │ ./apps/backend/dist            │   5.0 MB   │        │
├─────┴────────────────────────────────┴────────────┴────────┤
│ Total selected: 3 folders (16.7 MB)                        │
│ [SPACE] toggle │ [D] delete selected │ [Q] quit            │
└────────────────────────────────────────────────────────────┘

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