Skip to content

Add structured output to data-returning built-in commands #175

Closed

Description

@rishabhraj36

Parent: #171

Problem

Several read/report commands return stable data internally but reject -f/--format and print hand-written text or hard-coded JSON.

Verified local examples all fail with error: unknown option '-f':

  • webcmd validate -f json
  • webcmd profile list -f json
  • webcmd daemon status -f json
  • webcmd adapter status -f json
  • webcmd browser <session> state -f json

Scope

Add shared formatting where a command has a stable result object, row set, or validation report:

  • validate
  • verify
  • doctor
  • bare skills (or make it a true alias of skills list)
  • adapter status
  • local profile list (align with hosted profile-list formatting)
  • daemon status
  • browser verify
  • non-streaming browser reads: tab list, state, frames, console, analyze, find, get title, get url, get text, get value, get attributes, eval, extract, and network

Deliberate exclusions

Do not add generic formatting to mutation acknowledgements, screenshot/file output, get html (already has --as), JSONL follow modes, mixed-mode browser wait, generators, completion/version, long-running servers, or external passthrough commands.

Acceptance criteria

  • Selected commands render through the shared output path.
  • Local and hosted profile-list formats align.
  • Browser streams and binary/file behavior remain unchanged.
  • Side-effect commands do not gain formatting merely for symmetry.
  • Tests cover at least JSON and YAML for each new command family.

Activity

  1. Agnik47 commented on Aug 3, 2026

    @Agnik47
    Contributor

    Can I work on this?

  2. rishabhraj36 commented on Aug 4, 2026

    @rishabhraj36
    CollaboratorAuthor

    #190 Somebody has already worked on this issue, you can pick something else

  3. Agnik47 commented on Aug 18, 2026

    @Agnik47
    Contributor

    Opened #351 for browser verify, the last unclaimed item in this scope. While working through the rest of the list I hit something worth raising here.

    The "non-streaming browser reads" bullet no longer maps to live commands.

    That bullet lists tab list, state, frames, console, analyze, find, get title|url|text|value|attributes, eval, extract, and network. None of those exist as local CLI subcommands today. They survive in exactly two places:

    • src/cli-argv-preprocess.ts — BROWSER_SUBCOMMAND_NAMES, the set used to reject the retired positional-session grammar
    • src/hosted/types.ts — HostedBrowserActionName, internal hosted protocol action names

    The local raw-browser surface was consolidated into tabs, bind, run, snapshot, and close — docs/cli-reference.mdx states this directly ("The public raw-browser surface is tabs, bind, run, and snapshot"). Those reads are now expressed as Playwright programs through browser run, or through browser snapshot.

    And all five of those commands already dispatch through rawBrowserAction in src/cli.ts, which does:

    console.log(JSON.stringify(result, null, 2));

    So they emit JSON unconditionally. There is no prose rendering to add a format flag to — adding -f/--format there would mean introducing a table mode that does not exist, which reads like the opposite of this issue's intent.

    Where that leaves the scope. Of the original list:

    Item State
    validate, verify, doctor, bare skills, adapter status, daemon status #306
    profile list done — #341
    browser verify #351
    non-streaming browser reads no longer applicable, per above

    Which I think makes this issue closeable once #306 and #351 land, rather than needing a phase 2. Flagging rather than assuming, though — if the intent behind that bullet was "browser run/snapshot output should be formattable, not just JSON" (e.g. -f yaml for a snapshot), that is a real and different feature and I am happy to open a separate issue for it. Just want a maintainer call before anything gets closed on my read of it.

  4. ankitranjan7 commented on Aug 24, 2026

    @ankitranjan7
    Contributor

    Verified fixed on main — closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions