Description
24 CLI files currently use raw fmt.Printf/fmt.Println calls that bypass the console formatting system, creating inconsistent user experience. These files should use console.Format* functions for consistent styling, color support, and TTY-aware output.
Current Problem
Anti-Pattern (used in 24 files):
// ❌ BAD - Raw fmt.Printf without console formatting
fmt.Printf("Running workflow: %s\n", name)
fmt.Printf("Warning: Could not check status: %v\n", err)
fmt.Println("Success!")
Correct Pattern:
// ✅ GOOD - Console formatted with appropriate message types
fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Running workflow: %s", name)))
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Could not check status: %v", err)))
fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Success!"))
Impact
Current Issues:
- ❌ Inconsistent visual appearance across commands
- ❌ No color/styling on important messages
- ❌ Harder to distinguish message types (info vs warning vs error)
- ❌ Messages go to stdout instead of stderr (mixes with data output)
- ❌ No TTY detection (ANSI codes in piped output)
After Fix:
- ✅ Consistent, color-coded output across all commands
- ✅ Clear visual hierarchy (errors in red, warnings in orange, success in green)
- ✅ Proper stderr routing (enables piping:
gh aw list --json | jq)
- ✅ TTY-aware (no ANSI codes in pipes/CI environments)
Files Requiring Updates (Priority Order)
High Priority (Most Instances)
pkg/cli/run_workflow_execution.go - 26 instances
pkg/cli/remove_command.go - 23 instances
pkg/cli/status_command.go - 15 instances
pkg/cli/trial_command.go - 7 instances
Medium Priority (5+ Instances)
pkg/cli/logs_command.go - 6 instances
pkg/cli/list_command.go - 5 instances
pkg/cli/audit_command.go - 5 instances
Lower Priority (<5 Instances Each)
8-24. Other CLI files with 1-4 instances each
Conversion Pattern
Standard Replacements
// 1. Info messages
fmt.Printf("Status: %s\n", status) // Before
fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Status: %s", status))) // After
// 2. Warning messages
fmt.Printf("Warning: %v\n", err) // Before
fmt.Fprintln(os.Stderr, console.FormatWarningMessage(err.Error())) // After
// 3. Success messages
fmt.Println("Compilation successful!") // Before
fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("Compilation successful!")) // After
// 4. Error messages
fmt.Printf("Error: %v\n", err) // Before
fmt.Fprintln(os.Stderr, console.FormatErrorMessage(err.Error())) // After
// 5. Commands/paths
fmt.Printf("Run: %s\n", cmd) // Before
fmt.Fprintln(os.Stderr, console.FormatCommandMessage(cmd)) // After
Available Console Formatters
console.FormatSuccessMessage() - Green checkmark, success messages
console.FormatInfoMessage() - Cyan info icon, informational messages
console.FormatWarningMessage() - Orange warning icon, warnings
console.FormatErrorMessage() - Red X, error messages
console.FormatCommandMessage() - Styled commands
console.FormatProgressMessage() - Progress indicators
console.FormatPromptMessage() - User prompts
console.FormatCountMessage() - Counts and metrics
console.FormatVerboseMessage() - Verbose/debug output
console.FormatLocationMessage() - File paths and locations
Implementation Strategy
Phase 1: High Priority Files (Week 1)
- Update top 4 files with most instances (71 total replacements)
- Run
make test after each file
- Verify output manually with
./gh-aw (command)
Phase 2: Medium Priority Files (Week 2)
- Update files with 5+ instances (16 total replacements)
- Test in TTY and non-TTY environments
Phase 3: Remaining Files (Week 3)
- Update remaining 17 files (<5 instances each)
- Final verification of consistency
Testing Checklist (Per File)
Success Criteria
Additional Context
The console formatting system is already well-established in the codebase:
- ✅ 96 files (20.6%) already use console formatters correctly
- ✅ Comprehensive
pkg/console package with 6,280 lines
- ✅ Lipgloss integration for adaptive colors (light/dark theme support)
- ✅ TTY detection for graceful degradation in CI/pipes
This task is about consistency, not building new infrastructure - all tools are already in place.
Source
Extracted from Terminal Stylist Analysis discussion #11742 - Console Output Pattern Review (2026-01-25)
Priority
Medium - Improves user experience and consistency but doesn't block functionality. Large scope (24 files) makes it suitable for incremental improvements.
AI generated by Discussion Task Miner - Code Quality Improvement Agent
Description
24 CLI files currently use raw
fmt.Printf/fmt.Printlncalls that bypass the console formatting system, creating inconsistent user experience. These files should useconsole.Format*functions for consistent styling, color support, and TTY-aware output.Current Problem
Anti-Pattern (used in 24 files):
Correct Pattern:
Impact
Current Issues:
After Fix:
gh aw list --json | jq)Files Requiring Updates (Priority Order)
High Priority (Most Instances)
pkg/cli/run_workflow_execution.go- 26 instancespkg/cli/remove_command.go- 23 instancespkg/cli/status_command.go- 15 instancespkg/cli/trial_command.go- 7 instancesMedium Priority (5+ Instances)
pkg/cli/logs_command.go- 6 instancespkg/cli/list_command.go- 5 instancespkg/cli/audit_command.go- 5 instancesLower Priority (<5 Instances Each)
8-24. Other CLI files with 1-4 instances each
Conversion Pattern
Standard Replacements
Available Console Formatters
console.FormatSuccessMessage()- Green checkmark, success messagesconsole.FormatInfoMessage()- Cyan info icon, informational messagesconsole.FormatWarningMessage()- Orange warning icon, warningsconsole.FormatErrorMessage()- Red X, error messagesconsole.FormatCommandMessage()- Styled commandsconsole.FormatProgressMessage()- Progress indicatorsconsole.FormatPromptMessage()- User promptsconsole.FormatCountMessage()- Counts and metricsconsole.FormatVerboseMessage()- Verbose/debug outputconsole.FormatLocationMessage()- File paths and locationsImplementation Strategy
Phase 1: High Priority Files (Week 1)
make testafter each file./gh-aw (command)Phase 2: Medium Priority Files (Week 2)
Phase 3: Remaining Files (Week 3)
Testing Checklist (Per File)
fmt.Print*calls converted toconsole.Format*make testpassesmake lintpasses./gh-aw (command)looks correct./gh-aw (command) 2>/dev/nullshows no unwanted output to stdout./gh-aw (command) --json | jq(if applicable)Success Criteria
fmt.Print*calls in CLI files (except JSON output to stdout)make lintreports no issuesAdditional Context
The console formatting system is already well-established in the codebase:
pkg/consolepackage with 6,280 linesThis task is about consistency, not building new infrastructure - all tools are already in place.
Source
Extracted from Terminal Stylist Analysis discussion #11742 - Console Output Pattern Review (2026-01-25)
Priority
Medium - Improves user experience and consistency but doesn't block functionality. Large scope (24 files) makes it suitable for incremental improvements.