Skip to content

[plan] Migrate CLI commands from Run to RunE for idiomatic error handling #5300

@github-actions

Description

@github-actions

Overview

This tracking issue covers the migration of all CLI command implementations from using Run to RunE for idiomatic Go error handling. This will eliminate 107 instances of repetitive error handling code and adopt best practices.

Source: Issue #5282

Current State

  • 107 commands use Run with manual error handling and os.Exit(1)
  • Only 4 commands use RunE

Target State

  • All commands use RunE and return errors directly
  • Cobra handles exit codes automatically
  • Consistent error formatting across all commands

Planned Sub-Issues

This work is broken into 5 manageable batches:

  1. Setup error formatter and migrate root/compile commands - Foundation work
  2. Migrate workflow commands - Core workflow operations (run, status, logs, audit)
  3. Migrate MCP commands - MCP server management commands
  4. Migrate development utilities - Development and testing commands
  5. Migrate remaining commands - All other commands for complete coverage

Benefits

  • More idiomatic Go error handling
  • Eliminates 107 instances of repetitive code
  • Cleaner, more maintainable codebase
  • Consistent error propagation pattern

Testing Strategy

Each batch will be tested to ensure:

AI generated by Plan Command for #5282

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions