playwright-cli

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

Updated Mar 14, 2026
One-click install
npx skills add https://github.com/beelabstudio/ai --skill playwright-cli-beelabstudio
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/beelabstudio/ai/tree/main/skills/enabling/playwright-cli
Command: npx skills add https://github.com/beelabstudio/ai --skill playwright-cli-beelabstudio

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Driving a browser for testing, scraping, or UI verification normally requires writing and running full Playwright scripts. This Skill lets an AI agent control a live browser session directly through the playwright-cli command line, turning every action into reusable Playwright TypeScript code. ## Core Features & Use Cases - Interactive Browser Control: Open pages, click, fill forms, navigate tabs, and inspect accessibility snapshots using element refs, CSS selectors, or Playwright locators. - Test Authoring and Healing: Follow a plan-generate-heal workflow where CLI actions emit Playwright TypeScript that is collected into test files, then debug failing tests by attaching to a paused --debug=cli run. - Network, Storage, and Session Management: Mock requests, manage cookies and localStorage, save and restore auth state, and run multiple isolated named browser sessions concurrently. - Use Case: Record an annotated video walkthrough of a new UI flow with chapters and overlays, then attach the WebM directly to a pull request with gh pr create --attach. ## Quick Start Use the playwright-cli skill to open https://example.com, take a snapshot, and click the sign-in button.

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 with playwright-cli?▼

Run playwright-cli open with a URL, then use snapshot to get element refs and commands like click, fill, and type to interact with the page. Each command returns an updated page snapshot so you can chain actions step by step.

How to debug a failing Playwright test with playwright-cli?▼

Run the test with npx playwright test --debug=cli in the background, wait for the printed session name, then attach with playwright-cli attach. The test pauses at the start so you can step through, inspect snapshots, and rehearse fixes whose generated code you paste back into the test.

Can playwright-cli run multiple isolated browser sessions?▼

Yes, the -s flag creates named sessions with independent cookies, storage, cache, and tabs. Use playwright-cli list to see sessions, close to stop one, and close-all or kill-all for cleanup.

Does playwright-cli support mocking network requests?▼

Yes, the route command intercepts URL patterns and can return custom status codes, bodies, and headers, or remove request headers. For conditional logic or response modification, use run-code with page.route in a Playwright function.

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

Video recording outputs WebM and adds slight overhead to automation, with large recordings consuming significant disk space. GitHub attachments are limited to 10 MB on free plans, so recordings should be short and captured at modest sizes like 1280x800.