Getting Started with Playwriter

Let your coding agent drive this browser. Open Claude Code, opencode, or pi and paste this prompt:

It installs the skill, then drives your existing Chrome. No new browser, no context bloat.

Manual setup & full documentation

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 after the daemon starts

Click the extension icon on a tab. It turns green when connected. The icon stays gray until an agent runs a playwriter command, which starts the local daemon.

3
Install the CLI and run a command
npm i -g playwriter
playwriter session new
playwriter -e "state.page = await context.newPage()"
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 https://playwriter.dev -g -y

CLI Examples

# open a tab and go to a URL
playwriter -e "state.page = await context.newPage()"
playwriter -e "await state.page.goto('https://example.com')"
# print the accessibility tree
playwriter -e "console.log(await snapshot({ page: state.page }))"
# click a link
playwriter -e "await state.page.getByRole('link').first().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 is local by default. Normal browser control stays between the extension and the relay on your computer. Remote control is optional and starts only after you confirm a disclosure. It lets the agent use every Playwriter tab and open new ones.

While Remote control is active, browser data passes through an encrypted Playwriter tunnel to anyone holding the secret link. Read the privacy policy before sharing sensitive tabs.

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 .