playwright-cli
With playwright-cli you have Claude control a browser through commands, check web pages, simulate network responses and debug Playwright tests from the terminal.
What is playwright-cli?
playwright-cli is a skill for Claude Code that lets Claude control a real browser through the playwright-cli command line tool. Claude opens pages, clicks, fills in forms, uploads files and reads the page through a snapshot in which every element gets a short reference such as e15. The agent uses these references for its next actions. The skill comes from Microsoft and is licensed under Apache-2.0.
Beyond basic interaction, the skill covers tabs, cookies, LocalStorage and SessionStorage, plus emulation of dark mode, reduced motion or print media, network mocking, console and request logs, tracing, video recording and screenshots. With 'playwright-cli recording-start' it records actions and prints them as Playwright code when you stop. If a page offers experimental WebMCP tools, Claude can call them directly.
The skill suits developers, testers and teams who review web interfaces or maintain Playwright tests. You pause a failing test with the '--debug=cli' option, then Claude connects to the session with 'playwright-cli attach'. It requires playwright-cli to be callable on your machine. The skill only permits Claude to run playwright-cli and npx playwright commands.
Who it is for
For developers, QA teams and anyone who tests web interfaces, maintains Playwright tests or wants an agent to handle browser workflows.
Use cases
- You built a UI change and have Claude click through the flow locally, take a screenshot and attach it to the pull request.
- A Playwright test fails, and you want Claude to pause it in debug mode, inspect the page and find the cause.
- You want to see how your frontend handles a broken API response, so Claude answers the request with a mocked status code.
What playwright-cli does
Snapshot with element references
With 'playwright-cli snapshot' Claude reads the page structure and every element gets a reference. With 'playwright-cli find' it searches the snapshot for text or regular expressions.
Mock network requests
With 'playwright-cli route' Claude replaces responses with custom status codes, JSON bodies or headers, strips headers from requests and removes rules again with 'playwright-cli unroute'.
Actions as Playwright code
'playwright-cli recording-start' and 'playwright-cli recording-stop' capture clicks and input in the browser and print them as Playwright code you can reuse in tests.
Debug Playwright tests
A test run with '--debug=cli' pauses at the start. Claude connects with 'playwright-cli attach', inspects the page step by step and looks for the cause of the failure.
Save browser state
'playwright-cli state-save' stores the session state in a file such as auth.json, and 'playwright-cli state-load' restores it. You can also read and set cookies and storage entries one by one.
Screenshots and videos for PRs
Screenshots, PDFs and videos with chapters come straight from the session. With gh 2.99 or later you attach them to pull requests or issues.
Say this to activate the skill
"Open the app on localhost and check whether the login form works.""Debug the failing Playwright test in the checkout.""Take a screenshot of the settings page in dark mode.""Record my clicks and turn them into Playwright code." Install
npx skills add microsoft/playwright-cli --skill playwright-cli
The command installs the original version from the author's repository (Vercel skills CLI, needs Node.js), add -g for all projects. We do not host a copy: updates come straight from the author. Need help with setup? How to install skills →
Figures with source and date
- GitHub stars
- ≈ 15,000
- Installs
- 211,373
- On skills.sh since
- 23 Jan 2026
- Last change in the repository
- 5 Nov 2026
- Licence
- Apache-2.0
As of 9 Nov 2026. Sources: GitHub, skills.sh. The figures change daily; we show the state of our last lookup.
Checked automatically
- Automated check on 2026-11-09 (revision 4bc00fb): 11 files in the skill folder read by pattern search. It found no hidden characters, no instructions to override rules, no download-and-run and no access to credentials.
Independent checks on skills.sh, as of 9 Nov 2026
| Gen Agent Trust Hub | Pass |
|---|---|
| Socket | Pass |
| Snyk | Warn |
Good to know
- Files from 'playwright-cli state-save' can contain session cookies. Treat them like credentials and keep them out of your repository.
- Tools a web page offers through WebMCP come from the page itself. The skill tells Claude to treat them as untrusted input.
- By default the browser uses an in-memory profile. Profile data only persists between sessions with '--persistent'.
- Attaching screenshots and videos to pull requests requires the gh tool in version 2.99 or later.
- One auditor on skills.sh reports a warning (Snyk). Read its notes before bringing the skill into projects with sensitive data.
- The check is an automated pattern search, not a security guarantee, and reads the skill folder only. The command always installs the author's current version; later versions have not been reviewed by us.
Frequently asked questions about playwright-cli
What is playwright-cli?
playwright-cli is a skill from Microsoft that lets Claude control a browser from the command line. It opens pages, interacts with elements via snapshot references, mocks network requests, captures screenshots and videos and helps you debug Playwright tests.
How do I install playwright-cli?
You install playwright-cli with the command 'npx skills add microsoft/playwright-cli --skill playwright-cli'. The skill expects the playwright-cli command line tool to be callable on your machine.
Is playwright-cli free?
playwright-cli is licensed under Apache-2.0. You may use, adapt and share the skill as long as you follow the terms of that license, such as its attribution requirements.
Who is playwright-cli for?
playwright-cli is for anyone who builds or tests web applications and wants Claude to operate a browser along the way. It fits especially well if your project already has Playwright tests, since the skill can run them and help you debug them.
Can playwright-cli generate Playwright code?
playwright-cli produces matching Playwright TypeScript code for actions in the browser, which you can copy into your tests. With 'playwright-cli generate-locator' you also get locators for individual elements.
Which browsers does playwright-cli support?
playwright-cli can launch Chrome, Firefox, WebKit and Microsoft Edge when it opens a session. With the '--mobile' option the skill emulates a generic mobile device, and with '--device' a specific model.
Share this skill
About this skill
playwright-cli comes from microsoft and is an open-source project maintained by its author and community.
Author: microsoft / github.com. Source: github.com/microsoft/playwright-cli/tree/main/skills/playwright-cli. Licence: Apache-2.0.
Curated by Collective Brain, an AI and automation digital agency from Hamburg, together with WhiteFox Automations. More vetted skills in the skills catalog.
Working in Germany, Austria or Switzerland? We help teams roll out Claude, in English or German.
Want this skill tailored to your team?
playwright-cli is a strong starting point. A skill gets really powerful once it knows your workflows, templates and tone of voice. We build custom skills for teams, from analysis to rollout, and connect them to our work in AI consulting.
Request a custom skill →