Skip to content

Releases: microsoft/playwright-cli

v0.1.9

25 Apr 03:20
ee24ded

Choose a tag to compare

Highlights

  • show --annotate — provide agent with visual and structural feedback while developing or testing. (microsoft/playwright#40262, microsoft/playwright#40238)

    Screenshot from 2026-04-24 17-58-53
  • drop command 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 where upload doesn't fit. (microsoft/playwright#40367, microsoft/playwright#40283)

  • highlight command 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-locator command — produce a stable Playwright locator expression for an element ref. Pair with --raw to feed locators straight into test assertions. (microsoft/playwright#40313)

  • --json global 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 so attach --cdp=<channel> has something to connect to. (microsoft/playwright#40253, microsoft/playwright#40342)

  • detach command 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 --helpplaywright-cli --help now prints the path to the installed agent skill, so coding agents can find it without being told. (microsoft/playwright#40274)

  • run-code accepts a fileplaywright-cli run-code --filename=./script.js runs a Playwright snippet from disk instead of the command line. (microsoft/playwright-cli#337)

Behavior changes

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 from list. (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

v0.1.8

14 Apr 19:03
0406ada

Choose a tag to compare

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 (also msedge, chrome-canary, etc.) resolves the channel and connects via chrome://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 — defaults browserToken to 'chrome' when none is specified (no more undefined in userDataDir paths); simplifies stale-entry cleanup in the server registry; passes force to session stop during delete-data. (#40179)

Upgrading

npm install -g @playwright/cli@0.1.8

v0.1.7

12 Apr 00:03
1a3b1f3

Choose a tag to compare

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.js process so playwright-cli kill-all actually terminates running daemons (microsoft/playwright#40165)

v0.1.6

07 Apr 23:29
278fcad

Choose a tag to compare

Bug Fixes

  • Dashboard: current workspace sessions are shown first and expanded — fixes ordering and expansion of the current workspace group in playwright-cli show when running outside a workspace.

v0.1.5

03 Apr 18:12
a0d5bfd

Choose a tag to compare

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.yml

Commands 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:9222

This 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=msedge

Bug Fixes

  • tab-new now navigates to the URL when provided — previously playwright-cli tab-new https://example.com opened a blank tab instead of navigating.
  • list command no longer fails when workspaceDir is undefined — fixes a crash when running playwright-cli list outside a workspace.

v0.1.4

01 Apr 18:03
4a11584

Choose a tag to compare

  • chore: roll Playwright to 1.60.0-alpha-1775061447000

v0.1.3

01 Apr 00:16
084d0c0

Choose a tag to compare

  • Maintenance release off 1.59 branch point

v0.1.2

31 Mar 17:24
9776231

Choose a tag to compare

What's New

🎬 Richer Video Recording

The video-start / video-chapter / video-stop commands now support action annotations and chapter markers backed by the new page.screencast API:

playwright-cli open https://demo.playwright.dev/todomvc

playwright-cli video-start receipt.webm
playwright-cli video-chapter "Adding Todo Items" --description="We will add several items to the todo list." --duration=2000

playwright-cli fill e8 "Buy groceries"
playwright-cli press Enter

playwright-cli video-stop

See the video recording reference for full examples.


🤖 CLI Debugger

Note

Requires @playwright/test v1.59 or later.

Coding agents can now attach to a running Playwright test for interactive debugging. Run the test with --debug=cli, then attach with playwright-cli:

$ npx playwright test --debug=cli
### Debugging Instructions
- Run "playwright-cli attach tw-87b59e" to attach to this test

$ playwright-cli attach tw-87b59e
### Session `tw-87b59e` created, attached to `tw-87b59e`.
### Paused
- Navigate to "/" at tests/example.spec.ts:4

$ playwright-cli --session tw-87b59e step-over
### Paused
- Expect "toHaveTitle" at tests/example.spec.ts:7

This pairs playwright-cli's browser control with Playwright's test runner — perfect for automatically diagnosing and fixing failing tests in agentic workflows.


🌐 Network State & Request Inspection

Offline mode — simulate network connectivity loss for testing offline scenarios:

playwright-cli network-state-set offline
# ... test your app's offline behavior ...
playwright-cli network-state-set online

Richer network output — filter requests by URL pattern and optionally include headers and request bodies:

# Filter to API requests only
playwright-cli network --filter="/api/.*"

# Include request headers and body for inspection
playwright-cli network --filter="/api/.*" --request-headers --request-body

v0.1.1

14 Feb 23:28
d1c6d11

Choose a tag to compare

📺 Session monitoring

See what your agents are doing — live.

npm i -g @playwright/cli@latest
playwright-cli show

Run this to open a dashboard that tiles all running browser sessions with real-time screencasts.

Image

Click into any session to take full remote control — navigate, click, type — then press Escape to hand it back to the agent. Close sessions or clean up data right from the grid.

NOTE: You might need to restart your sessions using the fresh version of Playwright CLI for monitoring to be available!

v0.1.0

07 Feb 01:47
7ff4d62

Choose a tag to compare

Bugfix

  • fixing tracing start/stop #230