Uh oh!
There was an error while loading. Please reload this page.
fix(cli): accept -f/--format and --json on every command - #425
Merged
Conversation
Contributor
🟠 Maintainer review suggested — low confidenceThe automated review could not reach a fully supported conclusion. Limitations
This review is advisory and does not block merging. |
ankitranjan7force-pushed
the
fix/cli-universal-format-flags
branch
from
August 23, 2026 15:49
591d18b to
98fb65bCompareCo-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ankitranjan7force-pushed
the
fix/cli-universal-format-flags
branch
from
August 23, 2026 16:05
98fb65b to
cc20f55CompareUh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 23, 2026
Agnik47 added a commit
to Agnik47/webcmd
that referenced
this pull request
Aug 28, 2026
…gentrhq#317) `browser --help` listed its session commands and its adapter-authoring commands in one flat block, so the two unrelated surfaces read as one. Group them from the shared catalog: `tabs`, `bind`, `run`, `snapshot`, and `close` under "Browser session commands", `init` and `verify` under "Adapter authoring commands". Local and hosted help draw from the same catalog, so they stay aligned. `browser fork` is also removed here. It ran the same action as the adapter command and only existed as a hidden re-registration, which agentrhq#361 superseded; `adapter override` gains a `fork` alias so the local spelling survives. Rebased onto 0.7.10. Three upstream changes landed in the same lines and are kept: the structured-help imports from agentrhq#425/agentrhq#428, `BROWSER_RUN_HELP_TEXT`, and the `adapter override` description and hosted artifact-download paragraph. The alias is additive to that description rather than replacing it.
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 freeto 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.
-f/--formatand--jsonwere registered on roughly half the CLI's commands. An agent that learns--jsononwebcmd plugin listhitserror: unknown option '--json'onwebcmd plugin install, and has no way to predict which side of the line a command falls on. In a recent eval this cost repeated wrong guesses in 4 of 12 scenarios.What changed
ensureOutputFormatOptions(program)walks the finished Commander tree and registers-f, --format <fmt>plus--jsonon every leaf that lacks them. Namespace commands (adapter,plugin, …) are skipped — they only print help — and external-CLI passthrough is skipped so its argv still reaches the wrapped binary.plugin install/uninstall/update/create,profile create/rename/use,adapter path/override/reset,daemon stop/restart,external install/register,browser init, and thesitewrite leaves (note add,endpoint set/stale,field-map add,fixture put,sample add). Shape is a small{ ok, action, … }envelope, consistent across similar commands. Without a flag the human output is byte-identical.browser tabs/bind/close/snapshot/runroute their result through the shared renderer withjsonas the default format, so-f yamlworks and today's JSON bytes are unchanged.browser rungains-f/--formatalongside the--jsonit already had.configureCompletionCommandSurfaceand the plugin install/uninstall/update surfaces gained the flag directly, so hosted mode inherits the same grammar as local — hosted help and structural-error parity tests cover this.webcmd skills add/update/removekeep their existing--jsonenvelope and now also honour-f json.Before / After
Before, on
origin/main:After:
Tests
src/cli-format-contract.test.tswalks the whole Commander tree and asserts every non-namespace, non-passthrough command exposes-f,--formatand--json, so a command added later cannot regress the contract. A second case assertsadapter pathprints the bare path by default and the{ ok, command, path }envelope under--json.src/site-memory/commands.test.tsadds equivalent default-silent / structured-under---jsoncoverage for three write leaves.npm run typecheckclean.npx vitest run --project unit: 2707 passed, 2 failed — both insrc/browser/run/playwright-client-build.test.ts, which cannot readnode_modules/playwright-corethrough this worktree's symlink; the same file passes in a normal checkout and is untouched by this change.🤖 Generated with Claude Code