Releases: microsoft/playwright-cli
v0.1.14
Highlights
- Annotate actions in recorded videos — new
video-show-actions/video-hide-actionscommands draw a callout naming each action and highlighting its target in the recording. (microsoft/playwright#40914) exposeNetworkand other connect options for remote browsers —remoteEndpointnow accepts a fullConnectOptionsobject, so settings likeexposeNetworkand headers apply to remote connections. (microsoft/playwright#40964)- Bounded output size —
--output-max-sizecaps captured output and evicts to disk after the response, keeping large sessions manageable. (microsoft/playwright#41031)
Fixes
fix(cli): support attaching to a Playwright browser server endpoint(microsoft/playwright#41154) —playwright-cli attach --endpoint=<ws-url>connects to a running browser server instead of erroring out. (microsoft/playwright#41203)fix(mcp): support moz-firefox BiDi channels via --browser— connect to Firefox over BiDi using--browser. (microsoft/playwright#41126)fix(mcp): keep remoteHeaders working for remote browser endpoint— custom headers are sent again when connecting to a remote endpoint. (microsoft/playwright#41156, #40828)fix(cli): persist traces when CLI attaches to existing CDP browser— traces are now saved when attaching over CDP. (microsoft/playwright#40810)fix(cli): accept single --modifiers value for click and dblclick—--modifiers=Shiftworks without requiring a list. (microsoft/playwright#40784)fix(cli): trim overlong session names to fit unix socket path limit— long session names no longer break the daemon socket. (microsoft/playwright#40898)fix(cli): do not pass PLAYWRIGHT_CLI_SESSION as daemon --endpoint— fixes spurious endpoint resolution from the session env var. (microsoft/playwright#41019)fix(mcp): report missing ffmpeg distinctly from missing browser— clearer error when video recording fails due to a missing ffmpeg. (microsoft/playwright#40867)fix(mcp): report invalid tool arguments— invalid arguments now produce a readable error instead of failing silently. (microsoft/playwright#40979)fix(mcp): use writable cache dir for MCP user data, not browsers path— avoids permission errors on read-only browser installs. (microsoft/playwright#40961)fix(mcp): use waitUntil commit for navigate back/forward— back/forward navigation resolves more reliably. (microsoft/playwright#41153)fix(mcp): tear down dashboard server on cli show --kill—cli show --killfully stops the dashboard. (microsoft/playwright#40968)fix(tracing): mkdir tracesDir before live .stacks writes— fixes a crash when the traces directory does not yet exist. (microsoft/playwright#40730)docs(cli): document & URL escaping on Windows— guidance on escaping&in URLs on cmd.exe and PowerShell. (microsoft/playwright#40742)
Upgrading
npm install -g @playwright/cli@0.1.14v0.1.13
Fixes
fix(mcp): forward browser-level CDP commands in extension mode—cookie-list,state-save, and other browser-scoped commands now work when attached via the Chrome extension. (microsoft/playwright#40706)
v0.1.12
Highlights
-
Chrome extension now supports multiple tabs (#373 —
tab-new,tab-list, etc. work inattach --extensionsessions. -
Multi-screenshot UI Review in the dashboard — collect, annotate, and submit several screenshots in one dashboard session, with a sidebar of frames and per-comment highlight.
Fixes
fix(mcp): recover from page renderer crash— the current tab is reopened automatically when its renderer crashes. (microsoft/playwright#40617)fix(mcp): auto-recover when remote browser disconnects mid-session— the next tool call transparently reconnects. (microsoft/playwright#40652)fix(mcp): anchor aria-ref regex in target resolution— locators withe\d+substrings are no longer misclassified. (microsoft/playwright#40610)fix(mcp): skip base64 image when filename is provided— explicit-filename screenshots no longer also embed the image in the response. (microsoft/playwright#40577)
v0.1.11
Fixes
fix(dashboard): handle null viewport in annotate screenshot—playwright-cli annotateagainst a headed browser launched withviewport: nullproduced an empty annotated screenshot; the dashboard now falls back towindow.innerWidth/innerHeight. (microsoft/playwright#40569)
v0.1.10
Highlights
-
Network inspection split into numbered commands (#377) —
networkis replaced with:requests— numbered list of requests with stable indexesrequest <num>— full details for one requestrequest-headers <num>,request-body <num>,response-headers <num>,response-body <num>— pipe-friendly part extractors
Bodies are no longer inlined; pass
--filenameon any part-command to save the result to a file. (microsoft/playwright#40447, microsoft/playwright#40454) -
Spec-driven testing skill — a new
references/spec-driven-testing.mdreference guides agents through a plan / generate / heal workflow for driving Playwright tests from a written spec. (microsoft/playwright#40460)
Behavior changes
- Read-only data-fetching commands (
cookie-list,cookie-get,localstorage-list,localstorage-get,sessionstorage-list,sessionstorage-get,route-list,request-headers,request-body,response-headers,response-body) now emit raw output by default — no more### Resultwrapper, no--rawneeded. (microsoft/playwright#40473) - Extension mode now ignores the
browsersection of any loaded config file (bothuserDataDirandexecutablePath); only the browser/channel from--browserorPLAYWRIGHT_MCP_BROWSERapplies. (microsoft/playwright#40475) requestsnow appends a hint when static requests are filtered out, telling the user to pass--staticto see them. (microsoft/playwright#40454)
Fixes
fix(cli): resolve initPage/initScript paths and surface load errors(#290) — relativeinitPage/initScriptpaths from--configfiles now resolve against the config dir (matching Vite/Vitest/ESLint), and CLI-flag / env-var entries resolve againstcwd. Load errors are no longer silently swallowed. (microsoft/playwright#40451)fix(mcp): detect extension in non-default Chrome profiles— the--extensionpreflight now scans everyProfile *subdirectory under the user data dir, not justDefault. (microsoft/playwright#40471)fix(mcp): surface unhandled rejections instead of crashing the server— async errors from user-installed callbacks (e.g. apage.routehandler) are now reported on the next tool response instead of tearing down the MCP transport. (microsoft/playwright#40452)
v0.1.9
Highlights
-
show --annotate— provide agent with visual and structural feedback while developing or testing. (microsoft/playwright#40262, microsoft/playwright#40238)
-
dropcommand for files and clipboard-like data — drop files or typed data (text/plain,text/html, etc.) onto an element from outside the page. Useful for file-upload widgets and drag-from-desktop scenarios whereuploaddoesn't fit. (microsoft/playwright#40367, microsoft/playwright#40283) -
highlightcommand for visual confirmation — show a persistent highlight overlay on an element (with optional custom CSS via--style), and hide one or all overlays with--hide. Lets coding agents visually confirm what they're about to act on. (microsoft/playwright#40213, microsoft/playwright#40215, microsoft/playwright#40219) -
generate-locatorcommand — produce a stable Playwright locator expression for an element ref. Pair with--rawto feed locators straight into test assertions. (microsoft/playwright#40313) -
--jsonglobal flag — wrap every reply as structured JSON for machine parsing. (microsoft/playwright#40284)> playwright-cli eval --json "document.body.childNodes.length" { "result": "4" }
-
snapshot --boxes— include each element's bounding box as[box=x,y,width,height]in aria snapshots, making it easy to drive coordinate-based tools off of a snapshot. (microsoft/playwright#40389)- paragraph [ref=e35] [box=86,381,700,99]: - text: One API to drive Chromium, Firefox, and WebKit — in your tests, your scripts... - link "TypeScript" [ref=e36] [cursor=pointer] [box=535,417,98,27]: - /url: https://playwright.dev/docs/intro - text: "," - link "Python" [ref=e37] [cursor=pointer] [box=644,417,66,27]: - /url: https://playwright.dev/python/docs/intro - text: "," - link ".NET" [ref=e38] [cursor=pointer] [box=721,417,42,27]: - /url: https://playwright.dev/dotnet/docs/intro - text: ", and" - link "Java" [ref=e39] [cursor=pointer] [box=127,450,38,27]: - /url: https://playwright.dev/java/docs/intro
-
Discover attachable system browsers with
list --all— surfaces Chrome/Edge instances running with remote debugging soattach --cdp=<channel>has something to connect to. (microsoft/playwright#40253, microsoft/playwright#40342) -
detachcommand and channel-named attach sessions — attach sessions now use the channel name (e.g.chrome,msedge) and can be cleanly detached without closing the underlying browser. (microsoft/playwright#40408) -
Skill discoverable from
--help—playwright-cli --helpnow prints the path to the installed agent skill, so coding agents can find it without being told. (microsoft/playwright#40274) -
run-codeaccepts a file —playwright-cli run-code --filename=./script.jsruns a Playwright snippet from disk instead of the command line. (microsoft/playwright-cli#337)
Behavior changes
attachnow requires an explicit target; bareattachis no longer allowed. (microsoft/playwright@f7555ef)- The "Playwright MCP Bridge" extension has been renamed to "Playwright Extension", and the CLI now warns when the extension is missing from the target profile. (microsoft/playwright#40259, microsoft/playwright#40406)
- CLI option names have been tidied up to be friendlier for Claude Code and other agents. (microsoft/playwright#40369)
Fixes
fix(cli): exit daemon when extension connection fails— no more orphaned daemons when the browser extension can't connect. (microsoft/playwright#40328)fix(cli): prefix bare filenames with ./ in printed links— output file links now open reliably in terminals and editors. (microsoft/playwright#40311)fix(cli): show "(no browsers)" when list is empty without --all— clearer empty-state output fromlist. (microsoft/playwright#40277)fix(mcp): disable CDP timeout for extension connection— long-running extension attaches no longer time out. (microsoft/playwright#40265)fix(mcp): support page close via extension in protocol v2— closing tabs through the extension works again. (microsoft/playwright#40249)fix(mcp): throw clear error for tab creation in extension protocol v1— replaces a cryptic failure with a readable message. (microsoft/playwright#40261)fix(mcp): ensure --proxy-server overrides config-file proxy— explicit CLI proxy now wins over the config value. (microsoft/playwright#40212)fix(server): close browsers when PlaywrightServer shuts down— cleaner shutdown, no lingering browser processes. (microsoft/playwright#40294)
Upgrading
npm install -g @playwright/cli@latestv0.1.8
Highlights
- Remote debugging mode against your local Chrome (#358) — you can now drive the Chrome you already have open, with its existing logins, instead of a sandboxed copy.
playwright-cli attach --cdp=chrome(alsomsedge,chrome-canary, etc.) resolves the channel and connects viachrome://inspect/#remote-debugging. Supports Chrome / Chrome Beta / Dev / Canary and Edge / Edge Beta / Dev / Canary on Linux, macOS, and Windows. (microsoft/playwright#40177) - Heavy CPU/memory and orphaned Chrome processes (#360) — no more manually killing leftover Chrome processes after long CLI/agent sessions. (microsoft/playwright#40190)
Fixes
fix(mcp): no tombstones on the server registry level— defaultsbrowserTokento'chrome'when none is specified (no moreundefinedin userDataDir paths); simplifies stale-entry cleanup in the server registry; passesforceto session stop duringdelete-data. (#40179)
Upgrading
npm install -g @playwright/cli@0.1.8v0.1.7
What's Changed
Fixes
- snapshot: resolve element refs correctly so snapshots taken after navigation no longer fail to look up references (microsoft/playwright#40114)
- kill-all: match the current
cliDaemon.jsprocess soplaywright-cli kill-allactually terminates running daemons (microsoft/playwright#40165)
v0.1.6
v0.1.5
What's New
Pipe CLI Output with --raw
The new global --raw flag strips page status, generated code, and snapshot sections from the output, returning only the result value. Use it to pipe command output into other tools:
playwright-cli --raw eval "JSON.stringify(performance.timing)" | jq '.loadEventEnd - .navigationStart'
playwright-cli --raw eval "JSON.stringify([...document.querySelectorAll('a')].map(a => a.href))" > links.json
TOKEN=$(playwright-cli --raw cookie-get session_id)
playwright-cli --raw localstorage-get theme
playwright-cli --raw snapshot > before.yml
playwright-cli click e5
playwright-cli --raw snapshot > after.yml
diff before.yml after.ymlCommands that don't produce output return nothing.
Attach to Browser via CDP
The attach command now supports connecting to an existing browser via a CDP endpoint URL:
playwright-cli attach --cdp=http://localhost:9222This makes it easy for coding agents to connect to a browser that's already running (e.g. a dev browser or a remote debugging target) without launching a new one.
attach --extension Replaces open --extension
Connecting to a browser via the Playwright MCP Bridge extension has moved from open to the dedicated attach command. You can also specify the browser:
playwright-cli attach --extension
playwright-cli attach --extension=chrome
playwright-cli attach --extension=msedgeBug Fixes
tab-newnow navigates to the URL when provided — previouslyplaywright-cli tab-new https://example.comopened a blank tab instead of navigating.listcommand no longer fails whenworkspaceDiris undefined — fixes a crash when runningplaywright-cli listoutside a workspace.