> ## 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.

# CLI Options

> Complete reference of all CLI flags and options for Agent Browser

# CLI Options

Complete reference of all command-line flags and options available in Agent Browser.

## Global Options

These options can be used with any command.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--json</code></td>
      <td>Output as JSON for machine parsing</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>--debug</code></td>
      <td>Enable debug output</td>
      <td><code>false</code></td>
    </tr>
  </tbody>
</table>

## Browser Configuration

Options for configuring the browser instance.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--headed</code></td>
      <td>Show browser window (not headless)</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>--executable-path \<path></code></td>
      <td>Custom browser executable path</td>
      <td>Bundled Chromium</td>
    </tr>

    <tr>
      <td><code>--extension \<path></code></td>
      <td>Load browser extension (repeatable)</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>--args \<args></code></td>
      <td>Browser launch args (comma or newline separated)</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>--user-agent \<ua></code></td>
      <td>Custom User-Agent string</td>
      <td>Default Chrome UA</td>
    </tr>

    <tr>
      <td><code>--color-scheme \<scheme></code></td>
      <td>Color scheme: <code>dark</code>, <code>light</code>, <code>no-preference</code></td>
      <td>System default</td>
    </tr>

    <tr>
      <td><code>--ignore-https-errors</code></td>
      <td>Ignore HTTPS certificate errors</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>--allow-file-access</code></td>
      <td>Allow file:// URLs to access local files (Chromium only)</td>
      <td><code>false</code></td>
    </tr>
  </tbody>
</table>

## Session Management

Options for managing browser sessions and state.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--session \<name></code></td>
      <td>Use isolated session</td>
      <td><code>default</code></td>
    </tr>

    <tr>
      <td><code>--session-name \<name></code></td>
      <td>Auto-save/restore session state</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>--profile \<path></code></td>
      <td>Persistent browser profile directory</td>
      <td>None (ephemeral)</td>
    </tr>

    <tr>
      <td><code>--state \<path></code></td>
      <td>Load storage state from JSON file</td>
      <td>None</td>
    </tr>
  </tbody>
</table>

## Network Configuration

Options for network settings and headers.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--headers \<json></code></td>
      <td>Set HTTP headers scoped to the URL's origin</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>--proxy \<url></code></td>
      <td>Proxy server URL with optional auth</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>--proxy-bypass \<hosts></code></td>
      <td>Hosts to bypass proxy (comma-separated)</td>
      <td>None</td>
    </tr>
  </tbody>
</table>

## Screenshot Options

Options specific to screenshot commands.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--full</code>, <code>-f</code></td>
      <td>Capture full page (not just viewport)</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>--annotate</code></td>
      <td>Annotated screenshot with numbered element labels</td>
      <td><code>false</code></td>
    </tr>
  </tbody>
</table>

## Snapshot Options

Options for the snapshot command.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>-i</code>, <code>--interactive</code></td>
      <td>Only include interactive elements</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>-C</code>, <code>--cursor</code></td>
      <td>Include cursor-interactive elements</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>-c</code>, <code>--compact</code></td>
      <td>Remove empty structural elements</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>-d</code>, <code>--depth \<n></code></td>
      <td>Limit tree depth to n levels</td>
      <td>Unlimited</td>
    </tr>

    <tr>
      <td><code>-s</code>, <code>--selector \<sel></code></td>
      <td>Scope snapshot to CSS selector</td>
      <td>Full page</td>
    </tr>
  </tbody>
</table>

## Cloud Providers

Options for cloud browser providers.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>-p</code>, <code>--provider \<name></code></td>
      <td>Cloud browser provider: <code>browserbase</code>, <code>browseruse</code>, <code>kernel</code>, <code>ios</code></td>
      <td>None (local)</td>
    </tr>

    <tr>
      <td><code>--device \<name></code></td>
      <td>iOS device name (for iOS provider), e.g. "iPhone 15 Pro"</td>
      <td>None</td>
    </tr>
  </tbody>
