Skip to content

add -o json to browsers playwright execute#158

Merged
rgarcia merged 1 commit intomainfrom
hypeship/playwright-execute-json
May 6, 2026
Merged

add -o json to browsers playwright execute#158
rgarcia merged 1 commit intomainfrom
hypeship/playwright-execute-json

Conversation

@rgarcia
Copy link
Copy Markdown
Contributor

@rgarcia rgarcia commented May 6, 2026

Summary

kernel browsers playwright execute lacked the --output/-o flag that other browsers subcommands expose (create, list, get, view, update, process exec, etc.). Add it using the same pattern: -o json prints the raw API response via util.PrintPrettyJSON, anything else returns the existing pterm tabular output, and unknown values error early.

Test plan

  • make build — succeeds
  • make test — passes
  • ./bin/kernel browsers playwright execute --help shows -o, --output
  • manual: kernel browsers playwright execute <id> 'return 1' -o json returns valid JSON

Note

Low Risk
Low risk CLI change that only affects formatting/flag parsing for browsers playwright execute, with an early validation error for unsupported --output values.

Overview
Adds --output/-o to kernel browsers playwright execute to match other browsers subcommands.

When -o json is provided, the command now prints the raw Execute API response via util.PrintPrettyJSON; otherwise it keeps the existing table/stdout/stderr rendering, and invalid --output values fail fast.

Reviewed by Cursor Bugbot for commit d05c65a. Bugbot is set up for automated code reviews on this repo. Configure here.

Mirror the --output flag pattern used by other browsers commands
(create, list, get, process exec, etc.) so playwright execute can
emit raw API JSON for scripting.
@firetiger-agent
Copy link
Copy Markdown

Firetiger deploy monitoring skipped

This PR didn't match the auto-monitor filter configured on your GitHub connection:

Any PR that changes the kernel API. Monitor changes to API endpoints (packages/api/cmd/api/) and Temporal workflows (packages/api/lib/temporal) in the kernel repo

Reason: PR modifies the browsers playwright command CLI, not the kernel API endpoints (packages/api/cmd/api/) or Temporal workflows (packages/api/lib/temporal) specified in the filter.

To monitor this PR anyway, reply with @firetiger monitor this.

@rgarcia rgarcia requested a review from masnwilliams May 6, 2026 00:19
Copy link
Copy Markdown
Contributor

@masnwilliams masnwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rgarcia rgarcia merged commit c183fe9 into main May 6, 2026
7 checks passed
@rgarcia rgarcia deleted the hypeship/playwright-execute-json branch May 6, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants