browser controls a headless browser by running agent-browser CLI commands. It connects to any CDP-compatible browser (such as Lightpanda) over the Chrome DevTools Protocol WebSocket interface.
agent-browser maintains its own daemon session between calls, so a navigate in one call and a click in the next operate on the same browser state.
Prerequisites
Install agent-browser
Install the
agent-browser CLI globally on the server where Reacher is deployed:Start a CDP-compatible browser
Run a CDP-compatible browser and expose its WebSocket debugger. Lightpanda is a lightweight option:Any Chromium-based browser launched with
--remote-debugging-port=9222 also works.Parameters
An
agent-browser command string. The tool parses this into arguments respecting quoted strings before passing to the CLI.Supported commands:open <url>— navigate to a URLsnapshot -i— take an accessibility/DOM snapshot of the current pageclick @<elementId>— click an element by its agent-browser element IDfill @<elementId> <value>— fill a form field with a valueclose— close the current page/session
"open https://example.com", "snapshot -i", "click @e2", "fill @e3 hello world"Configuration
| Variable | Default | Description |
|---|---|---|
BROWSER_CDP_HOST | 127.0.0.1 | Host of the CDP-compatible browser |
BROWSER_CDP_PORT | 9222 | WebSocket debugger port |
ws://<BROWSER_CDP_HOST>:<BROWSER_CDP_PORT> and passes it to agent-browser via the --cdp flag.
Return value
true if agent-browser exited with code 0.The command string that was executed.
Trimmed standard output from
agent-browser. For snapshot, this contains the page’s accessibility tree or DOM representation.Trimmed standard error output. If
agent-browser is not installed, this will contain a helpful installation message.Process exit code from
agent-browser. 0 means success.Usage examples
Common use cases
Scrape a page Navigate to a URL, take a snapshot to see the page structure, then extract the relevant content fromstdout.
agent-browser daemon preserves session state between tool calls.