fix(cli): group the browser command surface and drop help-list noise - #319
Open
Agnik47 wants to merge 1 commit into
Open
fix(cli): group the browser command surface and drop help-list noise#319Agnik47 wants to merge 1 commit into
Agnik47 wants to merge 1 commit into
Conversation
…gentrhq#317) `webcmd browser --help` listed eight subcommands as one flat block plus Commander's auto `help [command]`, so the adapter authoring commands (`init`, `fork`, `verify`) read as unrelated noise next to the raw session surface the namespace is named for. - Group browser subcommands under "Browser session commands:" and "Adapter authoring commands:", driven by a shared helper in the browser command catalog so local and hosted help agree. The catalog itself and the hosted wire contract are unchanged. - Register the authoring commands after the session ones so help leads with `tabs`, `bind`, `run`, `snapshot`, and `close`. - Hide `browser fork` from local help. It copies a plugin command into ~/.webcmd/clis and never touches a Session, which is what `webcmd adapter override` already does; that command now carries a `fork` alias, so `webcmd adapter fork` is the local spelling. `webcmd browser fork` stays registered and dispatchable, and hosted help still lists it because hosted mode has no `adapter fork`. - Stop advertising Commander's auto `help [command]` in namespace help. The root presentation already omitted it; `webcmd <namespace> help <command>` keeps working.
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. |
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.
Fixes #317.
Problem
webcmd browser --helpprinted one flat list mixing two unrelated surfaces, plus Commander's autohelp [command]a line below the-h, --helpoption that does the same thing:docs/cli-reference.mdxalready states that "the public raw-browser surface istabs,bind,run, andsnapshot", but the help output gaveinit/fork/verifyequal billing with no indication they are adapter-authoring commands.After
Changes
Browser session commands:/Adapter authoring commands:. The mapping lives next tobrowserCommandCatalogand is consumed by bothcli.tsandhosted/browser-args.ts, so local and hostedbrowser --helppresent the same shape. The catalog entries andhosted-contract.jsonare untouched.init/fork/verifyare now attached after the session commands (vianew Command(...)+addCommand, matching howtabs/bind/run/snapshot/closewere already registered), so the group the namespace is named for comes first. Leaf help and error text for these commands is byte-identical to before.fork. It copies a plugin command into~/.webcmd/clisand never touches a Session — exactly whatwebcmd adapter overridedoes.adapter overridegains aforkalias, sowebcmd adapter fork <site>/<command>is the local spelling, andbrowser forkis hidden from local help while staying registered and dispatchable. Hosted help still lists it, since hosted mode has noadapter fork.help [command]. Namespace help no longer advertises Commander's auto help command; the root presentation already omitted it.webcmd <namespace> help <command>still works — it is only dropped from the listed commands. This applies to every namespace (browser,adapter,plugin,profile,daemon,auth,session, ...).Not included
initandverifyare grouped, not relocated. Moving them towebcmd adapter init|verifywould be a breaking surface change: they are the documented cloud authoring flow (hosted/runner.tsprintswebcmd browser init/webcmd browser verifyafterplugin create), they are referenced throughout the bundled skills (webcmd-adapter-author,webcmd-usage,webcmd-autofix), and they are part of the hosted browser contract. Happy to do that relocation in a follow-up if you'd like it — it needs a call on hosted routing and a skills/docs sweep.Verification
npx tsc --noEmitclean.npx vitest run --project unit: no new failures. The 20 remaining failures on this branch are pre-existing onmainin this environment (WindowsEPERMonsymlinkinplugin/discovery/site-memory/docs-sync-reviewtests, plus one hosted file-upload test).src/browser/command-catalog.test.ts(group mapping, group order,forkhidden but registered,adapter override|forkalias) andsrc/help.test.ts(visibleChildCommands/hideAutoHelpCommands, including thathelp <command>still dispatches).src/hosted/runner.test.ts"matches the exact local text help for every raw-session browser leaf" still passes, so local and hosted leaf help remain byte-identical.npm run check:typed-error-lintandnpm run check:silent-column-dropreport no new violations.