---
title: "CLI"
description: "CLI commands from the same tools used by MCP, Pi, OMP and the AI SDK."
canonical_url: "https://browsers.agntn.dev/guide/cli"
---
# CLI

> CLI commands from the same tools used by MCP, Pi, OMP and the AI SDK.

One install gives you the `browsers` command. After `pnpm add` it's `pnpm exec browsers`, or install it once with `pnpm add -g @agntn/browsers`. Or skip installing entirely:

```bash
npx @agntn/browsers scrape https://example.com -p playwright
```

## Commands

<table>
<thead>
  <tr>
    <th>
      Command
    </th>
    
    <th>
      What it does
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        scrape
      </code>
    </td>
    
    <td>
      Rendered page, markdown if the vendor has it
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        screenshot
      </code>
    </td>
    
    <td>
      Image to a file, the page or one element
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        pdf
      </code>
    </td>
    
    <td>
      The page printed to a PDF file
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        crawl
      </code>
    </td>
    
    <td>
      Follow links, or wait for a crawl job again
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        links
      </code>
    </td>
    
    <td>
      Unique hrefs, one per line
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        accessibility
      </code>
    </td>
    
    <td>
      Roles, names and states, one per line
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        webmcp-tools
      </code>
    </td>
    
    <td>
      The WebMCP tools a page registers
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        webmcp-call
      </code>
    </td>
    
    <td>
      Run one of a page's WebMCP tools
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        extract
      </code>
    </td>
    
    <td>
      Structured data from a prompt
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        search
      </code>
    </td>
    
    <td>
      Web search through Hyperbrowser
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        session
      </code>
    </td>
    
    <td>
      Open a session, answer with its ID
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        sessions
      </code>
    </td>
    
    <td>
      IDs of the sessions still open
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        release
      </code>
    </td>
    
    <td>
      Close a session and stop the bill
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        providers
      </code>
    </td>
    
    <td>
      Who is configured and what they can do
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        capabilities
      </code>
    </td>
    
    <td>
      What one provider can do
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        mcp
      </code>
    </td>
    
    <td>
      MCP server on stdio
    </td>
  </tr>
</tbody>
</table>

Run `browsers <command> --help` for every flag. Use `-p` for the provider, `-o` for a screenshot or PDF file, and `-f` for the screenshot format. The flags are the tool's own arguments in kebab case, so `maxPages` is `--max-pages`.

## Who answers

Skip `-p` and the first configured provider in registry order that can do the job gets the call. Steel if its key is set. Playwright if nothing else is. `links` on a Steel setup skips Steel, which has no links route. `scrape`, `screenshot`, `pdf`, `crawl`, `extract`, `search`, `accessibility`, `webmcp-tools`, `webmcp-call` and `session create` look past a provider the same way.

Only `ANCHOR_API_KEY` set? `scrape` walks past Anchor, which doesn't scrape, and lands on Playwright. Name a provider with `-p` and you get that one, refusal included.

```bash
browsers providers
```

```text
○ steel
○ browserbase
○ kernel
○ browserless
○ hyperbrowser
○ anchor
○ cloudflare
● playwright  scrape screenshot navigate evaluate sessions statelessScrape elementScreenshot screenshotWaitFor scrapeWaitFor crawl pdf links
```

A filled dot means that provider's key was in the environment on this run. Playwright is always filled. Where `statelessScreenshot` is missing, a screenshot needs a session, which the command opens and closes for you.

## Pipes and errors

Stdout carries the tool's text. For scrape, the first line is `[provider=…] url`, followed by a blank line and the page. `--json` gives you details instead. For scrape, that's `url`, `provider` and `contentLength`, not the page.

A failure prints one line on stderr and exits with code 1. Keys in URLs appear as `[REDACTED]`. Misspelled a flag? The error points you to the right one. Nice.

```bash
browsers scrape https://example.com --waitFor body
```

```text
Invalid arguments: unknown option "--waitFor"; takes --provider (-p), --browser, --wait-for, --max-chars, --json
```


## Sitemap

See the full [sitemap](https://browsers.agntn.dev/sitemap.md) for all pages.
