Skip to content

[plan] Fix unformatted stderr output in remaining CLI files (audit, compile, deps, logs, etc.) #21179

@github-actions

Description

@github-actions

Objective

Replace raw fmt.Fprintf(os.Stderr, ...) calls with console.Format* wrappers across the remaining CLI files identified in the Terminal Stylist audit (discussion #21126).

Context

The audit found ~54 files with unformatted stderr output. This issue covers the remaining files not addressed in the other sub-issues (copilot_setup, mcp_list_tools, gateway_logs, MCP files, and add/interactive files).

Files to Modify

All files are in pkg/cli/:

  • actionlint.go
  • audit.go
  • audit_report_render.go
  • compile_helpers.go
  • compile_stats.go
  • compile_watch.go
  • copilot_agents.go
  • deps_outdated.go
  • deps_report.go
  • deps_security.go
  • devcontainer.go
  • domains_command.go
  • enable.go
  • engine_secrets.go
  • fix_command.go
  • health_command.go
  • init.go
  • list_workflows_command.go
  • logs_orchestrator.go
  • logs_report.go
  • pr_command.go
  • preconditions.go
  • remove_command.go
  • secret_set_command.go
  • shell_completion.go
  • tokens_bootstrap.go
  • trial_command.go
  • trial_repository.go
  • update_actions.go
  • update_check.go
  • update_display.go
  • upgrade_command.go
  • vscode_config.go

Approach

For each file:

  1. Find all fmt.Fprintf(os.Stderr, ...) and fmt.Fprintln(os.Stderr, ...) calls NOT already using console formatters
  2. Choose the correct formatter based on message semantics:
    • Info/neutral → console.FormatInfoMessage
    • Success/completion → console.FormatSuccessMessage
    • Warning → console.FormatWarningMessage
    • Error → console.FormatErrorMessage
    • Command display → console.FormatCommandMessage
    • Progress → console.FormatProgressMessage
    • List items → console.FormatListItem
    • Section headers → console.FormatSectionHeader
  3. Convert fmt.Fprintf(os.Stderr, "...\n", args...)fmt.Fprintln(os.Stderr, console.FormatXxxMessage(fmt.Sprintf("...", args...)))

Note

Do NOT change:

  • Calls that already wrap a console.Format* function
  • Calls that output structured data (JSON, tables, hashes, graphs) to stdout
  • fmt.Println(jsonBytes), fmt.Println(hash), fmt.Println(mermaidGraph) — these are correct stdout usage

Acceptance Criteria

  • All raw fmt.Fprintf(os.Stderr, ...) diagnostic messages in the listed files replaced with console formatters
  • make fmt passes with no changes
  • make test-unit passes

Generated by Plan Command for issue #discussion #21126 ·

  • expires on Mar 18, 2026, 5:12 AM UTC

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions