Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 24, 2026

Verbose and informational messages across CLI commands were using inconsistent fmt.Printf patterns instead of console formatters, resulting in mixed output styling and stderr/stdout usage.

Changes

  • New helper: console.LogVerbose(verbose, msg) consolidates verbose logging with consistent 🔍 icon formatting
  • Converted 21 instances across 4 files:
    • commands.go: workflow creation messages
    • git.go: branch, commit, push operations
    • file_tracker.go: staging and rollback operations
    • run_workflow_tracking.go: retry polling messages
  • All output to stderr: Success/info messages now properly use fmt.Fprintln(os.Stderr, console.Format*Message(...))

Example

Before:

if verbose {
    fmt.Printf("Creating new workflow: %s\n", workflowName)
}
fmt.Printf("Created new workflow: %s\n", destFile)

After:

console.LogVerbose(verbose, fmt.Sprintf("Creating new workflow: %s", workflowName))
fmt.Fprintln(os.Stderr, console.FormatSuccessMessage(fmt.Sprintf("Created new workflow: %s", destFile)))

Output

# With -v flag:
🔍 Creating new workflow: test-workflow
✓ Created new workflow: .github/workflows/test-workflow.md
ℹ Edit the file to customize your workflow...

# Without -v:
✓ Created new workflow: .github/workflows/test-workflow.md
ℹ Edit the file to customize your workflow...
Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Standardize progress and info messages with console formatters</issue_title>
<issue_description>## Objective

Convert scattered progress and info messages to use console.FormatProgressMessage() and console.FormatInfoMessage() for consistency.

Context

From discussion #11611: Many CLI files use direct fmt.Printf for progress updates and informational messages instead of the standardized console formatters.

Primary Files: commands.go, git.go, file_tracker.go, run_workflow_tracking.go

Approach

  1. Identify progress and info messages:

    • Progress: Operations in progress (e.g., "Creating branch...", "Compiling workflow...")
    • Info: General information (e.g., "Found workflow file at...", "Using branch...")
  2. Convert to console formatters:

    • Use console.FormatProgressMessage() for operations
    • Use console.FormatInfoMessage() for informational output
    • Create console.LogVerbose() helper for verbose output
    • Ensure all output goes to stderr
  3. Test the changes:

    • Verify messages display correctly
    • Test with and without verbose flags
    • Ensure TTY/non-TTY modes work

Files to Modify

  • Update: pkg/cli/commands.go (~5 instances)
  • Update: pkg/cli/git.go (~10 instances)
  • Update: pkg/cli/file_tracker.go (~5 instances)
  • Update: pkg/cli/run_workflow_tracking.go (~15 instances)
  • Consider: pkg/console/verbose.go (new helper for verbose output)

Implementation Examples

// ❌ WRONG - Direct fmt.Printf:
fmt.Printf("Found workflow file at path: %s\n", fileOrWorkflowName)
fmt.Printf("Creating and switching to branch: %s\n", branchName)

// ✅ CORRECT - Console formatted:
fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Found workflow file at path: %s", fileOrWorkflowName)))
fmt.Fprintln(os.Stderr, console.FormatProgressMessage(fmt.Sprintf("Creating branch: %s", branchName)))
// NEW HELPER (pkg/console/verbose.go):
func LogVerbose(verbose bool, message string) {
    if verbose {
        fmt.Fprintln(os.Stderr, FormatVerboseMessage(message))
    }
}

// Usage:
console.LogVerbose(verbose, fmt.Sprintf("Processing %d workflows", count))

Acceptance Criteria

  • All progress messages use console.FormatProgressMessage()
  • All info messages use console.FormatInfoMessage()
  • console.LogVerbose() helper created for verbose output
  • Verbose output in run_workflow_tracking.go uses new helper
  • All output goes to stderr (except JSON)
  • Tests verify proper formatting
  • Code passes make fmt and make lint
  • make agent-finish completes successfully

Priority

Phase 3: Progress & Info Messages (6-8 hours estimated)

AI generated by Plan Command for discussion #11611

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…matters

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Standardize progress and info messages with console formatters Standardize CLI verbose/info messages to use console formatters Jan 24, 2026
Copilot AI requested a review from pelikhan January 24, 2026 14:22
@pelikhan pelikhan marked this pull request as ready for review January 24, 2026 15:39
@pelikhan pelikhan merged commit 784fb60 into main Jan 24, 2026
139 checks passed
@pelikhan pelikhan deleted the copilot/standardize-console-formatters branch January 24, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan] Standardize progress and info messages with console formatters

2 participants