Commit c183fe9
authored
add -o json to browsers playwright execute (#158)
## 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
- [x] `make build` — succeeds
- [x] `make test` — passes
- [x] `./bin/kernel browsers playwright execute --help` shows `-o,
--output`
- [ ] manual: `kernel browsers playwright execute <id> 'return 1' -o
json` returns valid JSON
<!-- CURSOR_SUMMARY -->
---
> [!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.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
d05c65a. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: rgarcia <72655+rgarcia@users.noreply.github.com>1 parent 55a2b93 commit c183fe9
1 file changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1326 | 1326 | | |
1327 | 1327 | | |
1328 | 1328 | | |
| 1329 | + | |
1329 | 1330 | | |
1330 | 1331 | | |
1331 | 1332 | | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
1332 | 1337 | | |
1333 | 1338 | | |
1334 | 1339 | | |
| |||
1346 | 1351 | | |
1347 | 1352 | | |
1348 | 1353 | | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
1349 | 1358 | | |
1350 | 1359 | | |
1351 | 1360 | | |
| |||
2498 | 2507 | | |
2499 | 2508 | | |
2500 | 2509 | | |
| 2510 | + | |
2501 | 2511 | | |
2502 | 2512 | | |
2503 | 2513 | | |
| |||
2954 | 2964 | | |
2955 | 2965 | | |
2956 | 2966 | | |
| 2967 | + | |
2957 | 2968 | | |
2958 | | - | |
| 2969 | + | |
2959 | 2970 | | |
2960 | 2971 | | |
2961 | 2972 | | |
| |||
0 commit comments