---
title: "playwright-cli skill: browser automation and web testing"
canonical_url: https://cookiesforai.app/skills/microsoft/playwright-cli
last_updated: 2026-10-02T01:58:30+02:00
type: skill
summary: "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: "npx skills add microsoft/playwright-cli --skill playwright-cli"
related:
  - "https://cookiesforai.app/skills/trailofbits/mutation-testing"
  - "https://cookiesforai.app/skills/obra/systematic-debugging"
  - "https://cookiesforai.app/skills/mattpocock/tdd"
  - "https://cookiesforai.app/skills/obra/test-driven-development"
---

# 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.

| Fact | Value |
|---|---|
| Publisher | Microsoft (Playwright team) (official, own GitHub account) |
| Source | https://github.com/microsoft/playwright-cli/tree/HEAD/skills/playwright-cli |
| License | Apache-2.0 |
| Repository stars | 13,721 on 2026-10-02 |
| Skill name | playwright-cli |
| Category | Testing and debugging |
| Skill last changed | 2026-09-28 |
| Page updated | 2026-10-02 |
| Facts checked | 2026-10-02 |

## Install

Install the skill with the skills CLI:

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

Install the Playwright CLI itself, which the skill drives:

```
npm install -g @playwright/cli@latest
```

Or let the CLI install its own skills into your project:

```
playwright-cli install --skills
```

## Ask your coding agent

A skill can include scripts that run on your computer, so read its source first: https://github.com/microsoft/playwright-cli/tree/HEAD/skills/playwright-cli

```text
Install the agent skill playwright-cli from github.com/microsoft/playwright-cli.
```

## What it 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 it

- 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 it needs

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

## Which agents it works in

Microsoft (Playwright team) documents it 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 (listed with the CLI on 2026-10-01).

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.

## License

Apache-2.0.

## Related

### Related skills for testing and debugging

- [Mutation testing](https://cookiesforai.app/skills/trailofbits/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.
- [Systematic Debugging](https://cookiesforai.app/skills/obra/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.
- [TDD](https://cookiesforai.app/skills/mattpocock/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.
- [Test-Driven Development](https://cookiesforai.app/skills/obra/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.

