Playwright CLI Review 2026: The New Agent-First Tool Hiding in a Familiar Name
"Playwright CLI" sounds like the same npx playwright test command line you've used for years. In 2026 it also means something new: @playwright/cli, a separate package built specifically so coding agents like Claude Code, GitHub Copilot and Cursor can drive a browser without loading a giant accessibility tree into their context window. This review is about that new product — what it actually does, what it costs (nothing), and when you'd reach for it instead of Playwright MCP.
| Free / open-source? | Yes — Apache-2.0 |
| Package age | ~8 months (Jan 2026) |
| Current version | 0.1.21 — pre-1.0 |
| Bundled in Playwright since | v1.62.0 (Jul 24, 2026) |
| Best paired with | Agents with filesystem/shell access |
The name is legacy. The product underneath it is brand new.
"If you last touched 'Playwright CLI' as shorthand for npx playwright codegen, you're not wrong, and you're also missing the actual news: since January 2026 there's a real, separately-versioned package called @playwright/cli, built from scratch for AI coding agents, and Microsoft folded it directly into the main Playwright distribution five months later."
What makes this worth a full review rather than a footnote is the reasoning behind it. Playwright's own team decided that MCP — the thing they themselves helped popularize for browser automation — isn't always the right interface for a coding agent that already has a terminal. So they built a second one. That's a genuinely unusual thing for a vendor to do, and it's worth understanding both options before you wire either into a workflow.
One browser engine, exposed three different ways.
Under the hood, Playwright CLI, Playwright MCP and the classic playwright test runner all sit on the same Chromium/Firefox/WebKit automation engine Microsoft has maintained since 2020. What changed in 2026 is that there are now two distinct, purpose-built doors into that engine for AI agents — one exposed as MCP tools, one exposed as terminal commands — instead of forcing every agent through the same interface.
The asterisk worth flagging up front: this is still a pre-1.0 product. Current version is 0.1.21, published Sep 18, 2026 — actively evolving, not a finished, frozen API.
Young by the numbers, mature by the engine underneath it.
microsoft/playwright-cli, verified on GitHub, Sep 21, 2026.
@playwright/cli, week of Sep 14-20, 2026.
First published npm Jan 26, 2026.
microsoft/playwright, for scale context.
| When | What "Playwright CLI" meant | What changed it |
|---|---|---|
| ~2020 | An old, unrelated side-project at the same repo slug: "record actions, generate code, inspect selectors" | Superseded; that slug was later repurposed |
| Jan 26, 2026 | New @playwright/cli package first published — a token-efficient terminal command surface for coding agents | Built by the Playwright core team (pavelfeldman, yurys, dgozman-ms) |
| Jul 24, 2026 | Bundled directly into the main playwright package as npx playwright cli, alongside npx playwright mcp | Playwright v1.62.0 release notes, official |
Because it's new, the record is thinner — and that's disclosed, not papered over.
CLI is "best for coding agents (Claude Code, GitHub Copilot, etc.) that favor token-efficient, skill-based workflows," while MCP "remains relevant for specialized agentic loops that benefit from persistent state and iterative reasoning."
Because the CLI saves browser state to disk instead of streaming it into the model's context, it claims to cut token usage by roughly 4.6x versus MCP for equivalent agent workflows.
"Pick Playwright CLI when you need Firefox and WebKit coverage, Playwright traces, or your team already runs on Playwright" — the advantage is inherited from the engine, not invented fresh.
There isn't a plan to pick. That's the whole answer.
| Thing you might confuse with "pricing" | Actual status |
|---|---|
| @playwright/cli itself | Free, open-source, Apache-2.0 — no seat, no cap |
| Playwright the test framework | Free, open-source, always has been |
| Playwright MCP (sibling) | Free, open-source — reviewed separately |
| Microsoft Playwright Testing (Azure) | The one nearby paid Microsoft product — retired in 2026, folded into Azure App Testing at $0.01/Linux test-minute and $0.02/Windows test-minute, after a free trial tier. Unrelated to whether the CLI costs anything. |
Source: playwright.dev/agent-cli/introduction, registry.npmjs.org, azure.microsoft.com/en-us/products/playwright-testing — verified Sep 21, 2026.
The real question isn't "is it good?" — it's "does my agent have a shell?"
Playwright CLI is the officially recommended default.
Reach for Playwright MCP instead — reviewed separately.
You want plain
playwright test / codegen — this review is about the agent-facing CLI specifically.That's a different category — see the Browser Use review.
The whole design fits in one loop: snapshot, get a ref, act on it.
Every interaction starts with playwright-cli snapshot, which returns a compact, disk-saved representation of the page with short element references like e21 or e35. From there, commands like click e21, fill e35 "text", or hover e12 act directly on those refs — no screenshot round-trip, no re-parsing a giant accessibility tree on every step. The agent reads the compact snapshot once, then issues concise commands.
- Over 60 documented commands: navigation, mouse/keyboard, storage (cookies/localStorage/sessionStorage), emulation, network mocking, DevTools.
playwright-cli showopens a live visual dashboard of every running session, with click-to-take-over remote control.- Sessions persist cookies/state in memory by default, or to disk with
--persistent.
- Skills-less operation exists (the agent reads
--helpon its own) but the documented, supported path is installing skills first. - Pre-1.0 versioning means command syntax can still shift between releases.
The agent drives; the CLI just remembers state so it doesn't have to.
Official Playwright video: giving a coding agent's UI changes a real review pass using playwright-cli.
Published by the official "Playwright" YouTube channel (youtube.com/@Playwrightdev).
The part that makes this feel like real infrastructure, not a script.
Playwright CLI is headless by default; pass --headed to watch it work. Sessions keep their browser profile in memory (add --persistent to survive restarts), can be named and multiplexed with -s=<name>, and auto-expire after an hour of inactivity when headless (configurable via --idle-timeout). You can run a whole coding agent against a named session via the PLAYWRIGHT_CLI_SESSION environment variable — useful for keeping one project's browser state isolated from another's.
The team that built both is unusually candid about when not to use theirs.
This is the one decision this whole review keeps circling back to, so it gets its own comparison — plus a second official video, since the Playwright team itself made one specifically to explain the split.
| Dimension | Playwright CLI | Playwright MCP |
|---|---|---|
| Interface | Terminal commands, disk-saved state | MCP tool calls, streamed into context |
| Best client | Agents with filesystem/shell (Claude Code, Copilot, Cursor) | MCP-native clients (Claude Desktop, VS Code, Windsurf, Cline, Goose) |
| Token profile | Lower — claimed ~4.6x less per independent benchmark | Higher — full tool schemas + accessibility snapshots in-context |
| Best for | High-throughput, code-heavy agent loops | Long-running, stateful, exploratory agentic loops |
| First released | Jan 26, 2026 | Mar 13, 2025 |
Official Playwright video comparing the two head-to-head.
Published by the official "Playwright" YouTube channel (youtube.com/@Playwrightdev).
The CLI is free. Running agents and CI at scale still costs something, somewhere else.
| What you're actually paying for | Approx. cost |
|---|---|
| playwright-cli itself | $0 — Apache-2.0 |
| The LLM tokens your coding agent spends per step | Your model provider's own rate; this is exactly what the CLI's disk-state design is trying to reduce |
| CI runner minutes (GitHub Actions, etc.) | Your CI provider's standard compute rate |
| Azure App Testing (optional, if you want managed cloud execution) | $0.01/Linux test-minute, $0.02/Windows test-minute, after a free trial — the successor to the retired Microsoft Playwright Testing service |
An agent with a working browser session can do anything you can do in it.
People whose agent already lives in a terminal.
| Situation | Why Playwright CLI fits | What to reach for instead |
|---|---|---|
| Using Claude Code, GitHub Copilot CLI, or Cursor's agent mode | Filesystem/shell access is exactly what the CLI assumes | — |
| High volume of small agent-driven UI checks per session | Disk-backed state keeps token cost down across many steps | — |
| Chat-only MCP client (Claude Desktop, some IDE chat panes) | No shell to run commands from | Playwright MCP |
| Need a fully autonomous agent that plans its own multi-step browsing | The CLI is a command surface, not a planner | Browser Use |
| Writing deterministic, hand-authored test suites | Not the CLI's job | Classic playwright test / codegen |
Three real gaps, not manufactured ones.
~8 months old, pre-1.0 (0.1.21). Command syntax and behavior can still shift between releases in ways a 1.0-stable tool wouldn't.
Because it's new, there isn't yet a deep well of independent Reddit/HN sentiment specifically about the CLI (as opposed to Playwright generally, or MCP specifically) — disclosed here rather than papered over.
The entire pitch collapses if your agent is a pure chat client with no filesystem/terminal — that's explicitly MCP's territory instead.
Because both run on the same engine, the "agent with real session cookies can do real damage" caution applies to the CLI too, even though the well-known browser_run_code_unsafe report was filed against the MCP server specifically.
If the CLI's assumptions don't match your setup, here's how to think about it.
| If you mostly need... | Compare Playwright CLI with... |
|---|---|
| A chat-native MCP client driving the browser | Playwright MCP — reviewed separately |
| A fully autonomous agent that plans its own browsing, not just executes commands | Browser Use — reviewed separately |
| Chrome-only automation without Firefox/WebKit | Puppeteer (pptr.dev) |
| The longest-established cross-browser standard | Selenium (selenium.dev) |
| Hybrid hand-written flows with AI filling in the flexible parts | Stagehand (stagehand.dev) |
No affiliate relationship shapes this review.
JAVIS has not established a publisher affiliate program with Microsoft or the Playwright project. Every CTA here points to the official documentation or the open-source repository.
Go to the official docs.
Open Playwright CLI docsRead the alternative that matches your real question.
Choose the next articlePlaywright CLI makes the most sense next to the tools it's directly answering.
Questions people are actually searching right now
Is Playwright CLI the same as npx playwright test?
No. playwright test and codegen are the classic test-runner commands that have existed for years. Playwright CLI is the newer package name (@playwright/cli) for a separate, agent-facing command surface, first published Jan 26, 2026.
Is Playwright CLI free?
Yes. It's Apache-2.0 licensed with no seat, subscription, or usage cap of its own.
Is Playwright CLI better than Playwright MCP?
Not "better" — different. Official guidance and independent benchmarks agree: CLI suits token-conscious, shell-based coding agents; MCP suits persistent, stateful agentic loops and chat-native clients.
Do I need to install skills separately?
The CLI can run "skills-less" by having an agent read playwright-cli --help directly, but the documented, supported path is playwright-cli install --skills so agents like Claude Code and GitHub Copilot pick up richer, structured guidance.
How is Playwright CLI different from a plain shell script calling Playwright?
It saves browser/session state to disk between calls and returns compact element references (like e21) instead of forcing every step to re-parse a full page — the design specifically targets keeping tokens out of an agent's context window.
Does Playwright CLI replace Playwright Test for CI?
No. It's built for agent-driven, exploratory or one-off browser tasks, not for authoring your deterministic CI test suite — that remains playwright test's job.
Is there a hosted/cloud version of Playwright CLI?
Not of the CLI itself. The adjacent paid Microsoft product (Microsoft Playwright Testing) was retired in 2026 and folded into Azure App Testing, a separate managed test-execution service.
Where this came from, and when it was checked.
GitHub stats (stars/forks/license/issues): GitHub data for github.com/microsoft/playwright-cli, Sep 21, 2026.
npm package history/version: registry.npmjs.org/@playwright/cli, read directly, Sep 21, 2026.
npm weekly downloads: api.npmjs.org/downloads/point/last-week/@playwright/cli, Sep 21, 2026.
Bundling into Playwright core: official GitHub release notes for v1.62.0, api.github.com/repos/microsoft/playwright/releases/tags/v1.62.0.
Command reference and session model: raw.githubusercontent.com/microsoft/playwright-cli/main/README.md, official, read directly.
Azure App Testing pricing / Playwright Testing retirement: azure.microsoft.com/en-us/products/playwright-testing, official, quoted verbatim.
Real screenshots/media: repository-images.githubusercontent.com (Playwright's own preview image), opengraph.githubassets.com repo card, github.com/user-attachments README screenshot.
Official videos: youtube.com/watch?v=2YWPJjOa-2w and youtube.com/watch?v=Be0ceKN81S8, authorship confirmed on YouTube (author "Playwright", channel @Playwrightdev).
Security precedent: github.com/microsoft/playwright-mcp/issues/1651, verified closed 2026-06-15 via GitHub.
Independent commentary: testdino.com, testcollab.com, test-lab.ai, bug0.com.
