IvanCampos/agents / skills/playwright-cli
playwright-cli
UnverifiedTranslate natural-language browser automation requests into exact `playwright-cli` commands for interactive web testing and debugging. Use when requests involve opening/navigating pages, interacting with elements, capturing snapshots/screenshots/PDFs, using tabs, inspecting console/network, mocking routes, managing cookies/storage/state, configuring browser sessions, or controlling named Playwright CLI sessions.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.7 KB |
| agents/openai.yaml | config | 250 B |
| references/command-map.md | markdown | 6.8 KB |
references/command-map.md
View on GitHub# Playwright CLI Command Map
Use this file to convert natural-language requests into exact `playwright-cli` commands.
## Core
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli open [url]` | open browser, start browser, open site |
| `playwright-cli goto <url>` | go to URL, navigate to page |
| `playwright-cli close` | close page, close browser |
| `playwright-cli type <text>` | type text, enter text in focused field |
| `playwright-cli click <ref> [button]` | click element, tap element |
| `playwright-cli dblclick <ref> [button]` | double click element |
| `playwright-cli fill <ref> <text>` | fill input, set textbox value |
| `playwright-cli drag <startRef> <endRef>` | drag and drop |
| `playwright-cli hover <ref>` | hover on element |
| `playwright-cli select <ref> <val>` | choose dropdown option |
| `playwright-cli upload <file>` | upload file, attach file |
| `playwright-cli check <ref>` | check checkbox, select radio |
| `playwright-cli uncheck <ref>` | uncheck checkbox |
| `playwright-cli snapshot` | capture page refs |
| `playwright-cli snapshot --filename=f` | save snapshot to file |
| `playwright-cli eval <func> [ref]` | run JS expression |
| `playwright-cli dialog-accept [prompt]` | accept alert/confirm/prompt |
| `playwright-cli dialog-dismiss` | dismiss alert/confirm/prompt |
| `playwright-cli resize <w> <h>` | resize browser window |
## Navigation
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli go-back` | go back, previous page |
| `playwright-cli go-forward` | go forward |
| `playwright-cli reload` | refresh page, reload |
## Keyboard
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli press <key>` | press key |
| `playwright-cli keydown <key>` | hold key down |
| `playwright-cli keyup <key>` | release key |
## Mouse
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli mousemove <x> <y>` | move mouse to coordinates |
| `playwright-cli mousedown [button]` | mouse button down |
| `playwright-cli mouseup [button]` | mouse button up |
| `playwright-cli mousewheel <dx> <dy>` | scroll by delta |
## Save As
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli screenshot [ref]` | take screenshot |
| `playwright-cli screenshot --filename=f` | take screenshot to specific file |
| `playwright-cli pdf` | export page to PDF |
| `playwright-cli pdf --filename=page.pdf` | export PDF to specific file |
### Screenshot Post-Processing (Required)
- Treat `playwright-cli screenshot` output as an intermediate PNG.
- Final returned artifact must be JPEG compressed via `ffmpeg`.
- Recommended conversion:
```bash
ffmpeg -y -i "$TMP_PNG" -q:v 4 "$FINAL_JPG"
```
## Tabs
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli tab-list` | list tabs |
| `playwright-cli tab-new [url]` | open new tab |
| `playwright-cli tab-close [index]` | close tab |
| `playwright-cli tab-select <index>` | switch/select tab |
## Storage
### State
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli state-save [filename]` | save auth state, save browser state |
| `playwright-cli state-load <filename>` | load auth state, restore browser state |
### Cookies
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli cookie-list [--domain]` | list cookies |
| `playwright-cli cookie-get <name>` | read cookie |
| `playwright-cli cookie-set <name> <val>` | set cookie |
| `playwright-cli cookie-delete <name>` | delete cookie |
| `playwright-cli cookie-clear` | clear all cookies |
### LocalStorage
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli localstorage-list` | list localStorage |
| `playwright-cli localstorage-get <key>` | get localStorage value |
| `playwright-cli localstorage-set <k> <v>` | set localStorage value |
| `playwright-cli localstorage-delete <k>` | delete localStorage key |
| `playwright-cli localstorage-clear` | clear localStorage |
### SessionStorage
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli sessionstorage-list` | list sessionStorage |
| `playwright-cli sessionstorage-get <k>` | get sessionStorage value |
| `playwright-cli sessionstorage-set <k> <v>` | set sessionStorage value |
| `playwright-cli sessionstorage-delete <k>` | delete sessionStorage key |
| `playwright-cli sessionstorage-clear` | clear sessionStorage |
## Network
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli route <pattern> [opts]` | mock route, stub network |
| `playwright-cli route-list` | list mocked routes |
| `playwright-cli unroute [pattern]` | remove route mock(s) |
## DevTools
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli console [min-level]` | show console logs/errors |
| `playwright-cli network` | list network requests |
| `playwright-cli run-code <code>` | run imperative Playwright code snippet (not for pass/fail classification) |
| `playwright-cli tracing-start` | start tracing |
| `playwright-cli tracing-stop` | stop tracing |
| `playwright-cli video-start` | start video recording |
| `playwright-cli video-stop [filename]` | stop video recording |
### `eval` and `run-code` Caveats
- `playwright-cli eval` is preferred for assertions because it returns `### Result`.
- `playwright-cli run-code` may print `### Error` while still exiting with code `0`; do not classify from shell exit code.
- For both commands, parse stdout and treat `### Error` as failure.
- `run-code` requires a valid JavaScript expression. Bare statements like `return ...` are invalid.
- For robust `eval` expressions, prefer `Array.from(...)` plus classic `function(...) {}` callbacks when arrow-function snippets misparse.
## Install
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli install --skills` | install skills |
| `playwright-cli install-browser` | install browser binaries |
## Configuration
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli config [options]` | configure session settings |
| `playwright-cli open --browser=chrome` | open with specific browser |
| `playwright-cli open --extension` | connect with extension |
| `playwright-cli open --persistent` | open with persistent profile |
| `playwright-cli open --profile=<path>` | open with custom profile path |
| `playwright-cli open --config=file.json` | open with config file |
| `playwright-cli close` | close browser |
| `playwright-cli delete-data` | delete default-session user data |
## Sessions
| Command | Natural-language intents |
| --- | --- |
| `playwright-cli -s=name <cmd>` | run command in named session |
| `playwright-cli -s=name close` | close named session browser |
| `playwright-cli -s=name delete-data` | delete named-session user data |
| `playwright-cli list` | list all sessions |
| `playwright-cli close-all` | close all sessions |
| `playwright-cli kill-all` | force kill all browser processes |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |