> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/vercel-labs/agent-browser/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install Agent Browser using npm, pnpm, yarn, Homebrew, or from source

## Quick Install (Recommended)

The fastest way to get started is to install Agent Browser globally:

<CodeGroup>
  ```bash npm theme={null}
  npm install -g agent-browser
  agent-browser install  # Download Chromium
  ```

  ```bash pnpm theme={null}
  pnpm add -g agent-browser
  agent-browser install  # Download Chromium
  ```

  ```bash yarn theme={null}
  yarn global add agent-browser
  agent-browser install  # Download Chromium
  ```
</CodeGroup>

<Tip>
  Global installation gives you the best performance - commands run through the native Rust CLI directly with sub-millisecond parsing overhead.
</Tip>

## Installation Methods

### Try Without Installing

Run directly with `npx` if you want to try it without installing globally:

```bash theme={null}
npx agent-browser install   # Download Chromium (first time only)
npx agent-browser open example.com
```

<Note>
  `npx` routes through Node.js before reaching the Rust CLI, so it is noticeably slower than a global install. For regular use, install globally.
</Note>

### Project Installation

For projects that want to pin the version in `package.json`:

<CodeGroup>
  ```bash npm theme={null}
  npm install agent-browser
  npx agent-browser install
  ```

  ```bash pnpm theme={null}
  pnpm add agent-browser
  pnpx agent-browser install
  ```

  ```bash yarn theme={null}
  yarn add agent-browser
  yarn agent-browser install
  ```
</CodeGroup>

Then use via `npx` or `package.json` scripts:

```json package.json theme={null}
{
  "scripts": {
    "browser": "agent-browser"
  }
}
```

### Homebrew (macOS)

Install via Homebrew for easy updates:

```bash theme={null}
brew install agent-browser
agent-browser install  # Download Chromium
```

### From Source

Build from source if you want to contribute or use the latest development version:

<Steps>
  <Step title="Clone the repository">
    ```bash theme={null}
    git clone https://github.com/vercel-labs/agent-browser
    cd agent-browser
    ```
  </Step>

  <Step title="Install dependencies">
    This project uses **pnpm**:

    ```bash theme={null}
    pnpm install
    ```
  </Step>

  <Step title="Build the project">
    Build both TypeScript and Rust components:

    ```bash theme={null}
    pnpm build
    pnpm build:native   # Requires Rust (https://rustup.rs)
    ```
  </Step>

  <Step title="Link globally">
    Make `agent-browser` available globally:

    ```bash theme={null}
    pnpm link --global
    agent-browser install
    ```
  </Step>
</Steps>

<Note>
  Building from source requires [Rust](https://rustup.rs) to be installed for the native CLI component.
</Note>

## Platform-Specific Setup

### Linux Dependencies

On Linux, you may need to install system dependencies for Chromium:

```bash theme={null}
agent-browser install --with-deps
```

This is equivalent to running:

```bash theme={null}
npx playwright install-deps chromium
```

### Windows

Agent Browser works on Windows x64. Install using npm:

```bash theme={null}
npm install -g agent-browser
agent-browser install
```

## Supported Platforms

Agent Browser provides native Rust binaries for:

<table>
  <thead>
    <tr>
      <th>Platform</th>
      <th>Binary</th>
      <th>Fallback</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>macOS ARM64</td>
      <td>Native Rust</td>
      <td>Node.js</td>
    </tr>

    <tr>
      <td>macOS x64</td>
      <td>Native Rust</td>
      <td>Node.js</td>
    </tr>

    <tr>
      <td>Linux ARM64</td>
      <td>Native Rust</td>
      <td>Node.js</td>
    </tr>

    <tr>
      <td>Linux x64</td>
      <td>Native Rust</td>
      <td>Node.js</td>
    </tr>

    <tr>
      <td>Windows x64</td>
      <td>Native Rust</td>
      <td>Node.js</td>
    </tr>
  </tbody>
</table>

If the native binary is unavailable for your platform, Agent Browser automatically falls back to the Node.js implementation.

## Verify Installation

Verify that Agent Browser is installed correctly:

```bash theme={null}
agent-browser --help
```

You should see the help output with all available commands.

Check the version:

```bash theme={null}
agent-browser --version
```

## Updating

Update to the latest version:

<CodeGroup>
  ```bash npm theme={null}
  npm update -g agent-browser
  ```

  ```bash pnpm theme={null}
  pnpm update -g agent-browser
  ```

  ```bash yarn theme={null}
  yarn global upgrade agent-browser
  ```

  ```bash homebrew theme={null}
  brew upgrade agent-browser
  ```
</CodeGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Get to a working example in under 2 minutes.
  </Card>

  <Card title="Core Concepts" icon="book" href="/concepts/snapshot-refs">
    Learn the snapshot-ref workflow.
  </Card>
</CardGroup>
