| name | agent-browser |
| description | Use the Agent Browser CLI (`agent-browser`) for web automation when the user explicitly asks for "agent-browser/agent-broswer" or wants browser actions executed through that CLI instead of OpenClaw browser tool. Includes install checks, session/profile usage, and stable snapshot-ref workflow. |
Agent Browser
Use agent-browser CLI when user explicitly asks for it.
This skill is self-contained for speed. Use it directly without mandatory pre-reading of extra reference files.
Doc baseline
This skill is aligned to official agent-browser docs and command shape at: https://agent-browser.dev/.
If a command/flag behavior is unclear or fails unexpectedly, then consult official docs at https://agent-browser.dev/ before trying non-official workarounds.
Core concepts (from official docs)
- Agent-first output: compact text output optimized for LLM context.
- Ref-based automation:
snapshot returns accessibility tree with refs like @e1, @e2.
- Deterministic interaction: operate on refs from the latest snapshot to reduce selector drift.
- Fast CLI model: Rust CLI + daemon workflow, suitable for iterative command loops.
- Session isolation: use
--session <name> for parallel isolated browser states.
- Persistent auth/profile: use
--profile <path> to reuse cookies/localStorage/logins.
Routing rule
- If user says: "use agent-browser" / "用agent-broswer" / "用 agent browser" -> use this skill first.
- Do not silently switch to OpenClaw
browser tool unless:
agent-browser is unavailable, and
- user agrees to fallback.
Preflight
Run in target project/workdir:
agent-browser --version
If command not found, offer install:
npm install -g agent-browser
agent-browser install
Linux may need:
agent-browser install --with-deps
Default execution pattern
- Open page
- Snapshot accessibility tree
- Interact using snapshot refs (
@e*)
- Verify with
get text / snapshot
- Screenshot if needed
Example:
agent-browser open https://example.com
agent-browser snapshot
agent-browser click @e2
agent-browser fill @e5 "hello"
agent-browser get text @e8
agent-browser screenshot result.png
Selector strategy
Use this order:
- snapshot refs (
@e2) from latest snapshot
- semantic finder (
find role/text/label ...)
- CSS/XPath selectors as last resort
Useful commands
Core
agent-browser open <url>
agent-browser snapshot
agent-browser click <sel>
agent-browser fill <sel> <text>
agent-browser type <sel> <text>
agent-browser press <key>
agent-browser wait <selector|ms>
agent-browser screenshot [path]
agent-browser close
Semantic finders
agent-browser find role button click --name "Submit"
agent-browser find label "Email" fill "a@b.com"
agent-browser find text "Sign in" click
Read values
agent-browser get text <sel>
agent-browser get value <sel>
agent-browser get url
agent-browser get title
Session/profile conventions
Use isolated sessions for parallel tasks:
agent-browser --session task1 open https://a.com
agent-browser --session task2 open https://b.com
Use persistent profile for login reuse:
agent-browser --profile ~/.agent-browser/profiles/myproj open https://app.example.com
Reliability notes
- Re-run
snapshot after navigation or DOM-changing actions.
- Prefer
wait --text / wait --url before next action on slow pages.
- On auth/captcha/2FA pages, pause and ask user before proceeding.
- For destructive actions (delete/submit/purchase), ask confirmation first.
When stuck
If any of these occur, check https://agent-browser.dev/ immediately and continue with doc-correct usage:
- Command exists but flag/argument behavior is uncertain
- Command output changed from expected shape
- Session/profile behavior is inconsistent across runs
- Daemon/connectivity behavior differs from past runs
Only fallback to OpenClaw browser tool if agent-browser is unavailable or user approves fallback.
Reporting format to user
When task completes, report:
- URL(s) visited
- key actions performed
- output artifact paths (screenshots/pdf)
- blockers and next step