playwright-clilisted
Install: claude install-skill beixiyo/dotfiles
# Browser Automation with playwright-cli
## Persistence (required)
**Always pass `--persistent` when calling `open`.** This saves localStorage, cookies, and session data to playwright-cli's default profile directory on disk, and restores it automatically on next open — no manual steps needed.
```bash
playwright-cli open "https://example.com" --persistent
```
First time on a new site: open, log in once, close. Every subsequent conversation opens already authenticated.
Never use `state-save` / `state-load` for auth — `--persistent` handles it automatically and survives across all agents and conversations.
## Quick start
```bash
# open new browser
playwright-cli open
# navigate to a page
playwright-cli goto https://playwright.dev
# interact with the page using refs from the snapshot
playwright-cli click e15
playwright-cli type "page.click"
playwright-cli press Enter
# take a screenshot (rarely used, as snapshot is more common)
playwright-cli screenshot
# close the browser
playwright-cli close
```
## Commands
### Core
```bash
playwright-cli open
# open and navigate right away
playwright-cli open https://example.com/
playwright-cli goto https://playwright.dev
playwright-cli type "search query"
playwright-cli click e3
playwright-cli dblclick e7
# --submit presses Enter after filling the element
playwright-cli fill e5 "user@example.com" --submit
playwright-cli drag e2 e8
playwright-cli hover e4
playwright-cli select e9 "option-value"
playwright-cli upload ./document.pdf
p