Skip to content

Commit cdd8a6e

Browse files
authored
fix: resolve 5 CLI help text consistency issues (#29335)
1 parent e53aa8f commit cdd8a6e

6 files changed

Lines changed: 20 additions & 16 deletions

File tree

pkg/cli/add_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ type AddWorkflowsResult struct {
4949
func NewAddCommand(validateEngine func(string) error) *cobra.Command {
5050
cmd := &cobra.Command{
5151
Use: "add <workflow>...",
52-
Short: "Add agentic workflows from repositories to .github/workflows",
52+
Short: "Add agentic workflows from repositories or local files to .github/workflows",
5353
Long: `Add one or more agentic workflows from repositories to .github/workflows.
5454
5555
This command adds workflows directly without interactive prompts. Use 'add-wizard'

pkg/cli/add_command_test.go

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

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

3131
// Verify Args validator is set

pkg/cli/logs_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ Examples:
271271
logsCmd.Flags().String("format", "", "Output format for cross-run audit report: pretty, markdown (generates security audit report instead of default metrics table)")
272272
logsCmd.Flags().Int("last", 0, "Alias for --count: number of recent runs to download")
273273
logsCmd.Flags().StringSlice("artifacts", nil, "Artifact sets to download (default: all). Valid sets: "+strings.Join(ValidArtifactSetNames(), ", "))
274-
logsCmd.Flags().String("after", "", "Remove locally cached run folders created before this date (cache cleanup). Use deltas like -1w or -1mo, or an absolute date YYYY-MM-DD. For example, --after -1w removes folders older than 1 week.")
274+
logsCmd.Flags().String("after", "", "(Cache eviction) Delete locally cached run folders older than this cutoff date, before downloading. Use deltas like -1w or -1mo, or an absolute date YYYY-MM-DD. Note: this evicts old cache entries; it does not filter which runs are downloaded.")
275275
logsCmd.Flags().Bool("stdin", false, "Read workflow run IDs or URLs from stdin (one per line) instead of discovering runs via the GitHub API")
276276
logsCmd.MarkFlagsMutuallyExclusive("firewall", "no-firewall")
277277

pkg/cli/mcp_add.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ func NewMCPAddSubcommand() *cobra.Command {
308308

309309
cmd := &cobra.Command{
310310
Use: "add [workflow] [server]",
311-
Short: "Add an MCP tool to an agentic workflow",
312-
Long: `Add an MCP tool to an agentic workflow by searching the MCP registry.
311+
Short: "Add an MCP server to an agentic workflow",
312+
Long: `Add an MCP server to an agentic workflow by searching the MCP registry.
313313
314314
This command searches the MCP registry for the specified server, adds it to the workflow's tools section,
315-
and automatically compiles the workflow. If the tool already exists, the command will fail.
315+
and automatically compiles the workflow. If the server already exists, the command will fail.
316316
317317
When called with no arguments, it will show a list of available MCP servers from the registry.
318318
@@ -329,8 +329,8 @@ Examples:
329329
330330
The command will:
331331
- Search the MCP registry for the specified server
332-
- Check that the tool doesn't already exist in the workflow
333-
- Add the MCP tool configuration to the workflow's frontmatter
332+
- Check that the server doesn't already exist in the workflow
333+
- Add the MCP server configuration to the workflow's frontmatter
334334
- Automatically compile the workflow to generate the .lock.yml file`,
335335
Args: cobra.RangeArgs(0, 2),
336336
RunE: func(cmd *cobra.Command, args []string) error {
@@ -347,7 +347,7 @@ The command will:
347347

348348
// If only workflow ID/file is provided, show error (need both workflow and server)
349349
if len(args) == 1 {
350-
return errors.New("both workflow ID/file and server name are required to add an MCP tool\nUse 'gh aw mcp add' to list available servers")
350+
return errors.New("both workflow ID/file and server name are required to add an MCP server\nUse 'gh aw mcp add' to list available servers")
351351
}
352352

353353
// If both arguments are provided, add the MCP tool
@@ -359,7 +359,7 @@ The command will:
359359
}
360360

361361
cmd.Flags().StringVar(&registryURL, "registry", "", "MCP registry URL (default: https://api.mcp.github.com/v0.1)")
362-
cmd.Flags().StringVar(&transportType, "transport", "", "Preferred transport type (stdio, HTTP, Docker)")
362+
cmd.Flags().StringVar(&transportType, "transport", "", "Preferred transport type (stdio, http, docker)")
363363
cmd.Flags().StringVar(&customToolID, "tool-id", "", "Custom tool ID to use in the workflow (default: uses server ID)")
364364

365365
return cmd

pkg/cli/mcp_add_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,23 @@ This is a test workflow.
157157
}
158158
}
159159

160-
func TestMCPAddTransportFlagDescriptionIncludesCapitalizedHTTPAndDocker(t *testing.T) {
160+
func TestMCPAddTransportFlagDescriptionUsesLowercaseValues(t *testing.T) {
161161
cmd := NewMCPAddSubcommand()
162162
transportFlag := cmd.Flags().Lookup("transport")
163163
if transportFlag == nil {
164164
t.Fatal("expected --transport flag to exist")
165165
}
166166

167-
if !strings.Contains(transportFlag.Usage, "HTTP") {
168-
t.Fatalf("expected --transport usage to include HTTP, got: %s", transportFlag.Usage)
167+
if !strings.Contains(transportFlag.Usage, "http") {
168+
t.Fatalf("expected --transport usage to include http (lowercase), got: %s", transportFlag.Usage)
169169
}
170170

171-
if !strings.Contains(transportFlag.Usage, "Docker") {
172-
t.Fatalf("expected --transport usage to include Docker, got: %s", transportFlag.Usage)
171+
if !strings.Contains(transportFlag.Usage, "docker") {
172+
t.Fatalf("expected --transport usage to include docker (lowercase), got: %s", transportFlag.Usage)
173+
}
174+
175+
if !strings.Contains(transportFlag.Usage, "stdio") {
176+
t.Fatalf("expected --transport usage to include stdio, got: %s", transportFlag.Usage)
173177
}
174178
}
175179

pkg/cli/trial_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func NewTrialCommand(validateEngine func(string) error) *cobra.Command {
1414
Short: "Run one or more agentic workflows in trial mode against a simulated repository",
1515
Long: `Run one or more agentic workflows in trial mode as if they were running in a repository.
1616
17-
This command creates a temporary private repository in your GitHub space, installs the specified
17+
This command creates a temporary private repository in your GitHub account, installs the specified
1818
workflow(s) from their source repositories, and runs them in "trial mode" to capture safe outputs without
1919
making actual changes to the "simulated" host repository.
2020

0 commit comments

Comments
 (0)