> ## Documentation Index
> Fetch the complete documentation index at: https://browseruse-0aece648-larsen-v1-unified-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Browser Use CLI

> Direct browser control for coding agents.

The Browser Use CLI (`browser-use`) gives coding agents a direct browser-control surface backed by [Browser Harness](https://github.com/browser-use/browser-harness):

* **Direct browser control** — agents run Python to do actions in the browser.
* **Three browser modes** — you can use with local Chrome or Chromium with your existing tabs, cookies, extensions, and logins; Browser Use cloud browsers; or any browser reachable through a CDP endpoint.
* **Agent-ready setup** — install the skill into Claude Code, Codex, and other coding agents so they know when and how to call the CLI.

Try out Browser Use CLI with an agent in [Browser Use Cloud](https://cloud.browser-use.com?utm_source=docs\&utm_medium=browser-use-cli\&utm_campaign=v4), or install the skill to try it yourself locally.

## Install the CLI

```bash theme={null}
uv tool install browser-use
browser-use --help
```

For one-off runs without a permanent tool install, use `uvx browser-use`.

## Set Up Your Agent

Paste this setup prompt into Claude Code, Codex, or another coding agent:

```text theme={null}
Install or upgrade browser-use with `uv tool install --python 3.12 --upgrade --force 'browser-use @ git+https://github.com/browser-use/browser-use.git'`, run `browser-use skill install`, and connect it to my browser. Follow https://github.com/browser-use/browser-use if setup or connection fails.
```

The skill is discoverable from [skills.sh](https://skills.sh/browser-use/browser-use/browser-use).

## Use Python Directly

Pass Python to the CLI. Use `uvx browser-use` for one-off runs, or `browser-use` if you installed it:

```bash theme={null}
uvx browser-use <<'PY'
new_tab("https://example.com")
print(page_info())
PY
```

The `<<'PY'` form is for Unix-compatible shells such as bash, zsh, Git Bash, or WSL. In PowerShell, pipe a here-string instead:

```powershell theme={null}
@'
new_tab("https://example.com")
print(page_info())
'@ | uvx browser-use
```

## Local Browser Setup

The default local flow attaches to your running Chrome or Chromium through CDP. This preserves the browser state the user already has locally: open tabs, cookies, extensions, and logged-in sessions. It is the right default for desktop work where the user can approve Chrome's remote-debugging prompt.

You can also point the CLI at any existing CDP browser by setting `BU_CDP_URL` or `BU_CDP_WS` before running `browser-use`. Use that for managed Chrome instances, Playwright-launched browsers, or infrastructure that already exposes a DevTools endpoint.

If the CLI cannot connect, run:

```bash theme={null}
browser-use --doctor
```

If Chrome asks whether to allow remote debugging, approve it and rerun the command.

## Cloud Browsers

Use Browser Use cloud browsers when the agent runs on a headless machine, needs an isolated browser, needs parallel browser sessions, or needs Browser Use Cloud features such as persistent cloud profiles, proxy routing, CAPTCHA handling, and live browser viewing.

The Browser Harness-backed CLI keeps cloud sessions explicit. You authenticate once, start a named cloud browser, then use that name for later commands:

```bash theme={null}
browser-use auth login
```

```bash theme={null}
browser-use <<'PY'
start_remote_daemon("work")
PY

BU_NAME=work browser-use <<'PY'
new_tab("https://example.com")
print(page_info())
PY
```

Use short, task-specific names when you have multiple agents or sub-agents running in parallel. Each name maps to its own remote browser daemon.

Remote browsers bill until they stop or time out. When the task is done, ask whether to close the browser; if yes, run:

```bash theme={null}
BU_NAME=work browser-use <<'PY'
stop_remote_daemon("work")
PY
```

## Useful Commands

```bash theme={null}
browser-use --help
browser-use --doctor
browser-use auth login
browser-use auth status
browser-use skill show
browser-use telemetry status
```
