-
Notifications
You must be signed in to change notification settings - Fork 38
Closed
Labels
Description
Objective
Convert all raw error outputs in CLI command files to use console.FormatErrorMessage() for consistent, professional error presentation.
Context
Currently only 3% (44/1,450) of error outputs use proper console formatting despite AGENTS.md requirements. This creates an inconsistent user experience where some errors are beautifully formatted while others appear as raw text dumps.
Files to Modify
High-priority CLI files with raw error outputs:
pkg/cli/access_log.gopkg/cli/actions_build_command.gopkg/cli/add_command.gopkg/cli/audit.gopkg/cli/audit_report_render.gopkg/cli/compile_batch_operations.gopkg/cli/compile_helpers.gopkg/cli/compile_orchestration.go
Approach
Replace raw error output patterns with console formatting:
// OLD - Raw output
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
fmt.Println(err)
// NEW - Console formatted
fmt.Fprintln(os.Stderr, console.FormatErrorMessage(err.Error()))Ensure all files:
- Import
github.com/githubnext/gh-aw/pkg/console - Send all error output to stderr (not stdout)
- Use
console.FormatErrorMessage()consistently - Follow console formatting guidelines from AGENTS.md
Acceptance Criteria
- All error outputs in
pkg/cli/*.gouseconsole.FormatErrorMessage() - No
fmt.Println(err)orfmt.Printf(err)direct error outputs remain - All error output goes to stderr via
fmt.Fprintln(os.Stderr, ...) - Consistent formatting across all CLI commands
- Visual regression tests pass (run
make test) - No errors printed to stdout
Validation
Run after changes:
make test
make lint
# Verify no direct error prints remain
grep -r "fmt.Println.*err" pkg/cli/Related to #9236
AI generated by Plan Command for discussion #9231
Copilot