agent-browser
Fast browser-automation CLI for AI agents. Drives a real Chrome session that
persists across commands (open once, then click/type/screenshot against the
live page). Installed globally (/usr/bin/agent-browser, v0.27.0); Chrome is
installed per-user under ~/.agent-browser/.
Critical: launch flag on these VMs
These VMs block Chrome's user-namespace sandbox via AppArmor. Always pass
--args "--no-sandbox" on the launching command (the first open), e.g.:
agent-browser open https://example.com --args "--no-sandbox"
If you hit "shared library" errors on launch, install OS deps once:
agent-browser install --with-deps # may need sudo for apt packages
Authoritative command reference
The CLI ships version-matched skills — load these instead of guessing flags:
agent-browser skills get core --full # overview + full command ref + templates
agent-browser skills list # specialized skills (exploratory testing, etc.)
Common loop
agent-browser open <url> --args "--no-sandbox" # launch + navigate
agent-browser snapshot # accessibility tree + @refs to target
agent-browser click <sel|@ref>
agent-browser type <sel> "<text>"
agent-browser fill <sel> "<text>"
agent-browser press Enter
agent-browser wait <sel|ms>
agent-browser screenshot /tmp/shot.png # capture for the user / evidence
agent-browser close # end the session
Prefer snapshot + @ref targeting over brittle CSS selectors. Take a
screenshot at each meaningful step so findings are verifiable, and close
when done so a stale session doesn't leak into the next test.
Notes
- Session is shared across invocations until
close; the launch--argsapply to that whole session, so set--no-sandboxon the firstopen. - React onClick flakiness:
agent-browser click <@ref>(ref-clicks likeclick e47) don't always fire ReactonClickhandlers — observed on the the page's pricing / "Get started" buttons. If a ref-click appears to do nothing, fall back to a real DOM click via eval:
This reliably dispatches the synthetic event React expects.agent-browser eval "document.querySelector('SEL').click()" - Auth walls can't be automated: Clerk's Cloudflare Turnstile ("verify you are human") + email OTP block automation by design. A flow that hits sign-up can only be driven up to that wall unless you have an existing test login or OTP access.
- For sensitive flows (signup, Stripe checkout): use disposable/test data only, never real cards or real customer credentials.