Coding agents
playwright-cli is a token-efficient browser automation CLI built for coding agents like Claude Code. Instead of loading full tool schemas and accessibility trees into the model context, it exposes concise commands: open, click, type, screenshot, snapshot. Each command outputs minimal state.
What playwright-cli is and why it exists
Regular Playwright MCP exposes full browser state to the model — useful for deep exploration, but expensive in tokens. playwright-cli takes the opposite approach: short commands, minimal output, designed for agents that need to balance browser automation with large codebases and limited context windows.
Use playwright-cli when: the agent is working on a codebase and occasionally needs to check something in the browser. Use MCP when: the agent needs to explore page structure deeply and reason over it iteratively.
Core commands
The most common commands I use when asking an agent to test something in the browser:
Sessions — keep browser state between commands
By default, CLI keeps browser state in memory — cookies and localStorage persist between calls within a session but reset when the browser closes. Named sessions let you run multiple browsers for different contexts.
Monitoring all sessions
playwright-cli show opens a visual dashboard in the browser where you can see all running sessions with live screencasts. You can click into any session to take over mouse and keyboard control.
How to ask a coding agent to use playwright-cli
The simplest way: just describe what to test and mention playwright-cli. The agent will discover commands via playwright-cli --help or use installed skills.