-
Notifications
You must be signed in to change notification settings - Fork 441
[cli-consistency] Normalize CLI help text and setup docs across run/upgrade/secrets/mcp-server #26515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cli-consistency] Normalize CLI help text and setup docs across run/upgrade/secrets/mcp-server #26515
Changes from all commits
b676f68
f9f1777
89793c0
36970af
b028adc
bf8118b
4d63ba4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| //go:build !integration | ||
|
|
||
| package main | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| func TestRunCommandHelpTextConsistency(t *testing.T) { | ||
| assert.Contains(t, runCmd.Long, "this command enters interactive mode and shows", "run command interactive mode text should be explicit") | ||
|
|
||
| runApprove := runCmd.Flags().Lookup("approve") | ||
| compileApprove := compileCmd.Flags().Lookup("approve") | ||
| require.NotNil(t, runApprove, "run command should define --approve") | ||
| require.NotNil(t, compileApprove, "compile command should define --approve") | ||
| assert.Equal(t, compileApprove.Usage, runApprove.Usage, "run and compile should share the same --approve description") | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -361,7 +361,7 @@ Registry URL defaults to: https://api.mcp.github.com/v0.1`, | |
| } | ||
|
|
||
| cmd.Flags().StringVar(®istryURL, "registry", "", "MCP registry URL (default: https://api.mcp.github.com/v0.1)") | ||
| cmd.Flags().StringVar(&transportType, "transport", "", "Preferred transport type (stdio, http, docker)") | ||
| cmd.Flags().StringVar(&transportType, "transport", "", "Preferred transport type (stdio, http, Docker)") | ||
| cmd.Flags().StringVar(&customToolID, "tool-id", "", "Custom tool ID to use in the workflow (default: uses server ID)") | ||
|
Comment on lines
363
to
365
|
||
|
|
||
| return cmd | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,6 +157,18 @@ This is a test workflow. | |
| } | ||
| } | ||
|
|
||
| func TestMCPAddTransportFlagDescriptionUsesDockerCapitalization(t *testing.T) { | ||
| cmd := NewMCPAddSubcommand() | ||
| transportFlag := cmd.Flags().Lookup("transport") | ||
| if transportFlag == nil { | ||
| t.Fatal("expected --transport flag to exist") | ||
| } | ||
|
|
||
| if !strings.Contains(transportFlag.Usage, "Docker") { | ||
| t.Fatalf("expected --transport usage to include Docker, got: %s", transportFlag.Usage) | ||
| } | ||
|
Comment on lines
+160
to
+169
|
||
| } | ||
|
|
||
| func TestAddMCPTool_WorkflowNotFound(t *testing.T) { | ||
| // Create a temporary directory for testing | ||
| tempDir, err := os.MkdirTemp("", "gh-aw-test-*") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ Examples: | |
| } | ||
|
|
||
| cmd.Flags().BoolVar(&nonInteractiveFlag, "non-interactive", false, "Check secrets without prompting (display-only mode)") | ||
| cmd.Flags().StringVarP(&engineFlag, "engine", "e", "", "Check tokens for specific engine (copilot, claude, codex)") | ||
| cmd.Flags().StringVarP(&engineFlag, "engine", "e", "", "Check tokens for specific engine (copilot, claude, codex, gemini)") | ||
| addRepoFlag(cmd) | ||
|
Comment on lines
42
to
44
|
||
|
|
||
| return cmd | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ func NewUpgradeCommand() *cobra.Command { | |
| cmd := &cobra.Command{ | ||
| Use: "upgrade", | ||
| Short: "Upgrade repository with latest agent files and apply codemods to all workflows", | ||
| Long: `Upgrade the repository for the latest version of agentic workflows. | ||
| Long: `Upgrade the repository to the latest version of agentic workflows. | ||
|
|
||
| This command: | ||
| 1. Updates the dispatcher agent file to the latest template (like 'init' command) | ||
|
|
@@ -111,7 +111,7 @@ Examples: | |
| cmd.Flags().Bool("pr", false, "Alias for --create-pull-request") | ||
| _ = cmd.Flags().MarkHidden("pr") // Hide the short alias from help output | ||
| cmd.Flags().Bool("audit", false, "Check dependency health without performing upgrades") | ||
| cmd.Flags().Bool("approve", false, "Approve all safe update changes during compilation (skip safe update enforcement)") | ||
| cmd.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") | ||
| cmd.Flags().Bool("skip-extension-upgrade", false, "Skip automatic extension upgrade (used internally to prevent recursion after upgrade)") | ||
|
Comment on lines
113
to
115
|
||
| _ = cmd.Flags().MarkHidden("skip-extension-upgrade") | ||
| addJSONFlag(cmd) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| //go:build !integration | ||
|
|
||
| package cli | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/assert" | ||
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| func TestUpgradeCommandHelpTextConsistency(t *testing.T) { | ||
| cmd := NewUpgradeCommand() | ||
| require.NotNil(t, cmd, "upgrade command should be created") | ||
|
|
||
| assert.Contains(t, cmd.Long, "Upgrade the repository to the latest version of agentic workflows.", "long description should use correct grammar") | ||
|
|
||
| approveFlag := cmd.Flags().Lookup("approve") | ||
| require.NotNil(t, approveFlag, "--approve flag should exist") | ||
| assert.Contains(t, approveFlag.Usage, "When strict mode is active", "--approve description should match compile semantics") | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --approve usage string is duplicated verbatim across multiple commands (compile/run here, and upgrade in pkg/cli). To reduce future drift (and make the new consistency tests less brittle), consider extracting this text into a shared constant/helper and reusing it for all --approve flags.