Releases: microsoft/playwright-cli
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.
v0.1.4
- chore: roll Playwright to 1.60.0-alpha-1775061447000
v0.1.3
- Maintenance release off 1.59 branch point
v0.1.2
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-stopSee 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:7This 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 onlineRicher 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-bodyv0.1.1
📺 Session monitoring
See what your agents are doing — live.
npm i -g @playwright/cli@latest
playwright-cli showRun this to open a dashboard that tiles all running browser sessions with real-time screencasts.
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
v0.0.64
🕶️ 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-dataNew 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
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.devCountless 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 = ❤️
- Install Playwright browser extension
> playwright-cli --session=real-browser snapshot --extensionShare the tab and have fun!