## Getting Started with Playwriter

Control your browser via Playwright API. Uses extension + CLI. No context bloat.

### Installation

1
Pin the extension

Click the puzzle icon in Chrome's toolbar, then pin Playwriter so it's always visible.

2
Enable a tab

Click the extension icon on a tab. It turns green when connected.

3
Install the CLI and run a command

    # install the CLI globally
    npm i -g playwriter
    # navigate to a URL in the active tab
    playwriter -s 1 -e "await page.goto('https://example.com')"

4
Add the skill to your agent

Install the Playwriter skill so your agent can call the CLI:

    # add playwriter skill to your coding agent
    npx -y skills add remorses/playwriter

### CLI Examples

    # create a stateful sandbox, outputs session id (e.g. 1)
    playwriter session new
    # navigate to a URL
    playwriter -s 1 -e "await page.goto('https://example.com')"
    # get the accessibility tree of the page
    playwriter -s 1 -e "console.log(await snapshot({ page }))"
    # click an element by its accessibility reference
    playwriter -s 1 -e "await page.locator('aria-ref=e5').click()"

## How It Works

- No new Chrome instances: Works with your current browser session
- No CDP mode required: No need to restart Chrome with special flags
- Full CDP access: Complete Chrome DevTools Protocol capabilities
- Visual feedback: Extension icon changes color to indicate connection status

## Icon States

- Gray: Not connected to any tab
- Green: Successfully connected and ready
- Orange badge (...): Connecting to relay server
- Red badge (!): Error occurred

## Privacy & Security

Playwriter MCP runs locally in your browser and does not send any data to external servers. All browser control happens through the standard Chrome DevTools Protocol on your machine.

## MCP Setup (Optional)

The CLI is the recommended way to use Playwriter. If you need MCP server setup, auto-configure it with:

    # auto-configure MCP server for your editor
    npx -y @playwriter/install-mcp playwriter@latest

For full MCP instructions, see MCP.md.

## Need Help?

For issues, feature requests, or contributions, visit the GitHub repository .