---
name: browser-tools
description: Interactive browser automation via Microsoft Playwright CLI. Use when you need to open pages, inspect DOM snapshots, click/type, capture screenshots, inspect console/network output, or test frontend flows in a real browser.
---

# Browser Tools

Use Pie's packaged Microsoft Playwright CLI wrapper. Scripts live next to this skill; resolve `playwright-cli.js` against this skill's `baseDir` and use the resulting ordinary path with `bash`.

No manual dependency install is required when this skill is shipped with Pie.

## Common Commands

```bash
node <baseDir>/playwright-cli.js open https://example.com
node <baseDir>/playwright-cli.js goto https://example.com
node <baseDir>/playwright-cli.js snapshot
node <baseDir>/playwright-cli.js click "Submit"
node <baseDir>/playwright-cli.js type "hello"
node <baseDir>/playwright-cli.js screenshot
node <baseDir>/playwright-cli.js console
node <baseDir>/playwright-cli.js network
node <baseDir>/playwright-cli.js close
```

Use `node <baseDir>/playwright-cli.js --help` for the full command list.

## Workflow

Start with `open` or `goto`, then use `snapshot` before interacting. Prefer snapshot, console, and network output for diagnosis; use screenshots when visual layout matters. Use named sessions with `-s=<session>` when you need to keep multiple browser flows separate.

If the browser is not installed, run:

```bash
node <baseDir>/playwright-cli.js install-browser chromium
```

If a session gets stuck, use:

```bash
node <baseDir>/playwright-cli.js close
node <baseDir>/playwright-cli.js kill-all
```
