# browser-screenshot

A pi extension that lets the agent take screenshots of web pages.

## Install

```bash
pi install git:github.com/ScottRBK/browser-screenshot
```

Or clone and load directly:

```bash
git clone https://github.com/ScottRBK/browser-screenshot.git
cd browser-screenshot
npm install
npx playwright install chromium
```

## Usage

```bash
pi -e ./browser-screenshot.ts "screenshot https://example.com and describe the layout"
```

The `screenshot` tool saves a PNG to `/tmp` and returns the path. The agent
reads the image from there to analyse it.

## Parameters

| Param | Type | Default | Description |
|---|---|---|---|
| `url` | string | required | The page to screenshot |
| `fullPage` | boolean | false | Capture entire scrollable page |
| `width` | integer | 1920 | Viewport width |
| `height` | integer | 1080 | Viewport height |

## Requirements

- Playwright Chromium browser (`npx playwright install chromium`)