Skip to content

fix: make client-owned web fetch discoverable (#252) - #263

Open
ankitranjan7 wants to merge 1 commit into
mainfrom
fix/252-web-fetch-discoverability
Open

fix: make client-owned web fetch discoverable (#252)#263
ankitranjan7 wants to merge 1 commit into
mainfrom
fix/252-web-fetch-discoverability

Conversation

@ankitranjan7

Copy link
Copy Markdown
Contributor

Fixes #252.

webcmd web fetch always worked — it is intercepted on the fast path in src/main.ts:79 before adapter discovery — but nothing in the CLI's own surface said it existed unless you had installed the web plugin, and webcmd web fetch -h threw an ArgumentError about --url.

What changed

  • clis/web/fetch.js registers the command through a new makeWebFetchCommand() factory, so build-manifest and the runtime filesystem scan both pick it up. src/discovery.ts's module pattern now matches make<Pascal>Command(, the same convention src/build-manifest.ts:48 already used.
  • cli-manifest.json gains the generated web/fetch entry (regenerates byte-identical; check:hosted-contract passes, hosted-contract.json unchanged since the command is not browser-based).
  • The fast path stays exactly where it was — execution never touches the registry, so hosted mode still never cloud-routes this command.
  • Now that help is real, the fast path honours what it advertises: -f/--format for output (markdown remains the default), structured --help -f yaml|json, an error for an unsupported format instead of a silent table fallback, and an error for a flag-shaped --timeout/--max-chars value instead of coercing it to 1.

Verified against a rebuilt dist

Surface Before After
webcmd --help no web web under Site adapters
webcmd list absent fetch [public] … [builtin]
webcmd list -f json absent full entry with all four args
webcmd web fetch -h ArgumentError real help
webcmd --get-completions web '' empty fetch, fetch-browser

Four new tests in src/fetch/command.test.ts cover the -f output path, structured help, the format rejection, and the --timeout -5 rejection. Full suite passes except tests/e2e/plugin-management.test.ts, which clones plugins over the network and fails identically on main.

Out of scope

🤖 Generated with Claude Code

`web fetch` always worked via the main.ts fast path but was invisible to
`--help`, `list`, `cli-manifest.json`, and completions unless the `web`
plugin was installed, and `web fetch -h` threw instead of printing help.

Register the command from clis/web/fetch.js via a makeWebFetchCommand()
factory so build-manifest and filesystem discovery both see it, and keep
execution on the fast path so hosted mode never cloud-routes it.

The fast path now honours the flags its help advertises: -f/--format for
output and structured --help, an error for unsupported formats, and an
error for a flag-shaped --timeout/--max-chars value instead of coercing
it to 1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🟠 Maintainer review suggested — low confidence

The automated review could not reach a fully supported conclusion.

This review is advisory and does not block merging.

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.

webcmd web fetch is invisible to --help, list, completions, and -h despite always being available

1 participant