Skip to content

Releases: microsoft/playwright-cli

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

v0.0.64

06 Feb 18:00
21a9ab8

Choose a tag to compare

🕶️ Incognito by default

Browser profiles are now in-memory by default — every session starts clean with no leftover state.

Use --persistent to opt into a persistent profile, or --profile=<path> to specify a custom profile directory:

> playwright-cli open example.com                       # incognito, clean slate
> playwright-cli open example.com --persistent          # persistent profile
> playwright-cli open example.com --profile=./my-data   # custom profile directory

🔀 Simplified session management

The --session flag has been replaced with the shorter -s=. Session lifecycle is simplified — there is no longer a "stopped" state; sessions are either running or gone.

> playwright-cli -s=myapp open example.com
> playwright-cli -s=myapp click e5
> playwright-cli -s=myapp close
> playwright-cli -s=myapp delete-data

New session management commands replace the old session-* family:

> playwright-cli list        # list all sessions
> playwright-cli close-all   # close all browsers
> playwright-cli kill-all    # forcefully kill all browser processes

🏗️ Workspace-scoped daemon

Each workspace now gets its own daemon process, preventing cross-project interference and enabling direct daemon startup for faster, more reliable operation.

v0.0.62

31 Jan 01:41
7ae7c95

Choose a tag to compare

Infrastructure for Playwright CLI is in, so we are ready to cook the features and skills!

⚡ Lightning-fast Playwright CLI executable (http://github.com/microsoft/playwright-cli)

> playwright-cli open example.com
> time playwright-cli snapshot
0.03s user 0.01s system cpu 0.055 total

🎥 On-demand video recording

> playwright-cli video-start
> playwright-cli open playwright.dev
> playwright-cli video-stop
### Result
- [Video](.playwright-cli/video-2026-01-31T00-49-47-976Z.webm)

Also available with the --caps=devtools flag in Playwright MCP.

🔧 Persistent session configuration

> playwright-cli config --headed --config=config.json
> playwright-cli open playwright.dev

Countless configuration options

☁️ Isolated (ephemeral) browser context, non-chromium browser shortcuts

> playwright-cli install --browser=firefox
> playwright-cli config --isolated --browser=firefox --headed
> playwright-cli open playwright.dev 

🔌 Playwright Chrome extension + Playwright CLI = ❤️

> playwright-cli --session=real-browser snapshot --extension

Share the tab and have fun!