Skip to content

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:

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).

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:

Terminal window
openclaw browser profiles
openclaw browser --browser-profile openclaw start
openclaw browser --browser-profile openclaw open https://example.com
openclaw browser --browser-profile openclaw snapshot

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 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.
Terminal window
openclaw browser profiles
openclaw browser create-profile --name work --color "#FF5A36"
openclaw browser create-profile --name chrome-live --driver existing-session
openclaw browser delete-profile --name work

To run a command using a specific profile, use the --browser-profile flag:

Terminal window
openclaw browser --browser-profile work tabs

Managing your open tabs is straightforward with these commands:

Terminal window
openclaw browser tabs
openclaw browser open https://docs.openclaw.ai
openclaw browser focus <targetId>
openclaw browser close <targetId>

You can capture the state of a page or interact with elements using reference-based automation.

Snapshot:

Terminal window
openclaw browser snapshot

Screenshot:

Terminal window
openclaw browser screenshot

To navigate, click, or type:

Terminal window
openclaw browser navigate https://example.com
openclaw browser click <ref>
openclaw browser type <ref> "hello"

If you want to use the browser you already have open, use the built-in user profile or create a new existing-session profile:

Terminal window
openclaw browser --browser-profile user tabs
openclaw browser create-profile --name chrome-live --driver existing-session
openclaw browser create-profile --name brave-live --driver existing-session --user-data-dir "~/Library/Application Support/BraveSoftware/Brave-Browser"
openclaw browser --browser-profile chrome-live tabs

This 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.

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

AI Setup Assistant

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.