Skip to content

fix(cli): complete servers/add|edit|remove and --output-format values - #2634

Merged
cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2629-completion-catalog-methods
Oct 7, 2026
Merged

cliffhall merged 1 commit into
v2/mainfrom
v2/fix/2629-completion-catalog-methods

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Closes #2629

Found by the 2.10.0 release smoke (#2623).

What changed

--completion (#2434) offered --method values from a hard-coded CATALOG_METHODS of servers/list and servers/show, so the catalog writes added in the same milestone (#2433) never completed. --output-format (#2431) offered no values at all.

  • CATALOG_METHODS now spreads CATALOG_WRITE_METHODS from handlers/servers-write.ts. parseArgs validates --method against the same list (isCatalogMethod), so completion and validation share one source. The "Unsupported method" message lists the same methods in the same order as before.
  • --output-format completes from OUTPUT_FILE_FORMATS (raw, json). The existing drift guard already runs every stated choice through the real option parser, so this value set is checked too.
  • New tests read the write methods from servers-write, not from the completion list. The old test compared the list with itself, which is how the gap shipped. Another new test checks that no offered --method is rejected as unsupported, with a bogus-method control. The bash shell test now covers --method servers/ and --output-format .

Verification

  • Mutation: with the two additions reverted, 2 of the completion tests fail. With them restored, 22 pass and 2 are skipped (the fish tests; fish is not installed).
  • Drove the built bin, sourcing the generated bash script in bash 3.2:
    • before (2.10.0 release tree): --method servers/ gives servers/list servers/show, and --output-format gives nothing
    • after: servers/list servers/show servers/add servers/edit servers/remove, and raw json
  • npm run local:gate: every stage passes (CLI 583 + 2 skipped, DCO 1/1, smoke:mcpdo passed) except smoke:web:firefox, which cannot launch Playwright's Firefox on macOS 27 (smoke:web:firefox cannot launch Playwright's Firefox on macOS 27 #2625). CI does not run the Firefox pass, and this diff is CLI-only. local:storybook was run separately and passed 529.

🤖 Generated with Claude Code

…tput-format values (#2629)

--completion (#2434) offered --method values from a hard-coded
CATALOG_METHODS of servers/list and servers/show, so the catalog writes
added in the same milestone (#2433) were never completed, and
--output-format (#2431) offered no values at all.

CATALOG_METHODS now spreads CATALOG_WRITE_METHODS from servers-write,
and parseArgs validates --method against that same list, so completion
and validation share one source. --output-format completes from
OUTPUT_FILE_FORMATS. New tests read the write methods from servers-write
rather than from the completion list (the old test compared the list to
itself, which is how the gap shipped), and check no offered --method is
rejected as unsupported.

Found by the 2.10.0 release smoke (#2623).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: cliffhall <cliff@futurescale.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused implementation satisfies the linked issue and includes appropriate drift and shell-completion coverage.

0 open findings

What changed in this PR

Completes CLI shell suggestions for catalog write methods and output formats while sharing validation constants.

Changes:

  • Adds servers/add, servers/edit, and servers/remove completions.
  • Adds raw and json output-format completions.
  • Adds parser and Bash completion regression tests.
File Description
clients/​cli/​src/​completion.ts Defines shared catalog methods and output-format choices.
clients/​cli/​src/​cli.ts Reuses shared catalog validation and error-list generation.
clients/​cli/​__tests__/​completion.test.ts Covers write-method and output-format completions.

🧠 Review effort: Balanced


💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@cliffhall

Copy link
Copy Markdown
Member Author

Copilot review loop closed: round 1 was clean (0 findings — no inline comments, nothing in the headline or a suppressed block), so no further round was requested.

@cliffhall
cliffhall merged commit 617532f into v2/main Oct 7, 2026
8 checks passed
@cliffhall
cliffhall deleted the v2/fix/2629-completion-catalog-methods branch October 7, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Issues and PRs for v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI shell completion omits servers/add, servers/edit, servers/remove and --output-format values

2 participants