From 7e69740508c393ed1e8a98223e74ef4a183ca39e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 03:50:50 +0000 Subject: [PATCH 1/2] Initial plan From 56567b6a6e1cb77609f2839daae4ec7e83317656 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Mar 2026 04:09:59 +0000 Subject: [PATCH 2/2] fix: resolve 7 CLI consistency issues from automated inspection Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- cmd/gh-aw/main.go | 18 +++++++++++++++++- pkg/cli/fix_command.go | 9 ++++++--- pkg/cli/project_command.go | 2 +- pkg/cli/status.go | 2 +- pkg/cli/tokens_bootstrap.go | 6 ++++-- pkg/cli/trial_command.go | 2 +- 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/cmd/gh-aw/main.go b/cmd/gh-aw/main.go index e4a8165350e..9b8596fccec 100644 --- a/cmd/gh-aw/main.go +++ b/cmd/gh-aw/main.go @@ -234,7 +234,7 @@ The --dependabot flag generates dependency manifests when dependencies are detec Examples: ` + string(constants.CLIExtensionPrefix) + ` compile # Compile all Markdown files - ` + string(constants.CLIExtensionPrefix) + ` compile ci-doctor # Compile a specific workflow + ` + string(constants.CLIExtensionPrefix) + ` compile ci-doctor # Compile a specific workflow ` + string(constants.CLIExtensionPrefix) + ` compile ci-doctor daily-plan # Compile multiple workflows ` + string(constants.CLIExtensionPrefix) + ` compile workflow.md # Compile by file path ` + string(constants.CLIExtensionPrefix) + ` compile --dir custom/workflows # Compile from custom directory @@ -416,6 +416,10 @@ Examples: var versionCmd = &cobra.Command{ Use: "version", Short: "Show gh aw extension version information", + Long: `Show the installed version of the gh aw extension. + +Examples: + ` + string(constants.CLIExtensionPrefix) + ` version # Print the current version`, RunE: func(cmd *cobra.Command, args []string) error { fmt.Fprintf(os.Stderr, "%s version %s\n", string(constants.CLIExtensionPrefix), version) return nil @@ -466,6 +470,18 @@ func init() { // Set version template to match the version subcommand format rootCmd.SetVersionTemplate(string(constants.CLIExtensionPrefix) + " version {{.Version}}\n") + // Cobra generates flag descriptions using c.Name() which returns the first + // word of Use ("gh" from "gh aw"), producing "help for gh" and "version for + // gh". Explicitly initialize and override these flags so they display "gh aw". + rootCmd.InitDefaultHelpFlag() + if f := rootCmd.Flags().Lookup("help"); f != nil { + f.Usage = "Show help for " + string(constants.CLIExtensionPrefix) + } + rootCmd.InitDefaultVersionFlag() + if f := rootCmd.Flags().Lookup("version"); f != nil { + f.Usage = "Show version for " + string(constants.CLIExtensionPrefix) + } + // Fix usage lines so subcommands show "gh aw " instead of "gh ". // Cobra derives the root name from the first word of Use ("gh" from "gh aw"), // so CommandPath() for subcommands omits "aw". We use SetUsageFunc to diff --git a/pkg/cli/fix_command.go b/pkg/cli/fix_command.go index 27b9cd6a9f4..66dfef596af 100644 --- a/pkg/cli/fix_command.go +++ b/pkg/cli/fix_command.go @@ -46,10 +46,13 @@ The command will: 1. Scan workflow files for deprecated fields 2. Apply relevant codemods to fix issues 3. Report what was changed in each file - 4. Write updated files back to disk (with --write flag) + +Without --write (dry-run mode), no files are modified. With --write, the command performs +all steps and additionally: + 4. Write updated files back to disk 5. Delete deprecated .github/aw/schemas/agentic-workflow.json file if it exists - 6. Delete old template files from pkg/cli/templates/ (with --write flag) - 7. Delete old workflow-specific .agent.md files from .github/agents/ (with --write flag) + 6. Delete old template files from pkg/cli/templates/ if present + 7. Delete old workflow-specific .agent.md files from .github/agents/ if present ` + WorkflowIDExplanation + ` diff --git a/pkg/cli/project_command.go b/pkg/cli/project_command.go index 876b818462b..81b54dea8a9 100644 --- a/pkg/cli/project_command.go +++ b/pkg/cli/project_command.go @@ -65,7 +65,7 @@ The project can optionally be linked to a specific repository. Authentication Requirements: The default GITHUB_TOKEN cannot create projects. You must use additional authentication. - See https://github.github.com/gh-aw/reference/auth/. + See https://github.github.com/gh-aw/reference/auth-projects/. Project Setup: Use --with-project-setup to automatically create: diff --git a/pkg/cli/status.go b/pkg/cli/status.go index 509e3ea0c77..85949276325 100644 --- a/pkg/cli/status.go +++ b/pkg/cli/status.go @@ -19,7 +19,7 @@ The optional pattern argument filters workflows by name (case-insensitive substr Examples: ` + string(constants.CLIExtensionPrefix) + ` status # Show all workflow status - ` + string(constants.CLIExtensionPrefix) + ` status ci- # Show workflows with 'ci-' in name + ` + string(constants.CLIExtensionPrefix) + ` status ci- # Show workflows with 'ci-' in name ` + string(constants.CLIExtensionPrefix) + ` status --json # Output in JSON format ` + string(constants.CLIExtensionPrefix) + ` status --ref main # Show latest run status for main branch ` + string(constants.CLIExtensionPrefix) + ` status --label automation # Show workflows with 'automation' label diff --git a/pkg/cli/tokens_bootstrap.go b/pkg/cli/tokens_bootstrap.go index 23150334990..d346302d5ab 100644 --- a/pkg/cli/tokens_bootstrap.go +++ b/pkg/cli/tokens_bootstrap.go @@ -33,8 +33,10 @@ This command: Only required secrets are prompted for. Optional secrets are not shown. For full details, including precedence rules, see the GitHub Tokens -reference in the documentation.`, - Example: ` gh aw secrets bootstrap # Check and set up all required secrets +reference in the documentation. + +Examples: + gh aw secrets bootstrap # Check and set up all required secrets gh aw secrets bootstrap --non-interactive # Display missing secrets without prompting gh aw secrets bootstrap --engine copilot # Check secrets for a specific engine`, RunE: func(cmd *cobra.Command, args []string) error { diff --git a/pkg/cli/trial_command.go b/pkg/cli/trial_command.go index 37f5c85b963..efc5bcc88a2 100644 --- a/pkg/cli/trial_command.go +++ b/pkg/cli/trial_command.go @@ -110,7 +110,7 @@ Advanced examples: Repository modes: - Default mode (no flags): Creates a temporary trial repository and simulates execution as if running against the current repository (github.repository context points to current repo) - --logical-repo REPO: Simulates execution against a specified repository (github.repository context points to REPO while actually running in a temporary trial repository) -- --repo REPO: Runs directly in the specified repository (no simulation, workflows installed and executed in REPO) +- --host-repo REPO (or --repo REPO): Uses the specified repository as the host for trial execution instead of creating a temporary one - --clone-repo REPO: Clones the specified repository's contents into the trial repository before execution (useful for testing against actual repository state) All workflows must support workflow_dispatch trigger to be used in trial mode.