Install
npm i -g @playwright/cli@latestWho it is for
This skill fits people who want one API to drive Chromium, Firefox, and WebKit. Officially it is written as a web automation and testing framework, usable for tests, scripts, and as a tool for coding agents. It also fits people already using coding agents such as Claude Code or Copilot who are ready to install the official command line. Those two names come from source examples; do not read them as the only supported tools.
It does not fit people who have not agreed to a global package install but want a whole test project generated at once. Officially there is also npm init playwright@latest, which initializes a test project; do not take that path the first time. If you only want the agent to use the command line first, the main path is a global install of @playwright/cli.
The official repository is https://github.com/microsoft/playwright Operate with commands already written on that page.
First attempt in 3 minutes
Follow only this install path the official page writes for coding agents.
Prerequisite: this machine can run npm, and you clearly agree to one global install. First confirm: npm i -g @playwright/cli@latest will install the command line globally. If you do not yet want to change global packages on this machine, do not run it. In this step do not initialize a test project and do not open a real site.
Install location: in any terminal, confirm the side effects above, then run:
npm i -g @playwright/cli@latest
Low-risk check: after install, first have the agent only restate this CLI’s use from the official notes — it is written as a browser-automation command line for coding agents, cheaper in tokens than MCP, and the commands avoid loading large tool schemas and accessibility trees into the model context. Do not start a browser. Do not send requests to an external site. If you later want a fuller agent integration, the source also has playwright-cli install --skills; that writes skill files, so confirm again before running it.
Success signal: the global install finished, the agent can point to the main command as @playwright/cli, and it did not switch to an installer that never appeared. If it runs npm init playwright@latest directly, it took the wrong path; stop.
Usage cases
Case 1: Install the official CLI for a coding agent. Next to Claude Code and Copilot the source writes npm i -g @playwright/cli@latest, then you may use playwright-cli install --skills to install a richer agent integration. It fits people who want the command line first and will decide later whether to write skill files. The second command changes the local skill directory; confirm before running it.
Case 2: Create a new end-to-end test project. The official command is npm init playwright@latest. It fits people who have already decided they want a test scaffold and agree that it will create project files. Init writes to disk; do not run it while you only want to try the command line. If the source does not write a browser-download switch, do not invent flags.
Boundaries
The main path is npm i -g @playwright/cli@latest. Do not write an unappeared installer into the main path. playwright-cli install --skills and npm init playwright@latest are two other commands in the source, with different uses; do not merge them into one.
Capability coverage is driving Chromium, Firefox, and WebKit with the same API, for tests, scripts, and coding agents. It does not prove it can drive an unnamed browser engine. Claude Code and Copilot are only a sample list.
The official page is https://github.com/microsoft/playwright
If the agent’s first suggested command is not a global install of @playwright/cli, treat that page as authoritative. Do not automate a production site on the first attempt.