Skip to content

Commit 5459a94

Browse files
docs(browser): clarify JSON flag placement (#103155)
* docs(browser): clarify JSON flag placement * docs(browser): align JSON flag examples --------- Co-authored-by: Peter Steinberger <[email protected]>
1 parent f6d11d0 commit 5459a94

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

docs/cli/browser.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ Related: [Browser tool](/tools/browser)
2020
- `--timeout <ms>`: request timeout in ms (default: `30000`).
2121
- `--expect-final`: wait for a final Gateway response.
2222
- `--browser-profile <name>`: choose a browser profile (default: `openclaw`, or `browser.defaultProfile`).
23-
- `--json`: machine-readable output (where supported).
23+
- `--json`: machine-readable output (where supported). This is a browser-level option, so
24+
place it before the subcommand for an unambiguous form, such as
25+
`openclaw browser --json status`. Trailing placement such as
26+
`openclaw browser status --json` also works when the selected child command does not
27+
define its own `--json`.
2428

2529
## Quick start (local)
2630

@@ -64,7 +68,7 @@ openclaw browser --browser-profile openclaw reset-profile
6468
- For a running local managed profile, `status` and `doctor` report cached
6569
graphics diagnostics from Chrome: hardware/software classification, renderer,
6670
backend, device/driver, feature and disabled-status details, and accelerated
67-
video capabilities. `status --json` returns the full structured payload.
71+
video capabilities. `openclaw browser --json status` returns the full structured payload.
6872
Passive status never launches Chrome just to collect these facts.
6973
- `stop` closes the active control session and clears temporary emulation overrides even for `attachOnly` and remote CDP profiles where OpenClaw did not launch the browser process itself. For local managed profiles, `stop` also stops the spawned browser process.
7074
- `start --headless` applies only to that start request, and only when OpenClaw launches a local managed browser. It does not rewrite `browser.headless` or profile config, and is a no-op for an already-running browser.

docs/tools/browser-control.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,10 @@ When an action fails (e.g. "not visible", "strict mode violation", "covered"):
389389
Examples:
390390
391391
```bash
392-
openclaw browser status --json
393-
openclaw browser snapshot --interactive --json
394-
openclaw browser requests --filter api --json
395-
openclaw browser cookies --json
392+
openclaw browser --json status
393+
openclaw browser --json snapshot --interactive
394+
openclaw browser --json requests --filter api
395+
openclaw browser --json cookies
396396
```
397397
398398
Role snapshots in JSON include `refs` plus a small `stats` block (lines/chars/refs/interactive) so tools can reason about payload size and density.

docs/tools/browser.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,10 @@ main model can read the screenshot directly.
312312
browser processes.
313313
- On Linux hosts without `DISPLAY` or `WAYLAND_DISPLAY`, local managed profiles
314314
default to headless automatically when neither the environment nor profile/global
315-
config explicitly chooses headed mode. `openclaw browser status --json`
316-
reports `headlessSource` as `env`, `profile`, `config`,
315+
config explicitly chooses headed mode. Use the unambiguous browser-level form
316+
`openclaw browser --json status`; trailing `openclaw browser status --json`
317+
also works because `status` does not define its own `--json`. The command reports
318+
`headlessSource` as `env`, `profile`, `config`,
317319
`request`, `linux-display-fallback`, or `default`.
318320
- `OPENCLAW_BROWSER_HEADLESS=1` forces local managed launches headless for the
319321
current process. `OPENCLAW_BROWSER_HEADLESS=0` forces headed mode for ordinary
@@ -328,7 +330,7 @@ main model can read the screenshot directly.
328330
browser-level CDP endpoint for renderer, backend, device/driver, feature
329331
status, driver workarounds, and accelerated video capabilities. The result is
330332
cached for that browser process and exposed in full by
331-
`openclaw browser status --json`. A passive status call does not launch Chrome.
333+
`openclaw browser --json status`. A passive status call does not launch Chrome.
332334
Existing-session, extension, remote CDP, and sandbox browsers remain separate
333335
and are not inspected through this managed-host path.
334336
- Headless managed Chrome still uses the conservative `--disable-gpu` default.

0 commit comments

Comments
 (0)