fix(cli): name hosted-only mode instead of sending artifact to a plugin hunt - #469
Open
Agnik47 wants to merge 2 commits into
Open
fix(cli): name hosted-only mode instead of sending artifact to a plugin hunt#469Agnik47 wants to merge 2 commits into
artifact to a plugin hunt#469Agnik47 wants to merge 2 commits into
Conversation
…ugin hunt
`webcmd artifact` in local mode answered:
Site "artifact" is not installed.
Search: webcmd plugin search artifact
There is no such plugin. `artifact` is a hosted-mode builtin (hosted/runner.ts),
and shell completion offers it in both modes (completion-shared.ts), so a local
user following either signal was sent after something that cannot be installed.
Hosted mode already names the reverse case with LOCAL_ONLY_COMMAND_HELP. Add the
mirror, and answer an unknown root token that hosted mode serves with the mode
boundary and the way across it.
The hosted-only set is derived — hosted root help minus the local root registry —
so a hosted command added later is covered without editing this file. `setup` is
excluded explicitly: both modes serve it, and it is outside the local registry
only because main.ts answers it before Commander parses argv.
The exact hosted name is settled ahead of the edit-distance suggestions, since a
name that matches exactly is stronger evidence than a fuzzy guess. Unknown sites,
near misses, and the intent overrides are untouched, and the usage exit code
stays 2.
Contributor
🟢 No documentation gap found — medium confidenceThe automated review found no documentation gap in the supplied changes. This review is advisory and does not block merging. |
The Top-Level Commands table listed `artifact` beside `doctor`, `daemon`, and `web` with no mode marker, so a local reader saw it as a peer of commands local mode serves. Use the "Hosted mode only." wording the flag table already uses. Also corrects the comment added with this fix: shell completion does not offer `artifact` in local mode. `HOSTED_CLIENT_ROOT_COMMANDS` feeds only getHostedRootHelp, which is called from hosted/runner.ts, and `webcmd completion bash|zsh` emits no `artifact` entry locally. The reference table is what pointed local users at the command.
Agnik47
force-pushed
the
fix/hosted-only-command-guidance
branch
from
August 28, 2026 22:57
bbb3963 to
1247e90
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
In local mode:
There is no
artifactplugin, so that search can only waste a turn — the exact failure modecommand-suggest.tswas written to end ("telling the caller to search a plugin marketplace for a plugin that cannot exist").Cause
artifactis a hosted-mode builtin (src/hosted/runner.ts:449, and in thebuiltinCommandsset at:2134). It is never registered locally, so the token falls throughunknownRootCommandMessagetomissingPluginGuidance.What points local users at it is
docs/cli-reference.mdx: the Top-Level Commands table listedartifactbesidedoctor,daemon, andwebwith no mode marker, and thebrowser runsection gives the literalwebcmd artifact download <download-url> --output <local-path>.Hosted mode already names the mirror-image case with
LOCAL_ONLY_COMMAND_HELP. Local mode had no equivalent.Fix
HOSTED_ONLY_COMMAND_HELPmirrors the existingLOCAL_ONLY_COMMAND_HELP.isHostedOnlyRootCommandis derived — hosted root help minusWEBCMD_ROOT_COMMANDS— so a hosted command added later is covered without editing this file. Today that set is exactly{artifact}.setupis excluded explicitly. Both modes serve it; it sits outside the local registry only becausemain.ts:76answers it before Commander parses argv, which would otherwise read as hosted-only.artifact"Hosted mode only.", the wording the flag table at--workspacealready uses.Unchanged: unknown sites, near misses (
adapters→webcmd adapter), theCANONICAL_ROOTintent overrides, the installed-but-failed-to-load path, and the exit code — still2, per the envelope contract from #424/#427.Correction to an earlier revision of this description
An earlier version of this PR said shell completion advertises
artifactin both modes. That is wrong, and the code comment repeating it has been fixed.HOSTED_CLIENT_ROOT_COMMANDSfeeds onlygetHostedRootHelp, which is called fromhosted/runner.ts;webcmd completion bashandwebcmd completion zshemit noartifactentry in local mode. Completion was already correct — the docs table was not.Tests
src/command-suggest.test.ts:artifactnames the mode boundary and mentions neitherplugin searchnoris not installed;isHostedOnlyRootCommandis false for every member ofWEBCMD_ROOT_COMMANDS, and specifically forweb,browser, anddoctor— commands served in both surfaces, where a hosted-only claim would be a new lie;setupis not reported hosted-only;Verified against a built CLI:
webcmd artifactandwebcmd artifact downloadboth print the new message and exit 2;webcmd bogusstill prints the plugin guidance.npx vitest run --project unit— no new failures againstmainon this machine (25 pre-existing Windows symlink-EPERMfailures on both).npm run typecheckandnpm run check:typed-error-lintclean.