Skip to content

Commit 0e0d373

Browse files
Copilotpelikhangh-aw-bot
authored
Unify gh aw help/docs wording and expose experiments command in CLI reference (#44794)
* Initial plan * Harmonize CLI help wording and docs examples Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Refine remaining CLI consistency wording gaps Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * Fix logs help trailing blank line and lint --dir example path Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> * fix: broaden trial --dry-run flag description per github-actions review Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com> Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
1 parent f7f7352 commit 0e0d373

19 files changed

Lines changed: 50 additions & 47 deletions

cmd/gh-aw/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Unlike 'upgrade', compilation only applies codemods when you opt in with --fix.
276276
` + string(constants.CLIExtensionPrefix) + ` compile workflow.md # Compile by file path
277277
` + string(constants.CLIExtensionPrefix) + ` compile .github/workflows # Compile all workflows in a directory
278278
` + string(constants.CLIExtensionPrefix) + ` compile --dir custom/workflows # Compile from custom directory
279-
` + string(constants.CLIExtensionPrefix) + ` compile --watch ci-doctor # Watch and auto-compile
279+
` + string(constants.CLIExtensionPrefix) + ` compile ci-doctor --watch # Watch and auto-compile
280280
` + string(constants.CLIExtensionPrefix) + ` compile --trial --logical-repo owner/repo # Compile for trial mode
281281
` + string(constants.CLIExtensionPrefix) + ` compile --dependabot # Generate Dependabot manifests
282282
` + string(constants.CLIExtensionPrefix) + ` compile --dependabot --force # Force overwrite existing dependabot.yml
@@ -433,7 +433,7 @@ This command only works with workflows that have workflow_dispatch triggers.
433433
gh aw run daily-perf-improver --auto-merge-prs # Auto-merge any PRs created during execution
434434
gh aw run daily-perf-improver -F name=value -F env=prod # Pass workflow inputs
435435
gh aw run daily-perf-improver --push # Commit and push workflow files before running
436-
gh aw run daily-perf-improver --dry-run # Validate without actually running
436+
gh aw run daily-perf-improver --dry-run # Preview without triggering workflow runs
437437
gh aw run daily-perf-improver --json # Output results in JSON format`,
438438
Args: cobra.ArbitraryArgs,
439439
RunE: func(cmd *cobra.Command, args []string) error {
@@ -795,7 +795,7 @@ Use "` + string(constants.CLIExtensionPrefix) + ` help all" to show help for all
795795
runCmd.Flags().Bool("auto-merge-prs", false, "Auto-merge any pull requests created during the workflow execution")
796796
runCmd.Flags().StringArrayP("raw-field", "F", []string{}, "Add a string parameter in key=value format (can be used multiple times)")
797797
runCmd.Flags().Bool("push", false, "Commit and push workflow files (including transitive imports) before running")
798-
runCmd.Flags().Bool("dry-run", false, "Validate workflow without actually triggering execution on GitHub Actions")
798+
runCmd.Flags().Bool("dry-run", false, "Preview workflow execution without triggering runs on GitHub Actions")
799799
runCmd.Flags().BoolP("json", "j", false, "Output results in JSON format")
800800
runCmd.Flags().Bool("approve", false, "Approve all safe update changes. When strict mode is active (the default), the compiler emits warnings for new restricted secrets or unapproved action additions/removals not present in the existing gh-aw-manifest. Use this flag to approve and skip safe update enforcement")
801801
// Register completions for run command

docs/src/content/docs/setup/cli.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ gh aw run workflow1 workflow2 # Run multiple workflows
383383
gh aw run workflow --repeat 3 # Run 4 times total (1 initial + 3 repeats)
384384
gh aw run workflow --push # Auto-commit, push, and dispatch workflow
385385
gh aw run workflow --push --ref main # Push to specific branch
386+
gh aw run workflow --dry-run # Preview without triggering workflow runs
386387
gh aw run workflow --json # Output triggered workflow results as JSON
387388
```
388389

@@ -614,7 +615,7 @@ Forecast AI Credit (AIC) usage for agentic workflows using recent run history an
614615
```bash wrap
615616
gh aw forecast # Forecast all workflows (monthly)
616617
gh aw forecast ci-doctor # Forecast a specific workflow
617-
gh aw forecast ci-doctor daily-planner # Compare two workflows
618+
gh aw forecast ci-doctor daily-news # Compare two workflows
618619
gh aw forecast --period week # Weekly projections
619620
gh aw forecast --days 7 # Use 7-day history window
620621
gh aw forecast --sample 50 # Sample up to 50 runs per workflow

pkg/cli/add_command.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ type AddWorkflowsResult struct {
9898
func NewAddCommand(validateEngine func(string) error) *cobra.Command {
9999
cmd := &cobra.Command{
100100
Use: "add <workflow>...",
101-
Short: "Add agentic workflows from repositories or local files to .github/workflows",
101+
Short: "Add agentic workflows from repositories, local files, or URLs to .github/workflows",
102102
Long: addCommandLong,
103103
Example: addCommandExample,
104104
Args: func(cmd *cobra.Command, args []string) error {
@@ -194,8 +194,8 @@ func registerAddCommandFlags(cmd *cobra.Command) {
194194
cmd.Flags().String("stop-after", "", "Override stop-after value in the workflow (e.g., '+48h', '2025-12-31 23:59:59')")
195195

196196
// Add no-security-scanner flag to add command (--disable-security-scanner is kept as a deprecated alias)
197-
cmd.Flags().Bool("no-security-scanner", false, "Disable security scanning of workflow markdown content")
198-
cmd.Flags().Bool("disable-security-scanner", false, "Disable security scanning of workflow markdown content")
197+
cmd.Flags().Bool("no-security-scanner", false, "Skip security scanning of workflow markdown content")
198+
cmd.Flags().Bool("disable-security-scanner", false, "Skip security scanning of workflow markdown content")
199199
_ = cmd.Flags().MarkDeprecated("disable-security-scanner", "use --no-security-scanner instead")
200200

201201
// Register completions for add command

pkg/cli/add_command_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestNewAddCommand(t *testing.T) {
2727

2828
require.NotNil(t, cmd, "NewAddCommand should not return nil")
2929
assert.Equal(t, "add <workflow>...", cmd.Use, "Command use should be 'add <workflow>...'")
30-
assert.Equal(t, "Add agentic workflows from repositories or local files to .github/workflows", cmd.Short, "Command short description should match")
30+
assert.Equal(t, "Add agentic workflows from repositories, local files, or URLs to .github/workflows", cmd.Short, "Command short description should match")
3131
assert.Contains(t, cmd.Long, "Add one or more agentic workflows", "Command long description should contain expected text")
3232

3333
// Verify Args validator is set

pkg/cli/add_wizard_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Note: To create a new workflow from scratch, use the 'new' command instead.`,
128128
cmd.Flags().String("append", "", "Append extra content to the end of agentic workflow on installation")
129129

130130
// Add no-security-scanner flag (matches --no-security-scanner in add command)
131-
cmd.Flags().Bool("no-security-scanner", false, "Disable security scanning of workflow markdown content")
131+
cmd.Flags().Bool("no-security-scanner", false, "Skip security scanning of workflow markdown content")
132132

133133
// Register completions
134134
RegisterEngineFlagCompletion(cmd)

pkg/cli/deploy_command.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func validateDeployArgs(cmd *cobra.Command, args []string) error {
9090
}
9191

9292
func registerDeployFlags(cmd *cobra.Command) {
93-
cmd.Flags().StringP("repo", "r", "", "Target repository in [HOST/]owner/repo format (required unless --org is provided)")
93+
cmd.Flags().StringP("repo", "r", "", "Target repository ([HOST/]owner/repo format). Required unless --org is provided")
9494
cmd.Flags().StringP("name", "n", "", "Specify name for the added workflow (without .md extension)")
9595
addEngineFlag(cmd)
9696
cmd.Flags().BoolP("force", "f", false, "Overwrite existing workflow files without confirmation")
@@ -99,8 +99,8 @@ func registerDeployFlags(cmd *cobra.Command) {
9999
cmd.Flags().StringP("dir", "d", "", "Workflow directory (default: $GH_AW_WORKFLOWS_DIR or .github/workflows)")
100100
cmd.Flags().Bool("no-stop-after", false, "Remove any stop-after field from the workflow")
101101
cmd.Flags().String("stop-after", "", "Override stop-after value in the workflow (e.g., '+48h', '2025-12-31 23:59:59')")
102-
cmd.Flags().Bool("no-security-scanner", false, "Disable security scanning of workflow markdown content")
103-
cmd.Flags().Bool("disable-security-scanner", false, "Disable security scanning of workflow markdown content")
102+
cmd.Flags().Bool("no-security-scanner", false, "Skip security scanning of workflow markdown content")
103+
cmd.Flags().Bool("disable-security-scanner", false, "Skip security scanning of workflow markdown content")
104104
_ = cmd.Flags().MarkDeprecated("disable-security-scanner", "use --no-security-scanner instead")
105105
cmd.Flags().String("cool-down", defaultDeployCooldown, coolDownFlagUsage)
106106
cmd.Flags().String("org", "", "Deploy workflows across repositories in an organization")

pkg/cli/deploy_command_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestNewDeployCommand_RegistersCoreFlags(t *testing.T) {
6060

6161
repoFlag := cmd.Flags().Lookup("repo")
6262
require.NotNil(t, repoFlag, "expected --repo flag to be registered")
63-
assert.Contains(t, repoFlag.Usage, "required unless --org is provided")
63+
assert.Contains(t, repoFlag.Usage, "Required unless --org is provided")
6464
}
6565

6666
func TestNewDeployCommand_CoolDownFlagUsageMatchesUpdate(t *testing.T) {

pkg/cli/experiments_command.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,8 @@ type ExperimentsAnalyzeConfig struct {
8888
// NewExperimentsCommand creates the experiments command with its subcommands.
8989
func NewExperimentsCommand() *cobra.Command {
9090
cmd := &cobra.Command{
91-
Use: "experiments",
92-
Hidden: true,
93-
Short: "Explore ongoing experiments in the repository",
91+
Use: "experiments",
92+
Short: "Explore ongoing experiments in the repository",
9493
Long: `Explore ongoing experiments in the repository.
9594
9695
Experiments are tracked via git branches with the "experiments/" prefix (e.g.,

pkg/cli/experiments_command_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ func TestNewExperimentsCommand(t *testing.T) {
300300
cmd := NewExperimentsCommand()
301301
require.NotNil(t, cmd, "command should be created")
302302
assert.Equal(t, "experiments", cmd.Name(), "command name should be experiments")
303-
assert.True(t, cmd.Hidden, "experiments command should be hidden")
303+
assert.False(t, cmd.Hidden, "experiments command should be visible")
304304

305305
subCmds := cmd.Commands()
306306
subNames := make([]string, 0, len(subCmds))

pkg/cli/fix_command.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ Use --list-codemods to see all available codemods and their descriptions.
4747
If no workflows are specified, all Markdown files in .github/workflows will be processed.
4848
4949
The command will:
50-
1. Scan workflow files for deprecated fields
51-
2. Apply relevant codemods to fix issues
52-
3. Report what was changed in each file
50+
1. Scan workflow files for deprecated fields.
51+
2. Apply relevant codemods to fix issues.
52+
3. Report what was changed in each file.
5353
5454
Without --write (dry-run mode), no files are modified. With --write, the command performs
5555
all steps and additionally:
56-
4. Write updated files back to disk
57-
5. Delete deprecated .github/aw/schemas/agentic-workflow.json file if it exists
58-
6. Delete old template files from previous versions if present
59-
7. Delete old workflow-specific .agent.md files from .github/agents/ if present
56+
4. Write updated files back to disk.
57+
5. Delete deprecated .github/aw/schemas/agentic-workflow.json file if it exists.
58+
6. Delete old template files from previous versions if present.
59+
7. Delete old workflow-specific .agent.md files from .github/agents/ if present.
6060
6161
` + WorkflowIDExplanation,
6262
Example: ` ` + string(constants.CLIExtensionPrefix) + ` fix # Check all workflows (dry-run)

0 commit comments

Comments
 (0)