add -o json to browsers playwright execute#158
Merged
Conversation
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 deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
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 |
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.
Summary
kernel browsers playwright executelacked the--output/-oflag that otherbrowserssubcommands expose (create,list,get,view,update,process exec, etc.). Add it using the same pattern:-o jsonprints the raw API response viautil.PrintPrettyJSON, anything else returns the existing pterm tabular output, and unknown values error early.Test plan
make build— succeedsmake test— passes./bin/kernel browsers playwright execute --helpshows-o, --outputkernel browsers playwright execute <id> 'return 1' -o jsonreturns valid JSONNote
Low Risk
Low risk CLI change that only affects formatting/flag parsing for
browsers playwright execute, with an early validation error for unsupported--outputvalues.Overview
Adds
--output/-otokernel browsers playwright executeto match otherbrowserssubcommands.When
-o jsonis provided, the command now prints the rawExecuteAPI response viautil.PrintPrettyJSON; otherwise it keeps the existing table/stdout/stderr rendering, and invalid--outputvalues fail fast.Reviewed by Cursor Bugbot for commit d05c65a. Bugbot is set up for automated code reviews on this repo. Configure here.