Skip to content

v0.1.5

Latest

Choose a tag to compare

@yury-s yury-s released this 03 Apr 18:12
a0d5bfd

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.