From fec517832283d05a4816e3a87ebb23f8b1cf3078 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 17:11:37 +0000 Subject: [PATCH 1/3] Initial plan From 681ae56c162667abc490dc46e53516bc911c2e94 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 17:46:41 +0000 Subject: [PATCH 2/3] fix(cli): align help text engine lists and command wording Agent-Logs-Url: https://github.com/github/gh-aw/sessions/4733758b-90a8-43cb-9d44-1081922c1281 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- cmd/gh-aw/main.go | 6 +++--- pkg/cli/add_wizard_command.go | 2 +- pkg/cli/add_wizard_command_test.go | 16 ++++++++++++++++ pkg/cli/completion_command.go | 2 +- pkg/cli/flags.go | 4 ++-- pkg/cli/flags_test.go | 27 +++++++++++++++++++++++++++ pkg/cli/health_command.go | 4 ++-- pkg/cli/health_command_test.go | 1 + pkg/cli/init_command.go | 4 ++-- pkg/cli/logs_filtering_test.go | 2 +- pkg/cli/project_command.go | 2 +- pkg/cli/project_command_test.go | 2 +- pkg/cli/upgrade_command.go | 8 ++++++-- pkg/cli/validate_command.go | 2 +- 14 files changed, 65 insertions(+), 17 deletions(-) create mode 100644 pkg/cli/add_wizard_command_test.go diff --git a/cmd/gh-aw/main.go b/cmd/gh-aw/main.go index 170bfb98343..6520d530323 100644 --- a/cmd/gh-aw/main.go +++ b/cmd/gh-aw/main.go @@ -662,11 +662,11 @@ Use "` + string(constants.CLIExtensionPrefix) + ` help all" to show help for all // Add flags to new command newCmd.Flags().BoolP("force", "f", false, "Overwrite existing files without confirmation") newCmd.Flags().BoolP("interactive", "i", false, "Launch interactive workflow creation wizard") - newCmd.Flags().StringP("engine", "e", "", "Override AI engine (claude, codex, copilot, custom)") + newCmd.Flags().StringP("engine", "e", "", "Override AI engine (copilot, claude, codex, gemini, crush)") cli.RegisterEngineFlagCompletion(newCmd) // Add AI flag to compile and add commands - compileCmd.Flags().StringP("engine", "e", "", "Override AI engine (claude, codex, copilot, custom)") + compileCmd.Flags().StringP("engine", "e", "", "Override AI engine (copilot, claude, codex, gemini, crush)") compileCmd.Flags().String("action-mode", "", "Action script inlining mode (inline, dev, release). Auto-detected if not specified") compileCmd.Flags().String("action-tag", "", "Override action SHA or tag for actions/setup (overrides action-mode to release). Accepts full SHA or tag name") compileCmd.Flags().String("actions-repo", "", "Override the external actions repository used in action mode (default: github/gh-aw-actions)") @@ -727,7 +727,7 @@ Use "` + string(constants.CLIExtensionPrefix) + ` help all" to show help for all // Add flags to run command runCmd.Flags().Int("repeat", 0, "Number of additional times to run after the initial execution (e.g., --repeat 3 runs 4 times total)") runCmd.Flags().Bool("enable-if-needed", false, "Enable the workflow before running if needed, and restore state afterward") - runCmd.Flags().StringP("engine", "e", "", "Override AI engine (claude, codex, copilot, custom)") + runCmd.Flags().StringP("engine", "e", "", "Override AI engine (copilot, claude, codex, gemini, crush)") runCmd.Flags().StringP("repo", "r", "", "Target repository ([HOST/]owner/repo format). Defaults to current repository") runCmd.Flags().String("ref", "", "Branch or tag name to run the workflow on (default: current branch)") runCmd.Flags().Bool("auto-merge-prs", false, "Auto-merge any pull requests created during the workflow execution") diff --git a/pkg/cli/add_wizard_command.go b/pkg/cli/add_wizard_command.go index c172dff0414..fd1fff54b22 100644 --- a/pkg/cli/add_wizard_command.go +++ b/pkg/cli/add_wizard_command.go @@ -20,7 +20,7 @@ func NewAddWizardCommand(validateEngine func(string) error) *cobra.Command { Long: `Interactively add one or more agentic workflows with guided setup. This command walks you through: - - Selecting an AI engine (Copilot, Claude, or Codex) + - Selecting an AI engine (Copilot, Claude, Codex, or Gemini) - Configuring API keys and secrets - Creating a pull request with the workflow - Optionally running the workflow immediately diff --git a/pkg/cli/add_wizard_command_test.go b/pkg/cli/add_wizard_command_test.go new file mode 100644 index 00000000000..0c6ea0bc9cc --- /dev/null +++ b/pkg/cli/add_wizard_command_test.go @@ -0,0 +1,16 @@ +//go:build !integration + +package cli + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestAddWizardCommandMentionsGemini(t *testing.T) { + cmd := NewAddWizardCommand(func(string) error { return nil }) + require.NotNil(t, cmd, "Add wizard command should be created") + assert.Contains(t, cmd.Long, "Copilot, Claude, Codex, or Gemini", "Add wizard help should mention Gemini engine") +} diff --git a/pkg/cli/completion_command.go b/pkg/cli/completion_command.go index 09b80b72435..d4294ce4704 100644 --- a/pkg/cli/completion_command.go +++ b/pkg/cli/completion_command.go @@ -20,7 +20,7 @@ func NewCompletionCommand() *cobra.Command { Tab completion provides: - Command name completion (add, compile, run, etc.) - Workflow name completion for commands that accept workflow arguments -- Engine name completion for --engine flag (copilot, claude, codex, custom) +- Engine name completion for --engine flag (copilot, claude, codex, gemini, crush) - Directory path completion for --dir flag - Helpful descriptions for workflows when available diff --git a/pkg/cli/flags.go b/pkg/cli/flags.go index eadf188432a..366bfd0b07e 100644 --- a/pkg/cli/flags.go +++ b/pkg/cli/flags.go @@ -5,13 +5,13 @@ import "github.com/spf13/cobra" // addEngineFlag adds the --engine/-e flag to a command. // This flag allows overriding the AI engine type. func addEngineFlag(cmd *cobra.Command) { - cmd.Flags().StringP("engine", "e", "", "Override AI engine (claude, codex, copilot, custom)") + cmd.Flags().StringP("engine", "e", "", "Override AI engine (copilot, claude, codex, gemini, crush)") } // addEngineFilterFlag adds the --engine/-e flag to a command for filtering. // This flag allows filtering results by AI engine type. func addEngineFilterFlag(cmd *cobra.Command) { - cmd.Flags().StringP("engine", "e", "", "Filter logs by AI engine (claude, codex, copilot, custom)") + cmd.Flags().StringP("engine", "e", "", "Filter logs by AI engine (copilot, claude, codex, gemini, crush)") } // addRepoFlag adds the --repo/-r flag to a command. diff --git a/pkg/cli/flags_test.go b/pkg/cli/flags_test.go index 776c770088a..0b5a05e8e92 100644 --- a/pkg/cli/flags_test.go +++ b/pkg/cli/flags_test.go @@ -265,3 +265,30 @@ func createDisableCommandStub() *cobra.Command { cmd.Flags().StringP("repo", "r", "", "Target repository") return cmd } + +func TestEngineFlagUsageText(t *testing.T) { + t.Parallel() + + overrideCmd := &cobra.Command{Use: "override-test"} + addEngineFlag(overrideCmd) + + engineFlag := overrideCmd.Flags().Lookup("engine") + if engineFlag == nil { + t.Fatal("Expected --engine override flag to exist") + } + + if engineFlag.Usage != "Override AI engine (copilot, claude, codex, gemini, crush)" { + t.Errorf("Unexpected --engine override usage text: %s", engineFlag.Usage) + } + + filterCmd := &cobra.Command{Use: "filter-test"} + addEngineFilterFlag(filterCmd) + filterFlag := filterCmd.Flags().Lookup("engine") + if filterFlag == nil { + t.Fatal("Expected --engine filter flag to exist") + } + + if filterFlag.Usage != "Filter logs by AI engine (copilot, claude, codex, gemini, crush)" { + t.Errorf("Unexpected --engine filter usage text: %s", filterFlag.Usage) + } +} diff --git a/pkg/cli/health_command.go b/pkg/cli/health_command.go index 0f52a495b1f..4872c0ab2d4 100644 --- a/pkg/cli/health_command.go +++ b/pkg/cli/health_command.go @@ -40,7 +40,7 @@ Shows health metrics for workflows including: - Success/failure rates over time period - Trend indicators (↑ improving, → stable, ↓ degrading) - Average execution duration -- Alerts when success rate drops below threshold +- Warnings when success rate drops below threshold When called without a workflow name, displays summary for all workflows. When called with a specific workflow name, displays detailed metrics for that workflow. @@ -51,7 +51,7 @@ Examples: ` + string(constants.CLIExtensionPrefix) + ` health # Summary of all workflows (last 7 days) ` + string(constants.CLIExtensionPrefix) + ` health issue-monster # Detailed metrics for specific workflow ` + string(constants.CLIExtensionPrefix) + ` health --days 30 # Summary for last 30 days - ` + string(constants.CLIExtensionPrefix) + ` health --threshold 90 # Alert if below 90% success rate + ` + string(constants.CLIExtensionPrefix) + ` health --threshold 90 # Warn if below 90% success rate ` + string(constants.CLIExtensionPrefix) + ` health --json # Output in JSON format ` + string(constants.CLIExtensionPrefix) + ` health issue-monster --days 90 # 90-day metrics for workflow`, Args: cobra.MaximumNArgs(1), diff --git a/pkg/cli/health_command_test.go b/pkg/cli/health_command_test.go index adb6532549f..c8760bf0158 100644 --- a/pkg/cli/health_command_test.go +++ b/pkg/cli/health_command_test.go @@ -67,6 +67,7 @@ func TestHealthCommand(t *testing.T) { assert.NotNil(t, cmd, "Health command should be created") assert.Equal(t, "health", cmd.Name(), "Command name should be 'health'") assert.True(t, cmd.HasAvailableFlags(), "Command should have flags") + assert.Contains(t, cmd.Long, "Warnings when success rate drops below threshold", "Health help should consistently use warnings terminology") // Check that required flags are registered daysFlag := cmd.Flags().Lookup("days") diff --git a/pkg/cli/init_command.go b/pkg/cli/init_command.go index 8016d77be39..2f8741d1117 100644 --- a/pkg/cli/init_command.go +++ b/pkg/cli/init_command.go @@ -21,7 +21,7 @@ Interactive Mode (default): gh aw init When invoked without flags, init enters interactive mode and prompts you to: - - Select which AI engine to use (Copilot, Claude, or Codex) + - Select which AI engine to use (Copilot, Claude, Codex, or Gemini) - Automatically configure engine-specific settings (e.g., MCP for Copilot) - Detect and configure secrets from your environment - Set up repository Actions secrets automatically @@ -117,7 +117,7 @@ Examples: }, } - cmd.Flags().StringP("engine", "e", "", "Override AI engine (claude, codex, copilot, custom)") + cmd.Flags().StringP("engine", "e", "", "Override AI engine (copilot, claude, codex, gemini, crush)") _ = cmd.Flags().MarkHidden("engine") // Hide the engine flag from help output (internal use only) cmd.Flags().Bool("no-mcp", false, "Skip configuring gh-aw MCP server integration for GitHub Copilot Agent") cmd.Flags().String("codespaces", "", "Create devcontainer.json for GitHub Codespaces with agentic workflows support. Specify comma-separated repository names in the same organization (e.g., repo1,repo2), or use without value for current repo only") diff --git a/pkg/cli/logs_filtering_test.go b/pkg/cli/logs_filtering_test.go index 4c12068dd76..040972a5ac4 100644 --- a/pkg/cli/logs_filtering_test.go +++ b/pkg/cli/logs_filtering_test.go @@ -66,7 +66,7 @@ func TestLogsCommandFlags(t *testing.T) { t.Fatal("Engine flag not found") } - if engineFlag.Usage != "Filter logs by AI engine (claude, codex, copilot, custom)" { + if engineFlag.Usage != "Filter logs by AI engine (copilot, claude, codex, gemini, crush)" { t.Errorf("Unexpected engine flag usage text: %s", engineFlag.Usage) } diff --git a/pkg/cli/project_command.go b/pkg/cli/project_command.go index 9c551c72309..52d8c9678ac 100644 --- a/pkg/cli/project_command.go +++ b/pkg/cli/project_command.go @@ -61,7 +61,7 @@ Examples: func NewProjectNewCommand() *cobra.Command { cmd := &cobra.Command{ Use: "new