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.

Checked by CookiesForAI on : license and last change of the skill re-read from GitHub.

Written by

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. Checked by CookiesForAI on : license and last change of the skill re-read from GitHub. 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 ). 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.

We also list this company's other pages: Microsoft Learn MCP server and Playwright MCP server.

Playwright CLI license

Playwright CLI is published under Apache-2.0.

Lists that include playwright-cli