Playwright CLI adds browser automation, sessions and configuration
Introduced 2026-01-25 · score 0.98
HOW TO USE IT
When an agent needs to test a web workflow, install the CLI and use `open`, snapshots, and interaction commands; use a named session for project-specific browser state. The cited v0.0.59 release says the CLI is headless by default and `--headed` shows the browser.
npm install -g @playwright/mcp@latest
playwright-cli --helpplaywright-cli open <url>
playwright-cli snapshot
playwright-cli click <ref>
playwright-cli type "<text>"
playwright-cli press <key>
playwright-cli screenshotplaywright-cli --session=<name> open <url>
playwright-cli session-list
PLAYWRIGHT_CLI_SESSION=<name> <agent-command>WHY THIS HELPS
Run browser interactions to test a web workflow from a coding agent, using project-specific browser state when needed.
REQUIREMENTS AND LIMITATIONS
- Version: v0.0.59
- Requires npm install -g @playwright/mcp@latest
- open <url> (required): Open the URL in the browser.
- --headed: Show the browser when passed to `open`; CLI is headless by default.
- --session=<name>: Select a browser session/profile for the invocation.
- PLAYWRIGHT_CLI_SESSION: Select the session for the coding agent process.
- session-stop [name]: Stop the named session; name is optional in the documented syntax.
- session-stop-all: Stop all sessions.
- session-delete [name]: Delete session data and profiles; name is optional in the documented syntax.
- playwright-cli.json: Configuration file; the release states support but does not document its object keys or sub-keys.
- Prerequisite: Install globally with `npm install -g @playwright/mcp@latest`.
- Prerequisite: A coding agent may use the CLI directly by consulting `playwright-cli --help`; installing skills is optional in the release instructions.
- The CLI is headless by default.
- The release describes this as the first snapshot with the essential command set and says it is expected to grow.
- Docs conflict: Current Playwright CLI documentation describes the later `@playwright/cli` package and differs in commands and session behavior from the v0.0.59 release. Its newer details were excluded.
- Docs conflict: The v0.0.59 release specifies `@playwright/mcp@latest`; current CLI documentation specifies `@playwright/cli@latest`. The package instructions differ.
FIRST-PARTY EVIDENCE
Check the installed version and the source before using it. Entry JSON