What is playwright-cli?
playwright-cli is how AI coding agents interact with a live browser. Click, navigate, capture locators, and extract everything needed to build UI tests.
All from the terminal.
Works with every AI agent & LLM
Bring your own agent. playwright-cli is the browser layer.
AI Coding Agents
All Major LLMs
Core Capabilities
Agent-Native Browser Control
Point your AI coding agent at any URL, and it instantly converts the page into structured, machine-readable data. Every button, input, and link gets a stable locator, so your agent can click, fill forms, navigate, take screenshots, and extract data autonomously while you supervise.
Language & Framework Agnostic
playwright-cli works with the stack you already use. Your agent explores the live app through playwright-cli, captures locators and page behavior, and then writes tests in your preferred language and framework. Playwright, Selenium, Cypress, or anything else. Your stack stays the same.
Up and Running in 3 Steps
No config files, no server to run, no MCP setup. Install globally, add skills, and tell your agent where to find them. That's it.
- 1
Install the CLI
Install playwright-cli globally. One command, works with Node.js 18+.
- 2
Install Skills
Skills are markdown files your coding agent reads at the start of every task. They describe every available playwright-cli command so your agent knows how to use it without you having to explain it each time.
- 3
Update your
AGENTS.mdAGENTS.mdis the file your coding agent reads to understand your project. This is the most common source of confusion for new users:- Playwright— the test framework you write tests in
- Playwright MCP— the original agentic browser tool
- playwright-cli— successor to Playwright MCP. Faster, more reliable, more secure. Use this one.
How It Works
Open
Start a browser session. Headless by default, --headed if you want to watch.
Snapshot
Capture the accessibility tree. Every element gets a stable ref like e12. The agent reads this as plain text.
Act
Click, fill, navigate using refs. Every command outputs the equivalent Playwright locator.
Built For Test Engineers
If you write test automation, know a programming language, and work alongside AI Coding Agents... playwright-cli is the best tool you can add to your stack.