From e3f9de73c2c743b45376e715d3a0d91b1fc6d02d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 13 Apr 2026 14:47:20 +0000 Subject: [PATCH 1/2] Initial plan From 2a3a16112d594b2d0f37afc82df69339cf5113ac Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 13 Apr 2026 15:18:59 +0000 Subject: [PATCH 2/2] fix: resolve 11 CLI help text consistency issues (#26042) - Fix unexplained jargon: explain "Drain3" as log template mining library in logs --train - Fix misleading argument name: rename remove [pattern] to [filter], update description from "prefix" to "substring" matching (matching actual code behavior) - Fix inconsistent example comment in trial: --host-repo no longer says "(no simulation)" - Fix inconsistent example comment in logs: --start-date -1w says "up to 10 runs" not "all runs" - Remove redundant text in audit: remove duplicate "This command:" bullet list - Remove redundant text in secrets bootstrap: remove duplicate "This command:" bullet list - Remove redundant text in upgrade: remove duplicate "The upgrade process ensures:" list - Fix docs vs CLI mismatch: add new, logs, audit to docs "Most Common Commands" table and add add-wizard to CLI "Common Tasks" - Fix minor wording: root help audit changed to - Fix minor wording: trial --timeout remove redundant "(e.g., 30 for 30 minutes)" - Fix minor wording: list --dir description aligned with other commands' --dir style Agent-Logs-Url: https://github.com/github/gh-aw/sessions/a372acf8-95ab-43b8-9635-e01106397e5e Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- cmd/gh-aw/main.go | 13 +++++++------ docs/src/content/docs/setup/cli.md | 3 +++ pkg/cli/audit.go | 7 ------- pkg/cli/list_workflows_command.go | 2 +- pkg/cli/logs_command.go | 6 +++--- pkg/cli/remove_command.go | 2 +- pkg/cli/tokens_bootstrap.go | 6 ------ pkg/cli/trial_command.go | 4 ++-- pkg/cli/upgrade_command.go | 7 ------- 9 files changed, 17 insertions(+), 33 deletions(-) diff --git a/cmd/gh-aw/main.go b/cmd/gh-aw/main.go index 868e33fc178..051f110acd4 100644 --- a/cmd/gh-aw/main.go +++ b/cmd/gh-aw/main.go @@ -86,11 +86,12 @@ var rootCmd = &cobra.Command{ Common Tasks: gh aw init # Set up a new repository + gh aw add-wizard # Add workflows with interactive guided setup gh aw new my-workflow # Create your first workflow gh aw compile # Compile all workflows gh aw run my-workflow # Execute a workflow gh aw logs my-workflow # View execution logs - gh aw audit # Debug a failed run + gh aw audit # Debug a failed run For detailed help on any command, use: gh aw [command] --help`, @@ -163,19 +164,19 @@ Examples: } var removeCmd = &cobra.Command{ - Use: "remove [pattern]", - Short: "Remove agentic workflow files matching the given pattern", - Long: `Remove agentic workflow files matching the given workflow-id pattern. + Use: "remove [filter]", + Short: "Remove agentic workflow files matching the given filter", + Long: `Remove agentic workflow files matching the given filter. The workflow-id is the basename of the Markdown file without the .md extension. -You can provide a workflow-id prefix to remove multiple workflows, or a specific workflow-id. +You can provide a substring to match multiple workflows, or a specific workflow-id. By default, this command also removes orphaned include files that are no longer referenced by any workflow. Use --keep-orphans to skip this cleanup. Examples: ` + string(constants.CLIExtensionPrefix) + ` remove my-workflow # Remove specific workflow - ` + string(constants.CLIExtensionPrefix) + ` remove test- # Remove all workflows starting with 'test-' + ` + string(constants.CLIExtensionPrefix) + ` remove test- # Remove all workflows containing 'test-' in name ` + string(constants.CLIExtensionPrefix) + ` remove old- --keep-orphans # Remove workflows but keep orphaned includes ` + string(constants.CLIExtensionPrefix) + ` remove my-workflow --dir .github/workflows/shared # Remove from custom directory`, RunE: func(cmd *cobra.Command, args []string) error { diff --git a/docs/src/content/docs/setup/cli.md b/docs/src/content/docs/setup/cli.md index cc8e01fe5b6..7d2d2b9111f 100644 --- a/docs/src/content/docs/setup/cli.md +++ b/docs/src/content/docs/setup/cli.md @@ -14,10 +14,13 @@ The `gh aw` CLI extension enables developers to create, manage, and execute AI-p | [`gh aw init`](#init) | Set up your repository for agentic workflows | | [`gh aw add-wizard`](#add-wizard) | Add workflows with interactive guided setup | | [`gh aw add`](#add) | Add workflows from other repositories (non-interactive) | +| [`gh aw new`](#new) | Create a new workflow from scratch | | [`gh aw compile`](#compile) | Convert markdown to GitHub Actions YAML | | [`gh aw list`](#list) | Quick listing of all workflows | | [`gh aw run`](#run) | Execute workflows immediately in GitHub Actions | | [`gh aw status`](#status) | Check current state of all workflows | +| [`gh aw logs`](#logs) | Download and analyze workflow logs | +| [`gh aw audit`](#audit) | Debug a failed workflow run | ## Installation diff --git a/pkg/cli/audit.go b/pkg/cli/audit.go index e7ea3b56bcd..f8ea5b02829 100644 --- a/pkg/cli/audit.go +++ b/pkg/cli/audit.go @@ -45,13 +45,6 @@ When a job URL is provided: - If no step number, finds and extracts the first failing step's output - Saves job logs to the output directory -This command: -- Downloads artifacts and logs for the specified run ID -- Detects errors and warnings in the logs -- Analyzes MCP tool usage statistics -- Extracts missing tool reports -- Generates a concise Markdown report - Examples: ` + string(constants.CLIExtensionPrefix) + ` audit 1234567890 # Audit run with ID 1234567890 ` + string(constants.CLIExtensionPrefix) + ` audit https://github.com/owner/repo/actions/runs/1234567890 # Audit from run URL diff --git a/pkg/cli/list_workflows_command.go b/pkg/cli/list_workflows_command.go index ffeffeec1ae..9c84fde9ce4 100644 --- a/pkg/cli/list_workflows_command.go +++ b/pkg/cli/list_workflows_command.go @@ -72,7 +72,7 @@ Examples: addJSONFlag(cmd) cmd.Flags().String("label", "", "Filter workflows by label") cmd.Flags().String("path", ".github/workflows", "Path to workflows directory in the remote repository (used with --repo)") - cmd.Flags().StringP("dir", "d", "", "Local workflow directory (overrides default .github/workflows; ignored when --repo is set)") + cmd.Flags().StringP("dir", "d", "", "Workflow directory (default: .github/workflows; ignored when --repo is set)") // Register completions for list command cmd.ValidArgsFunction = CompleteWorkflowNames diff --git a/pkg/cli/logs_command.go b/pkg/cli/logs_command.go index ff763fa63a9..4dd7634783d 100644 --- a/pkg/cli/logs_command.go +++ b/pkg/cli/logs_command.go @@ -57,8 +57,8 @@ Examples: # Date filtering ` + string(constants.CLIExtensionPrefix) + ` logs --start-date 2024-01-01 # Download all runs after date ` + string(constants.CLIExtensionPrefix) + ` logs --end-date 2024-01-31 # Download all runs before date - ` + string(constants.CLIExtensionPrefix) + ` logs --start-date -1w # Download all runs from last week - ` + string(constants.CLIExtensionPrefix) + ` logs --start-date -1w -c 5 # Download all runs from last week, show up to 5 + ` + string(constants.CLIExtensionPrefix) + ` logs --start-date -1w # Download up to 10 runs from last week + ` + string(constants.CLIExtensionPrefix) + ` logs --start-date -1w -c 5 # Download up to 5 runs from last week ` + string(constants.CLIExtensionPrefix) + ` logs --end-date -1d # Download all runs until yesterday ` + string(constants.CLIExtensionPrefix) + ` logs --start-date -1mo # Download all runs from last month @@ -208,7 +208,7 @@ Examples: addJSONFlag(logsCmd) logsCmd.Flags().Int("timeout", 0, "Download timeout in minutes (0 = no timeout)") logsCmd.Flags().String("summary-file", "summary.json", "Path to write the summary JSON file relative to output directory (use empty string to disable)") - logsCmd.Flags().Bool("train", false, "Train drain3 log template weights from downloaded runs and write drain3_weights.json to the output directory") + logsCmd.Flags().Bool("train", false, "Train Drain3 (log template mining) weights from downloaded runs and write drain3_weights.json to the output directory") logsCmd.Flags().String("format", "", "Output format for cross-run audit report: markdown, pretty (generates security audit report instead of default metrics table)") logsCmd.Flags().Int("last", 0, "Alias for --count: number of recent runs to download") logsCmd.Flags().StringSlice("artifacts", nil, "Artifact sets to download (default: all). Valid sets: "+strings.Join(ValidArtifactSetNames(), ", ")) diff --git a/pkg/cli/remove_command.go b/pkg/cli/remove_command.go index a9c2662362b..1b20a70fe44 100644 --- a/pkg/cli/remove_command.go +++ b/pkg/cli/remove_command.go @@ -59,7 +59,7 @@ func RemoveWorkflows(pattern string, keepOrphans bool, workflowDir string) error fmt.Fprintf(os.Stderr, " %s\n", name) } } - fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("\nUsage: %s remove ", string(constants.CLIExtensionPrefix)))) + fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("\nUsage: %s remove ", string(constants.CLIExtensionPrefix)))) return nil } diff --git a/pkg/cli/tokens_bootstrap.go b/pkg/cli/tokens_bootstrap.go index 7c3252e9047..8995c87a993 100644 --- a/pkg/cli/tokens_bootstrap.go +++ b/pkg/cli/tokens_bootstrap.go @@ -24,12 +24,6 @@ func newSecretsBootstrapSubcommand() *cobra.Command { are required, check which ones are already configured, and interactively prompt for any missing required secrets. -This command: -- Discovers all workflow files in .github/workflows/ -- Analyzes required secrets for each workflow's engine -- Checks which secrets already exist in the repository -- Interactively prompts for missing required secrets (unless --non-interactive) - Only required secrets are prompted for. Optional secrets are not shown. For full details, including precedence rules, see the GitHub Tokens diff --git a/pkg/cli/trial_command.go b/pkg/cli/trial_command.go index b65885c1924..c79ede9a4c0 100644 --- a/pkg/cli/trial_command.go +++ b/pkg/cli/trial_command.go @@ -30,7 +30,7 @@ Workflows from different repositories: ` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/daily-plan myorg/myrepo/custom-workflow Repository mode examples: - ` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --host-repo myorg/myrepo # Run directly in myorg/myrepo (no simulation) + ` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --host-repo myorg/myrepo # Use myorg/myrepo as host for trial execution ` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --logical-repo myorg/myrepo # Simulate running against myorg/myrepo ` + string(constants.CLIExtensionPrefix) + ` trial githubnext/agentics/my-workflow --clone-repo myorg/myrepo # Clone myorg/myrepo contents into host @@ -127,7 +127,7 @@ Trial results are saved both locally (in trials/ directory) and in the host repo cmd.Flags().Bool("force-delete-host-repo-before", false, "Force delete the host repository before creation if it already exists") cmd.Flags().BoolP("yes", "y", false, "Skip confirmation prompts") cmd.Flags().Bool("dry-run", false, "Show what would be done without making any changes") - cmd.Flags().Int("timeout", 30, "Execution timeout in minutes (e.g., 30 for 30 minutes)") + cmd.Flags().Int("timeout", 30, "Execution timeout in minutes") cmd.Flags().String("trigger-context", "", "Trigger context URL (e.g., GitHub issue URL) for issue-triggered workflows") cmd.Flags().Int("repeat", 0, "Number of additional times to run after the initial execution (e.g., --repeat 3 runs 4 times total)") cmd.Flags().Bool("auto-merge-prs", false, "Auto-merge any pull requests created during trial execution") diff --git a/pkg/cli/upgrade_command.go b/pkg/cli/upgrade_command.go index 7a97215e3a5..97d6c39c593 100644 --- a/pkg/cli/upgrade_command.go +++ b/pkg/cli/upgrade_command.go @@ -51,13 +51,6 @@ Use --audit to check dependency health without performing upgrades. This include The --audit flag skips the normal upgrade process. -The upgrade process ensures: -- Dispatcher agent is current (.github/agents/agentic-workflows.agent.md) -- All workflows use the latest syntax and configuration options -- Deprecated fields are automatically migrated across all workflows -- GitHub Actions are pinned to the latest versions -- All workflows are compiled and lock files are up-to-date - This command always upgrades all Markdown files in .github/workflows. Examples: