playwright-cli

Playwright CLI

playwright-cli is Microsoft's agent skill for driving a real browser from the terminal: open pages, click and fill by element reference, take snapshots and screenshots, mock requests and generate Playwright tests.

Install Playwright CLI

Install the skill with the skills CLI

Terminal
npx skills add microsoft/playwright-cli --skill playwright-cli

Install the Playwright CLI itself, which the skill drives

Terminal
npm install -g @playwright/cli@latest

Or let the CLI install its own skills into your project

Terminal
playwright-cli install --skills

Or paste this into your coding agent: Install the agent skill playwright-cli from github.com/microsoft/playwright-cli. A skill can include scripts that run on your computer, so read its source first.

What Playwright CLI does

Playwright CLI is a skill from Microsoft's Playwright team that teaches a coding agent the playwright-cli command set. Instead of loading a browser tool schema into context, the agent runs short shell commands: open a page, read an accessibility snapshot with element references such as e15, then click, type, fill, drag, upload or select by that reference. Each command prints a fresh snapshot so the agent sees what changed.

The command set covers more than clicking. The agent can save and load login state, read and set cookies and local storage, emulate dark mode, reduced motion or a mobile device, mock network routes, read console messages and requests, record traces and videos, and run Playwright code directly. Named sessions keep separate browsers for separate projects, and a show command opens a dashboard where you can watch or step in.

Reference files bundled with the skill cover writing and generating Playwright tests, request mocking, storage state, tracing and video recording. The README positions the CLI against Playwright MCP: the CLI is meant to use fewer tokens for coding agents, while MCP suits long exploratory loops that need continuous page state.

When to use Playwright CLI

  • You want your agent to test a sign-up or checkout flow in a real browser and take screenshots.
  • You need a Playwright test written from steps the agent just performed.
  • You want to check how a page behaves in dark mode, on a phone, or with an API mocked.
  • Your agent's browser tool eats too much context and you want a lighter option.

When to pick something else

  • Long exploratory sessions where the agent should keep the page state in view all the time: Microsoft points to Playwright MCP for those.

What Playwright CLI needs

  • Node.js 18 or newer
  • The @playwright/cli package installed globally

Which agents Playwright CLI works in

Microsoft (Playwright team) documents Playwright CLI for Claude Code, GitHub Copilot, Any agent that reads SKILL.md files, through the skills CLI. The open skills CLI also installs it into 78 agents, including Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode (we listed it with the CLI on October 1, 2026). See where each agent looks for skills.

The SKILL.md frontmatter pre-approves only playwright-cli and npx playwright shell commands (allowed-tools). Agents that ignore that key still work but may ask permission for each command.

Playwright CLI license

Playwright CLI is published under Apache-2.0.

  • Mutation testing: mutation-testing is Trail of Bits' agent skill for configuring mutation testing campaigns with its mewt or muton tools, reading surviving mutants, telling equivalent mutants from real test gaps, and hunting bugs they expose. (7,328 repository stars on October 2, 2026)
  • Systematic Debugging: Systematic Debugging is an agent skill from Superpowers that makes your agent find the root cause of a bug or failing test before it proposes any fix, instead of guessing. (293,976 repository stars on October 2, 2026)
  • TDD: tdd is Matt Pocock's agent skill for test-driven development: the agent agrees which public interfaces to test with you, then works one failing test and one minimal fix at a time. (273,901 repository stars on October 2, 2026)
  • Test-Driven Development: Test-Driven Development is an agent skill from Superpowers: your agent writes a failing test first, watches it fail, then writes only the code needed to make it pass. (293,976 repository stars on October 2, 2026)

Lists that include playwright-cli