Playwright CLI
playwright-cli
Microsoft's official Playwright CLI with an agent skill: drive a browser through short commands without heavy MCP schemas
- 14,721 ★ on the repository
- Last commit
- Apache-2.0
Extended access
Why this level
- Launches a browser and runs JavaScript on pages
- Can save and load cookies and auth state
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/playwright-cliDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- Launches a browser and runs JavaScript on pages
- Can save and load cookies and auth state
This is third-party code. Review the repository files before installing.
What it does
The CLI gives the agent browser commands: open a page, click, fill a field, take an accessibility snapshot, search the snapshot, screenshot or save a PDF. It handles tabs, cookies and localStorage, network mocking, console and request inspection, traces, video and action recording that emits Playwright code. Snapshots are saved to files, so page data does not flood the model context. Sessions keep separate browsers per project, and the show command opens a dashboard to watch agents and take over control.
Who it is for. For developers and QA engineers who want the agent to test web apps in a browser with fewer tokens than MCP.
Good fit when
- The agent should walk through a user flow and take screenshots
- You need to record actions and get Playwright test code
- Agent context is tight and MCP schemas are too costly
Not a fit when
- You need a long autonomous loop with persistent page state; Playwright MCP fits better
- The agent cannot run shell commands
Example request
Using playwright-cli, test the add todo flow on demo.playwright.dev/todomvc and take screenshotsLimitations
Requires Node.js 18 or newer and shell access. Headless sessions close after an hour idle. WebMCP is experimental and works only in Chromium and Firefox with special flags.
How to disable. Remove the package with npm uninstall -g @playwright/cli and delete the playwright-cli skill folder.
FAQ
Why CLI over Playwright MCP?
It avoids loading large tool schemas and accessibility trees into context, so it is cheaper. MCP stays better for long loops with persistent state.
Does it work without the skill?
Yes, just tell the agent to check playwright-cli --help.
Which should I pick: Playwright MCP, CLI or a skill?
MCP fits when an agent needs standing browser access over the protocol. The CLI gives short commands and saves snapshots to files, so context stays clean. The Playwright skill writes and runs its own scripts, the path for tests and page checks.
Discussion
No questions or reviews yet.
Related
CLI toolsA skill that lets an agent write and run Playwright scripts: page tests, forms, screenshots and link checks
A community Playwright MCP server: browser automation, screenshots, device emulation and test code generation
A skill that tests your agent's code in a real browser: reads your changes, builds a test plan and runs it through Playwright with your own cookies
A Claude Code skill for driving the 1C web client through Playwright MCP: sessions, navigation, catalogs, documents and test data
One binary for agent browser automation: a CLI with browser and check skills, an MCP server and clients for JS, Python and Java
QA agents, skills and an MCP server: test generation, coverage gaps, flaky tests, security scans and chaos testing
Comparison with similar tools
Entries that share the main search query, and how they differ.
README in short
The README compares the CLI with Playwright MCP and explains why CLI plus skills is cheaper for coding agents. Install is via npm plus a separate skills command. It then gives a full command reference grouped into core, navigation, keyboard, mouse, storage, network, DevTools, WebMCP and open options. Sessions, the monitoring dashboard and snapshot format are covered.
README badge
Original SKILL.md
--- name: playwright-cli description: Automate browser interactions, test web pages and work with Playwright tests. allowed-tools: Bash(playwright-cli:*) Bash(npx:*) Bash(npm:*) --- # Browser Automation with playwright-cli ## Quick start ```bash # open new browser playwright-cli open # navigate to a page playwright-cli goto https://playwright.dev # interact with the page using refs from the snapshot playwright-cli click e15 playwright-cli type "page.click" playwright-cli press Enter # take a screenshot (rarely used, as snapshot is more common) playwright-cli screenshot # close the browser playwright-cli close ``` ## Commands ### Core ```bash playwright-cli open # open and navigate right away playwright-cli open https://example.com/ playwright-cli goto https://playwright.dev playwright-cli type "search query" playwright-cli click e3 playwright-cli dblclick e7 # --submit presses Enter after filling the element playwright-cli fill e5 "user@example.com" --submit playwright-cli drag e2 e8 playwright-cli hover e4 playwright-cli select e9 "option-value" playwright-cli upload ./document.pdf playwright-cli check e12 playwright-cli uncheck e12 playwright-cli snapshot