</table>

## CDP Connection

Options for Chrome DevTools Protocol connections.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--cdp \<port|url></code></td>
      <td>Connect via Chrome DevTools Protocol (port or WebSocket URL)</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>--auto-connect</code></td>
      <td>Auto-discover and connect to running Chrome</td>
      <td><code>false</code></td>
    </tr>
  </tbody>
</table>

## Security Options

Options for security features.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--content-boundaries</code></td>
      <td>Wrap page output in boundary markers for LLM safety</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>--max-output \<chars></code></td>
      <td>Truncate page output to N characters</td>
      <td>Unlimited</td>
    </tr>

    <tr>
      <td><code>--allowed-domains \<list></code></td>
      <td>Comma-separated allowed domain patterns</td>
      <td>None (all allowed)</td>
    </tr>

    <tr>
      <td><code>--action-policy \<path></code></td>
      <td>Path to action policy JSON file</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>--confirm-actions \<list></code></td>
      <td>Action categories requiring confirmation (comma-separated)</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>--confirm-interactive</code></td>
      <td>Enable interactive confirmation prompts</td>
      <td><code>false</code></td>
    </tr>
  </tbody>
</table>

## Download Configuration

Options for download behavior.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--download-path \<path></code></td>
      <td>Default download directory</td>
      <td>System temp directory</td>
    </tr>
  </tbody>
</table>

## Configuration File

Options for loading configuration.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--config \<path></code></td>
      <td>Use a custom config file</td>
      <td>Auto-discover from <code>\~/.agent-browser/config.json</code> and <code>./agent-browser.json</code></td>
    </tr>
  </tbody>
</table>

## Click Options

Options for the click command.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--new-tab</code></td>
      <td>Open link in a new tab instead of navigating current tab</td>
      <td><code>false</code></td>
    </tr>
  </tbody>
</table>

## Scroll Options

Options for the scroll command.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>-s</code>, <code>--selector \<sel></code></td>
      <td>CSS selector for a scrollable container</td>
      <td>Page viewport</td>
    </tr>
  </tbody>
</table>

## Wait Options

Options for the wait command.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>-u</code>, <code>--url \<pattern></code></td>
      <td>Wait for URL to match pattern</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>-l</code>, <code>--load \<state></code></td>
      <td>Wait for load state: <code>load</code>, <code>domcontentloaded</code>, <code>networkidle</code></td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>-f</code>, <code>--fn \<expression></code></td>
      <td>Wait for JavaScript expression to be truthy</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>-t</code>, <code>--text \<text></code></td>
      <td>Wait for text to appear on page</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>-d</code>, <code>--download</code></td>
      <td>Wait for a download to complete</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>--timeout \<ms></code></td>
      <td>Timeout in milliseconds (for download wait)</td>
      <td>30000</td>
    </tr>
  </tbody>
</table>

## Eval Options

Options for the eval command.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>-b</code>, <code>--base64</code></td>
      <td>Decode script from base64</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>--stdin</code></td>
      <td>Read script from stdin</td>
      <td><code>false</code></td>
    </tr>
  </tbody>
</table>

## Find Options

Options for the find command.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--name \<name></code></td>
      <td>Filter role by accessible name</td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>--exact</code></td>
      <td>Require exact text match</td>
      <td><code>false</code></td>
    </tr>
  </tbody>
</table>

## Cookie Options

