Skip to content

Add TUI styled output with lipgloss #104

@CalvinAllen

Description

@CalvinAllen

Summary

Add TUI (Text User Interface) styling to enhance the visual experience of the dtvem CLI using the charmbracelet/lipgloss library.

Changes

New TUI Package (internal/tui/)

Created a separate internal/tui package (distinct from internal/ui) to keep lipgloss dependencies out of the shim binary:

  • styles.go - Color palette, text styles, box styles, and indicator constants
  • table.go - Reusable table component with:
    • Rounded borders
    • Centered titles that span all columns
    • Optional hidden headers
    • Configurable minimum width
    • Active row highlighting (green)
    • Proper width calculation with ANSI codes

Updated Commands

  • list - Table with Version/Status columns, runtime name as title
  • list-all - Table with checkmark indicators, paging support (--limit flag), global/local status indicators
  • current - Table with Runtime/Version/Status columns, "Active Versions" title
  • version - Styled info box
  • where - Simplified to title + info box
  • --help - Custom usage function with two styled tables (header + available commands)
  • --version - Intercepted to use our custom version command output

Other Improvements

  • Hidden completion command until implemented
  • Fixed duplicate error messages on unknown flags
  • Consistent table widths across help output (95 characters)

Color Palette

  • Primary (Cyan): Titles, headers, runtime names
  • Secondary (Magenta/Pink): Version numbers
  • Success (Green): Active versions, checkmarks
  • Warning (Orange): Warning indicators
  • Error (Red): Cross marks, errors
  • Muted (Gray): Borders, secondary text

Benefits

  • Improved visual organization with bordered tables
  • Clearer indication of active/global/local versions
  • Consistent styling across all commands
  • No impact on shim binary size (separate package)

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