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@latest