-
Notifications
You must be signed in to change notification settings - Fork 295
Open
Labels
Description
Objective
Replace raw fmt.Fprintf(os.Stderr, ...) calls with appropriate console.Format* wrappers in two high-priority files identified in the Terminal Stylist audit (discussion #21126).
Context
The audit found ~54 files using raw stderr writes. These two files are the highest-priority due to call count and user visibility.
Files to Modify
pkg/cli/copilot_setup.go — 12 raw stderr calls
Replace patterns like:
fmt.Fprintf(os.Stderr, "No version upgrade needed for %s\n", setupStepsPath)
fmt.Fprintf(os.Stderr, "Updated %s with new version %s\n", setupStepsPath, version)
fmt.Fprintf(os.Stderr, "Skipping %s (already has gh-aw extension install step)\n", path)With:
fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("No version upgrade needed for %s", setupStepsPath)))
fmt.Fprintln(os.Stderr, console.FormatSuccessMessage(fmt.Sprintf("Updated %s with new version %s", setupStepsPath, version)))
fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Skipping %s (already has gh-aw extension install step)", path)))pkg/cli/mcp_list_tools.go — 4 raw stderr calls
Replace patterns like:
fmt.Fprintf(os.Stderr, "Available MCP servers: ")
fmt.Fprintf(os.Stderr, "%s\n", strings.Join(serverNames, ", "))
fmt.Fprintf(os.Stderr, "Found MCP server '%s' in %d workflow(s): %s\n", ...)
fmt.Fprintf(os.Stderr, "\nRun 'gh aw mcp list-tools %s (workflow-name)'...\n", ...)With appropriate console.FormatInfoMessage / console.FormatSuccessMessage wrappers.
Approach
- Audit each raw
fmt.Fprintf(os.Stderr, ...)call in both files - Choose the correct formatter based on message semantics:
- Info/neutral →
console.FormatInfoMessage - Success/completion →
console.FormatSuccessMessage - Warning →
console.FormatWarningMessage - Error →
console.FormatErrorMessage
- Info/neutral →
- Convert
fmt.Fprintf(os.Stderr, "...\n", args...)→fmt.Fprintln(os.Stderr, console.FormatXxxMessage(fmt.Sprintf("...", args...))) - Run
make fmt && make test-unitto validate
Acceptance Criteria
- All raw
fmt.Fprintf(os.Stderr, ...)incopilot_setup.goreplaced with console formatters - All raw
fmt.Fprintf(os.Stderr, ...)inmcp_list_tools.goreplaced with console formatters -
make fmtpasses with no changes -
make test-unitpasses
Generated by Plan Command for issue #discussion #21126 · ◷
- expires on Mar 18, 2026, 5:12 AM UTC
Reactions are currently unavailable