Skip to content

Commit 53e2554

Browse files
committed
docs: expand browser cli reference
1 parent 5c685ee commit 53e2554

1 file changed

Lines changed: 74 additions & 2 deletions

File tree

docs/cli/browser.md

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
summary: "CLI reference for `openclaw browser` (profiles, tabs, actions, Chrome MCP, and CDP)"
2+
summary: "CLI reference for `openclaw browser` (lifecycle, profiles, tabs, actions, state, and debugging)"
33
read_when:
44
- You use `openclaw browser` and want examples for common tasks
55
- You want to control a browser running on another machine via a node host
@@ -9,7 +9,7 @@ title: "browser"
99

1010
# `openclaw browser`
1111

12-
Manage OpenClaws browser control server and run browser actions (tabs, snapshots, screenshots, navigation, clicks, typing).
12+
Manage OpenClaw's browser control surface and run browser actions (lifecycle, profiles, tabs, snapshots, screenshots, navigation, input, state emulation, and debugging).
1313

1414
Related:
1515

@@ -20,6 +20,7 @@ Related:
2020
- `--url <gatewayWsUrl>`: Gateway WebSocket URL (defaults to config).
2121
- `--token <token>`: Gateway token (if required).
2222
- `--timeout <ms>`: request timeout (ms).
23+
- `--expect-final`: wait for a final Gateway response.
2324
- `--browser-profile <name>`: choose a browser profile (default from config).
2425
- `--json`: machine-readable output (where supported).
2526

@@ -32,6 +33,15 @@ openclaw browser --browser-profile openclaw open https://example.com
3233
openclaw browser --browser-profile openclaw snapshot
3334
```
3435

36+
## Lifecycle
37+
38+
```bash
39+
openclaw browser status
40+
openclaw browser start
41+
openclaw browser stop
42+
openclaw browser --browser-profile openclaw reset-profile
43+
```
44+
3545
## If the command is missing
3646

3747
If `openclaw browser` is an unknown command, check `plugins.allow` in
@@ -65,6 +75,7 @@ Profiles are named browser routing configs. In practice:
6575
openclaw browser profiles
6676
openclaw browser create-profile --name work --color "#FF5A36"
6777
openclaw browser create-profile --name chrome-live --driver existing-session
78+
openclaw browser create-profile --name remote --cdp-url https://browser-host.example.com
6879
openclaw browser delete-profile --name work
6980
```
7081

@@ -78,6 +89,9 @@ openclaw browser --browser-profile work tabs
7889

7990
```bash
8091
openclaw browser tabs
92+
openclaw browser tab new
93+
openclaw browser tab select 2
94+
openclaw browser tab close 2
8195
openclaw browser open https://docs.openclaw.ai
8296
openclaw browser focus <targetId>
8397
openclaw browser close <targetId>
@@ -103,6 +117,64 @@ Navigate/click/type (ref-based UI automation):
103117
openclaw browser navigate https://example.com
104118
openclaw browser click <ref>
105119
openclaw browser type <ref> "hello"
120+
openclaw browser press Enter
121+
openclaw browser hover <ref>
122+
openclaw browser scrollintoview <ref>
123+
openclaw browser drag <startRef> <endRef>
124+
openclaw browser select <ref> OptionA OptionB
125+
openclaw browser fill --fields '[{"ref":"1","value":"Ada"}]'
126+
openclaw browser wait --text "Done"
127+
openclaw browser evaluate --fn '(el) => el.textContent' --ref <ref>
128+
```
129+
130+
File + dialog helpers:
131+
132+
```bash
133+
openclaw browser upload /tmp/openclaw/uploads/file.pdf --ref <ref>
134+
openclaw browser waitfordownload
135+
openclaw browser download <ref> report.pdf
136+
openclaw browser dialog --accept
137+
```
138+
139+
## State and storage
140+
141+
Viewport + emulation:
142+
143+
```bash
144+
openclaw browser resize 1280 720
145+
openclaw browser set viewport 1280 720
146+
openclaw browser set offline on
147+
openclaw browser set media dark
148+
openclaw browser set timezone Europe/London
149+
openclaw browser set locale en-GB
150+
openclaw browser set geo 51.5074 -0.1278 --accuracy 25
151+
openclaw browser set device "iPhone 14"
152+
openclaw browser set headers '{"x-test":"1"}'
153+
openclaw browser set credentials myuser mypass
154+
```
155+
156+
Cookies + storage:
157+
158+
```bash
159+
openclaw browser cookies
160+
openclaw browser cookies set session abc123 --url https://example.com
161+
openclaw browser cookies clear
162+
openclaw browser storage local get
163+
openclaw browser storage local set token abc123
164+
openclaw browser storage session clear
165+
```
166+
167+
## Debugging
168+
169+
```bash
170+
openclaw browser console --level error
171+
openclaw browser pdf
172+
openclaw browser responsebody "**/api"
173+
openclaw browser highlight <ref>
174+
openclaw browser errors --clear
175+
openclaw browser requests --filter api
176+
openclaw browser trace start
177+
openclaw browser trace stop --out trace.zip
106178
```
107179
108180
## Existing Chrome via MCP

0 commit comments

Comments
 (0)