Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,10 @@ playwright-cli highlight --hide # hide all page highlights

```bash
playwright-cli open --browser=chrome # use specific browser
playwright-cli attach --extension # connect via browser extension
playwright-cli attach --extension=chrome # connect via Playwright Extension
playwright-cli attach --cdp=chrome # attach to running Chrome/Edge by channel
playwright-cli attach --cdp=<url> # attach via CDP endpoint
playwright-cli detach # detach an attached session, leaves the external browser running
playwright-cli open --persistent # use persistent profile
playwright-cli open --profile=<path> # use custom profile directory
playwright-cli open --config=file.json # use config file
Expand Down
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"test": "playwright test"
},
"devDependencies": {
"@playwright/test": "1.60.0-alpha-2026-04-24",
"@playwright/test": "1.60.0-alpha-1777077614000",
"@types/node": "^25.2.1"
},
"dependencies": {
"playwright": "1.60.0-alpha-2026-04-24"
"playwright": "1.60.0-alpha-1777077614000"
},
"bin": {
"playwright-cli": "playwright-cli.js"
Expand Down
6 changes: 4 additions & 2 deletions skills/playwright-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ playwright-cli open --persistent
# Use persistent profile with custom directory
playwright-cli open --profile=/path/to/profile

# Connect to browser via extension
playwright-cli attach --extension
# Connect to browser via Playwright Extension
playwright-cli attach --extension=chrome

# Connect to a running Chrome or Edge by channel name
playwright-cli attach --cdp=chrome
Expand All @@ -224,6 +224,8 @@ playwright-cli open --config=my-config.json

# Close the browser
playwright-cli close
# Detach from an attached browser (leaves the external browser running)
playwright-cli -s=msedge detach
# Delete user data for the default session
playwright-cli delete-data
```
Expand Down
16 changes: 16 additions & 0 deletions skills/playwright-cli/references/session-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ playwright-cli attach --cdp=msedge-dev

Supported channels: `chrome`, `chrome-beta`, `chrome-dev`, `chrome-canary`, `msedge`, `msedge-beta`, `msedge-dev`, `msedge-canary`.

When `--session` is not provided, the session is named after the channel (e.g. `--cdp=msedge` creates a session called `msedge`), so parallel attaches to Chrome and Edge don't collide on `default`. Pass `--session=<name>` to override.

### Attach via CDP endpoint

Connect to a browser that exposes a Chrome DevTools Protocol endpoint:
Expand All @@ -145,6 +147,20 @@ Connect to a browser with the Playwright extension installed:
playwright-cli attach --extension
```

### Detach

Tear down an attached session without affecting the external browser:

```bash
# Detach the default attached session
playwright-cli detach

# Detach a specific attached session
playwright-cli -s=msedge detach
```

`detach` only works on sessions created via `attach`. For sessions created via `open`, use `close`.

## Default Browser Session

When `-s` is omitted, commands use the default browser session:
Expand Down
Loading