-
Notifications
You must be signed in to change notification settings - Fork 240
Description
The GitHub CLI extension gh-aw currently uses manual table formatting with fixed-width columns in its CLI commands, but it should use consistent table styling that matches the GitHub CLI's professional appearance. The codebase already has a complete table rendering system in pkg/console/console.go (RenderTable function with TableConfig) that implements GitHub CLI-style formatting with TTY-aware styling, dynamic column sizing, and professional headers. However, current CLI commands in pkg/cli/commands.go are using manual fmt.Printf statements instead of this existing table system.
Your task is to refactor the table rendering in the gh-aw CLI to achieve consistency with GitHub CLI commands like 'gh runs list'. Specifically:
Replace the manual table formatting in the ListWorkflows function (lines 160-164 in pkg/cli/commands.go) that currently uses fixed-width printf statements with dashes for separators
Replace the manual table formatting in the StatusWorkflows function (lines 1102-1103 in pkg/cli/commands.go) with similar manual printf patterns
Use the existing console.RenderTable function with TableConfig instead of manual formatting
Ensure the resulting tables have dynamic column sizing, TTY-aware colors and styling, and professional appearance consistent with GitHub CLI
The existing RenderTable system in pkg/console/console.go provides all necessary functionality including automatic column width calculation, professional header styling, TTY detection, and consistent formatting. The implementation should be a straightforward refactor replacing manual fmt.Printf calls with console.TableConfig structures and console.RenderTable function calls.
After implementation, test the output by comparing 'gh-aw list' and 'gh-aw status' commands with GitHub CLI commands like 'gh run list' to ensure visual consistency in spacing, alignment, colors, and overall presentation.