Skip to content

[CLI]: --json emits formatted text wrapped in a string, not structured data #42076

Description

--json wraps the human-readable output in a string rather than emitting structured data, so scripting still means parsing prose.

playwright-cli --json find "Research Scientist" returns:

{
  "result": "Found 1 match for \"Research Scientist\":\n\n- generic [ref=e2]:\n  - generic [ref=e8]:\n    - link [ref=e73] [cursor=pointer]:\n      - /url: /pangramlabs/64baa007...\n      - heading \"AI Research Scientist (NLP)\" [level=3] [ref=e75]"
}

The refs, roles, names and urls are all in there, but only as formatted text. Consuming it needs a parser for the indentation format, which defeats the point of the flag.

Emitting the node tree instead — role, name, ref, url, children — would make the CLI usable from scripts without a parser. Version 0.1.17.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions