Use when the task requires automating a real browser from the terminal (navigation, form filling, snapshots, screenshots, data extraction, UI-flow debugging) via `playwright-cli` or the bundled wrapper script.
Drive a real browser from the terminal using playwright-cli.
Ensure Node.js/npm is installed:
node --version
npm --version
If missing, install Node.js/npm. Then, use npx to execute the Playwright CLI:
npx playwright-cli --help
Use npx playwright-cli directly:
npx playwright-cli open https://playwright.dev --headed
npx playwright-cli snapshot
npx playwright-cli click e15
npx playwright-cli type "Playwright"
npx playwright-cli press Enter
npx playwright-cli screenshot
npx playwright-cli open <url>).npx playwright-cli snapshot).Minimal loop:
npx playwright-cli open https://example.com
npx playwright-cli snapshot
npx playwright-cli click e3
npx playwright-cli snapshot
Snapshot again after:
Refs can go stale. When a command fails due to a missing ref, snapshot again.
npx playwright-cli open https://example.com/form
npx playwright-cli snapshot
npx playwright-cli fill e1 "[email protected]"
npx playwright-cli fill e2 "password123"
npx playwright-cli click e3
npx playwright-cli snapshot
npx playwright-cli open https://example.com --headed
npx playwright-cli tracing-start
# ...interactions...
npx playwright-cli tracing-stop
npx playwright-cli tab-new https://example.com
npx playwright-cli tab-list
npx playwright-cli tab-select 0
npx playwright-cli snapshot
Open only what you need:
references/cli.mdreferences/workflows.mde12.eval and run-code unless needed.eX and say why; do not bypass refs with run-code.--headed when a visual check will help.