playwright-cli

Automate browser interactions and Playwright test workflows through a command-line interface.

1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/rockcookies/skills --skill playwright-cli-rockcookies
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/rockcookies/skills/tree/main/skills/playwright-cli/playwright-cli
Command: npx skills add https://github.com/rockcookies/skills --skill playwright-cli-rockcookies

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @playwright/cli, and includes references (resource) components.

What problem does it solve? Manually driving a browser to test web pages, debug failing Playwright tests, or capture UI evidence is slow and repetitive. This Skill lets an agent open browsers, click and fill elements via snapshot refs, mock network requests, manage storage state, and generate Playwright test code directly from terminal commands. ## Core Features & Use Cases - Browser Automation: Open pages, click, fill, drag, and navigate using element refs from accessibility snapshots, with support for tabs, sessions, and persistent profiles. - Test Authoring and Healing: Run Playwright tests with --debug=cli, attach to the paused session, and turn every CLI action into generated TypeScript test code following a plan-generate-heal workflow. - Debugging and Evidence Capture: Record traces, videos with chapter overlays, screenshots, console logs, and network requests, then attach them to pull requests with gh --attach. - Use Case: A failing CI test needs investigation. Run it with --debug=cli, attach playwright-cli to the paused session, inspect the snapshot and console, rehearse the fix interactively, and paste the generated locator code back into the test file. ## Quick Start Ask the agent to open a website with playwright-cli, take a snapshot, and click a specific element by its ref.

Frequently Asked Questions about playwright-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate browser interactions from the command line?▼

Use playwright-cli to open a page, take a snapshot to get element refs, then run commands like click, fill, and type against those refs. Each command returns an updated page snapshot so you can chain interactions without writing test code.

How to debug a failing Playwright test interactively?▼

Run the test with npx playwright test --debug=cli in the background, then attach with playwright-cli attach using the printed session name. The test pauses at the start, letting you inspect snapshots, console output, and network requests while rehearsing fixes.

Can playwright-cli generate Playwright test code automatically?▼

Yes, every playwright-cli action prints the equivalent Playwright TypeScript code, such as page.getByRole locators for clicks and fills. You collect this generated code into test files and add assertions manually using matchers like toBeVisible or toHaveText.

Does playwright-cli support mocking network requests?▼

Yes, the route command intercepts URL patterns and returns custom status codes, bodies, or headers, while unroute removes them. For conditional logic or response modification, use run-code with the full Playwright page.route API.

How do I run multiple isolated browser sessions at once?▼

Pass the -s flag with a session name to create isolated browser contexts with separate cookies, storage, and tabs. Use playwright-cli list to see sessions and close-all or kill-all to clean them up.

What are the limitations of playwright-cli video recording?▼

Video recording produces WebM files and adds slight overhead to automation, with large recordings consuming significant disk space. For pull request attachments, GitHub limits videos to 10 MB on free plans, so keep recordings short and at modest resolutions like 1280x800.