Skip to content

Commit eb1651d

Browse files
BagToadCopilot
andcommitted
List supported agent names and IDs in help text
Replace the self-referencing "run --help" sentence with an inline list of all supported --agent values showing Name (id) pairs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4de51b5 commit eb1651d

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

internal/skills/registry/registry.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,15 @@ func AgentIDs() []string {
342342
return ids
343343
}
344344

345+
// AgentHelpList returns a newline-separated bulleted list of agents for help text.
346+
func AgentHelpList() string {
347+
lines := make([]string, len(Agents))
348+
for i, h := range Agents {
349+
lines[i] = fmt.Sprintf(" - %s (%s)", h.Name, h.ID)
350+
}
351+
return strings.Join(lines, "\n")
352+
}
353+
345354
// AgentNames returns the display names of all agents for prompting.
346355
func AgentNames() []string {
347356
names := make([]string, len(Agents))

pkg/cmd/skills/install/install.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ func NewCmdInstall(f *cmdutil.Factory, telemetry ghtelemetry.CommandRecorder, ru
8383
scope (in your home directory, available everywhere).
8484
8585
A wide range of AI coding agents are supported, including GitHub
86-
Copilot, Claude Code, Cursor, Codex, Gemini CLI, Antigravity, Amp,
87-
Goose, Junie, OpenCode, Windsurf, and many more.
88-
Run %[1]sgh skill install --help%[1]s to see the full list of
89-
supported %[1]s--agent%[1]s values, or select interactively.
86+
Copilot, Claude Code, Cursor, Codex, Gemini CLI, Antigravity, Amp,
87+
Goose, Junie, OpenCode, Windsurf, and many more.
88+
89+
Supported %[1]s--agent%[1]s values:
90+
91+
%[2]s
9092
9193
Use %[1]s--agent%[1]s and %[1]s--scope%[1]s to control placement, or %[1]s--dir%[1]s for a
9294
custom directory. The default scope is %[1]sproject%[1]s, and the default
@@ -131,7 +133,7 @@ func NewCmdInstall(f *cmdutil.Factory, telemetry ghtelemetry.CommandRecorder, ru
131133
When run interactively, the command prompts for any missing arguments.
132134
When run non-interactively, %[1]srepository%[1]s and a skill name are
133135
required.
134-
`, "`"),
136+
`, "`", registry.AgentHelpList()),
135137
Example: heredoc.Doc(`
136138
# Interactive: choose repo, skill, and agent
137139
$ gh skill install
@@ -196,7 +198,8 @@ func NewCmdInstall(f *cmdutil.Factory, telemetry ghtelemetry.CommandRecorder, ru
196198
},
197199
}
198200

199-
cmdutil.StringEnumFlag(cmd, &opts.Agent, "agent", "", "", registry.AgentIDs(), "Target agent")
201+
agentFlag := cmdutil.StringEnumFlag(cmd, &opts.Agent, "agent", "", "", registry.AgentIDs(), "Target agent")
202+
agentFlag.Usage = "Target agent (see supported values above)"
200203
cmdutil.StringEnumFlag(cmd, &opts.Scope, "scope", "", "project", []string{"project", "user"}, "Installation scope")
201204
cmd.Flags().StringVar(&opts.Pin, "pin", "", "Pin to a specific git tag or commit SHA")
202205
cmd.Flags().StringVar(&opts.Dir, "dir", "", "Install to a custom directory (overrides --agent and --scope)")

0 commit comments

Comments
 (0)