Options for the cookies set command.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--url \<url></code></td>
      <td>Cookie URL scope</td>
      <td>Current page URL</td>
    </tr>

    <tr>
      <td><code>--domain \<domain></code></td>
      <td>Cookie domain</td>
      <td>Current page domain</td>
    </tr>

    <tr>
      <td><code>--path \<path></code></td>
      <td>Cookie path</td>
      <td><code>/</code></td>
    </tr>

    <tr>
      <td><code>--httpOnly</code></td>
      <td>Mark as HTTP-only</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>--secure</code></td>
      <td>Mark as secure (HTTPS only)</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>--sameSite \<value></code></td>
      <td>SameSite attribute: <code>Strict</code>, <code>Lax</code>, <code>None</code></td>
      <td>None</td>
    </tr>

    <tr>
      <td><code>--expires \<timestamp></code></td>
      <td>Expiration timestamp (Unix seconds)</td>
      <td>Session cookie</td>
    </tr>
  </tbody>
</table>

## Auth Options

Options for the auth save command.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Required</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--url \<url></code></td>
      <td>Login page URL</td>
      <td>Yes</td>
    </tr>

    <tr>
      <td><code>--username \<user></code></td>
      <td>Username</td>
      <td>Yes</td>
    </tr>

    <tr>
      <td><code>--password \<pass></code></td>
      <td>Password</td>
      <td>Yes (or --password-stdin)</td>
    </tr>

    <tr>
      <td><code>--password-stdin</code></td>
      <td>Read password from stdin</td>
      <td>No</td>
    </tr>

    <tr>
      <td><code>--username-selector \<sel></code></td>
      <td>Custom username field selector</td>
      <td>No</td>
    </tr>

    <tr>
      <td><code>--password-selector \<sel></code></td>
      <td>Custom password field selector</td>
      <td>No</td>
    </tr>

    <tr>
      <td><code>--submit-selector \<sel></code></td>
      <td>Custom submit button selector</td>
      <td>No</td>
    </tr>
  </tbody>
</table>

## State Options

Options for state clear command.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>-a</code>, <code>--all</code></td>
      <td>Clear all saved states</td>
      <td><code>false</code></td>
    </tr>
  </tbody>
</table>

## Profiler Options

Options for profiler start command.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--categories \<list></code></td>
      <td>Chrome trace categories (comma-separated)</td>
      <td>Default Chrome categories</td>
    </tr>
  </tbody>
</table>

## Diff Options

Options for diff commands.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--baseline \<file></code></td>
      <td>Baseline file for comparison</td>
      <td>Previous snapshot in session</td>
    </tr>

    <tr>
      <td><code>-o</code>, <code>--output \<file></code></td>
      <td>Save diff image to custom path</td>
      <td>Auto-generated path</td>
    </tr>

    <tr>
      <td><code>-t</code>, <code>--threshold \<value></code></td>
      <td>Color threshold for screenshot diff (0-1)</td>
      <td>0.1</td>
    </tr>

    <tr>
      <td><code>--screenshot</code></td>
      <td>Also perform visual screenshot diff (for url diff)</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>--wait-until \<state></code></td>
      <td>Wait strategy before diff: <code>load</code>, <code>domcontentloaded</code>, <code>networkidle</code></td>
      <td><code>load</code></td>
    </tr>
  </tbody>
</table>

## Network Options

Options for network route command.

<table>
  <thead>
    <tr>
      <th>Option</th>
      <th>Description</th>
      <th>Default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>--abort</code></td>
      <td>Block requests matching URL pattern</td>
      <td><code>false</code></td>
    </tr>

    <tr>
      <td><code>--body \<json></code></td>
      <td>Mock response body (JSON)</td>
      <td>None</td>
    </tr>
  </tbody>
</table>

## Boolean Flag Values

All boolean flags accept optional `true` or `false` values to override config settings:

```bash theme={null}
# Enable (equivalent to bare --headed)
agent-browser --headed true open example.com

# Disable (overrides config file setting)
agent-browser --headed false open example.com

# Bare flag defaults to true
agent-browser --headed open example.com
```

This applies to: `--json`, `--full`, `--headed`, `--debug`, `--ignore-https-errors`, `--allow-file-access`, `--auto-connect`, `--annotate`, `--content-boundaries`, `--confirm-interactive`.
