---
name: browser-use
description: Use when a task needs a real Chrome browser: clicking, typing, screenshots, logged-in sessions, or JS-rendered and bot-protected pages, via the browser-use CLI.
---
# Browser Use
## What this does
Drives a real Chrome browser over CDP with the `browser-use` CLI: open tabs, click, type, read pages, take screenshots.
## When to use
- The task needs interaction (click, type, navigate), the user's logged-in session, JS rendering, or a bot-protected page.
- Do NOT use it for a basic fetch. If curl or your fetch tool can read it (public page, API, docs), use that. Escalate to the browser only if the fetch fails or returns a shell page.
## How to run it
1. Run Python snippets through heredocs. Helpers are pre-imported:
bash
browser-use <<'PY'
print(page_info())
PY
2. Make the first navigation `new_tab(url)`, not `goto_url(url)`. The daemon keeps the attached tab across CLI calls, so do not call `new_tab()` in every script.
3. Keep one working tab per task/site. Check `current_tab()` and `list_tabs()` and reuse a matching tab with `switch_tab()`. Do not close tabs you did not create. When done, close tabs you created unless the user needs them or closing would lose unsaved work.
4. Never call `activate_tab()` automatically, because it brings Chrome to the foreground. Use it only if the user asks to see the tab.
5. Reuse the default daemon. Do not invent per-job `BU_NAME` values; each new local daemon opens another connection and another Chrome Allow prompt.
6. Find elements with the accessibility tree, not screenshots: `cdp("Accessibility.getFullAXTree")["nodes"]` gives role, name and `backendDOMNodeId`. Filter in Python before printing. Get coordinates:
python
q = cdp("DOM.getBoxModel", backendNodeId=n)["model"]["content"]
x, y = sum(q[0::2])/4, sum(q[1::2])/4
7. Click with `click_at_xy(x, y)`, then verify with a targeted `js(...)` or `page_info()`. Use `js(...)` on raw HTML only when the AX tree lacks the element. Screenshot when layout or imagery matters.
8. Call `wait_for_load()` after navigation. If the tab is stale or internal, call `ensure_real_tab()`.
9. Login walls: stop and ask. Use SSO only if Chrome is already signed in, and still stop for passwords, MFA, consent, or ambiguous account choice.
10. If it cannot connect, run `browser-use --doctor`. Local Chrome needs `chrome://inspect/#remote-debugging` enabled. On macOS, if Chrome shows an "Allow remote debugging?" popup, keep the original command running and run `browser-use mac-approve` in another call. Do not rerun the original command.
11. For parallel tasks or captcha-prone sites, suggest a cloud browser (check `browser-use auth status` first):
bash
browser-use <<'PY'
start_remote_daemon("r7k2")
PY
BU_NAME=r7k2 browser-use <<'PY'
new_tab("https://example.com")
print(page_info())
PY
When finished, ask "Should I close this browser now?" and if yes run `stop_remote_daemon(name)`. Remote daemons bill until stopped.
## Output
Hand back the result of the browser task (extracted text, state confirmation, or screenshot path), plus a note of any tabs or cloud browsers left open.
Credit: Based on public content by browser-use, packaged by Orbit.