Automate Browser Tasks with OpenClaw CLI
Ever tried to automate a browser task only to get stuck setting up drivers or managing profiles? It is usually a headache to switch between local sessions and remote servers. The openclaw browser command handles the heavy lifting for you, whether you are taking screenshots or clicking through a UI.
You can use this command to manage OpenClaw’s browser control server and run actions like opening tabs, taking snapshots, and navigating pages.
Related:
- Browser tool + API: Browser tool
Common flags
Section titled “Common flags”When you run these commands, you have a few standard flags to control the connection and behavior:
--url <gatewayWsUrl>: Gateway WebSocket URL (defaults to config).--token <token>: Gateway token (if required).--timeout <ms>: request timeout (ms).--browser-profile <name>: choose a browser profile (default from config).--json: machine-readable output (where supported).
Quick start (local)
Section titled “Quick start (local)”If you want to get moving quickly on your local machine, these commands will show you the available profiles, start the browser, and perform basic actions:
openclaw browser profilesopenclaw browser --browser-profile openclaw startopenclaw browser --browser-profile openclaw open https://example.comopenclaw browser --browser-profile openclaw snapshotIf the command is missing
Section titled “If the command is missing”If you see an error saying openclaw browser is an unknown command, you should check the plugins.allow section in your ~/.openclaw/openclaw.json file.
When you use an allowlist for plugins, you must list the browser plugin explicitly:
{ plugins: { allow: ["telegram", "browser"], },}Keep in mind that setting browser.enabled=true will not bring back the CLI subcommand if the plugin allowlist excludes browser.
Related: Browser tool
Profiles
Section titled “Profiles”Profiles are named configurations for how you route browser traffic. You will likely use these three types:
openclaw: This starts or connects to a dedicated Chrome instance managed by OpenClaw with its own isolated data.user: This controls your actual, signed-in Chrome session through the Chrome DevTools MCP.- custom CDP profiles: These point to a specific local or remote CDP endpoint.
openclaw browser profilesopenclaw browser create-profile --name work --color "#FF5A36"openclaw browser create-profile --name chrome-live --driver existing-sessionopenclaw browser delete-profile --name workTo run a command using a specific profile, use the --browser-profile flag:
openclaw browser --browser-profile work tabsManaging your open tabs is straightforward with these commands:
openclaw browser tabsopenclaw browser open https://docs.openclaw.aiopenclaw browser focus <targetId>openclaw browser close <targetId>Snapshot / screenshot / actions
Section titled “Snapshot / screenshot / actions”You can capture the state of a page or interact with elements using reference-based automation.
Snapshot:
openclaw browser snapshotScreenshot:
openclaw browser screenshotTo navigate, click, or type:
openclaw browser navigate https://example.comopenclaw browser click <ref>openclaw browser type <ref> "hello"Existing Chrome via MCP
Section titled “Existing Chrome via MCP”If you want to use the browser you already have open, use the built-in user profile or create a new existing-session profile:
openclaw browser --browser-profile user tabsopenclaw browser create-profile --name chrome-live --driver existing-sessionopenclaw browser create-profile --name brave-live --driver existing-session --user-data-dir "~/Library/Application Support/BraveSoftware/Brave-Browser"openclaw browser --browser-profile chrome-live tabsThis setup is for host-only use. If you are working with Docker, headless servers, or remote setups like Browserless, you should use a CDP profile instead.
Remote browser control (node host proxy)
Section titled “Remote browser control (node host proxy)”If your Gateway is running on a different machine than your browser, you can run a node host on the machine that has Chrome, Brave, Edge, or Chromium. The Gateway proxies your browser actions to that node, so you do not need a separate browser control server.
You can use gateway.nodes.browser.mode to manage how actions are routed and gateway.nodes.browser.node to lock onto a specific node if you have several connected.
For details on security and remote setups, check these resources: Browser tool, Remote access, Tailscale, Security
Next steps
Section titled “Next steps”OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.