Skip to content

Remove duplicate subcommand listings from help text#7518

Merged
pelikhan merged 3 commits intomainfrom
copilot/fix-mcp-command-help-text
Dec 24, 2025
Merged

Remove duplicate subcommand listings from help text#7518
pelikhan merged 3 commits intomainfrom
copilot/fix-mcp-command-help-text

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 24, 2025

The mcp, pr, and secrets commands manually listed their subcommands in the Long description, duplicating Cobra's auto-generated "Available Commands:" section.

Changes:

  • Removed manual "Available subcommands:" sections from mcp.go, pr_command.go, and secrets_command.go
  • Help text now relies solely on Cobra's auto-generated command listing

Before:

Available subcommands:
  add         Add an MCP tool to an agentic workflow
  list        List MCP servers defined in agentic workflows
  ...

Usage:
  gh mcp [command]

Available Commands:
  add         Add an MCP tool to an agentic workflow
  list        List MCP servers defined in agentic workflows
  ...

After:

Usage:
  gh mcp [command]

Available Commands:
  add         Add an MCP tool to an agentic workflow
  list        List MCP servers defined in agentic workflows
  ...

This eliminates maintenance burden and ensures subcommand lists stay synchronized when commands change.

Original prompt

This section details on the original issue you should resolve

<issue_title>[cli-consistency] MCP command help text shows incorrect subcommand descriptions</issue_title>
<issue_description>## Issue Description

Command: gh aw mcp
Type: Help text accuracy issue
Priority: High

Current Output (from pkg/cli/mcp.go lines 22-26)

Long: `Model Context Protocol (MCP) server management and inspection.

MCP enables AI workflows to connect to external tools and data sources through
standardized servers. This command provides tools for inspecting and managing
MCP server configurations in your agentic workflows.

Available subcommands:
  add         Add an MCP tool to an agentic workflow
  list        List MCP servers defined in agentic workflows
  list-tools  List available tools for a specific MCP server
  inspect     Inspect MCP servers and list available tools, resources, and roots`,

Issue

The MCP command's Long description includes a manual list of subcommands in plain text. This creates several problems:

  1. Duplication: Cobra automatically generates subcommand lists, so this is redundant
  2. Maintenance burden: If subcommands change, this text must be updated manually
  3. Inconsistency: Other commands (like pr, secrets) don't include manual subcommand lists
  4. Formatting: The indentation and alignment might not match Cobra's auto-generated format

Comparison with Other Commands

pr command (pkg/cli/pr_command.go line 41):

Long: `Pull request utilities for gh aw.

Use subcommands to perform operations on pull requests.`,

secrets command (pkg/cli/secrets_command.go line 17):

Long: `Manage repository secrets and GitHub tokens for workflows.

Use subcommands to set secrets or check token configuration.`,

These commands do not manually list their subcommands - they let Cobra handle it.

Suggested Fix

Remove the manual subcommand list and let Cobra auto-generate it:

Long: `Model Context Protocol (MCP) server management and inspection.

MCP enables AI workflows to connect to external tools and data sources through
standardized servers. This command provides tools for inspecting and managing
MCP server configurations in your agentic workflows.`,

Cobra will automatically show available subcommands when the user runs gh aw mcp --help.

Benefits

  1. ✅ Consistency with other multi-subcommand commands
  2. ✅ Auto-updates when subcommands are added/removed
  3. ✅ Standard Cobra formatting
  4. ✅ Less maintenance burden

Status: Help text needs simplification

AI generated by CLI Consistency Checker

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits December 24, 2025 15:59
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
- Remove "Available subcommands:" from mcp.go
- Remove "Available subcommands:" from pr_command.go
- Remove "Available subcommands:" from secrets_command.go

Cobra automatically generates the "Available Commands:" section, so the manual lists were redundant and created a maintenance burden.

Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incorrect subcommand descriptions in MCP command help text Remove duplicate subcommand listings from help text Dec 24, 2025
Copilot AI requested a review from mnkiefer December 24, 2025 16:11
@pelikhan pelikhan marked this pull request as ready for review December 24, 2025 16:33
@pelikhan pelikhan merged commit c04c3c3 into main Dec 24, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/fix-mcp-command-help-text branch December 24, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cli-consistency] MCP command help text shows incorrect subcommand descriptions

3 participants