playwright-cli

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Manually driving a browser to test web pages, debug failing Playwright tests, or capture page state is slow and error-prone. This Skill lets an AI agent control a real browser session through the playwright-cli command line, producing snapshots, generated TypeScript code, traces, and videos without writing boilerplate automation scripts. ## Core Features & Use Cases - Interactive Browser Control: Open pages, click, fill forms, navigate tabs, manage cookies and storage, and inspect elements via snapshot refs or CSS/role locators. - Test Plan, Generate, and Heal: Explore an app through a seed test, write a spec file, generate Playwright test files from recorded actions, and debug or heal failing tests by attaching to paused debug sessions. - Network Mocking and Diagnostics: Intercept and mock requests, capture console output, record traces and annotated videos, and run arbitrary Playwright code for advanced scenarios like geolocation or downloads. - Use Case: A failing CI test needs investigation. Run it with --debug=cli, attach playwright-cli to the paused session, snapshot the page to find the changed locator, rehearse the fix, and paste the generated TypeScript back into the test. ## Quick Start Ask the agent to open a website with playwright-cli, take a snapshot, and click or fill elements using the refs shown in the snapshot.

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 playwright-cli snapshot to get element refs like e5. Interact with commands such as click, fill, and type using those refs, and close the browser with playwright-cli close when finished.

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

Run the test with npx playwright test --debug=cli in the background and wait for the debugging instructions with a session name. Attach using playwright-cli attach <session>, then snapshot, inspect console and requests, and rehearse the corrected interaction.

Can playwright-cli mock network requests?▼

Yes, playwright-cli route intercepts URL patterns and can return custom status codes, JSON bodies, or headers. For conditional logic or response modification, use run-code with page.route to fulfill, abort, or delay requests.

Does playwright-cli support multiple browser sessions?▼

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

How do I install playwright-cli if the command is not found?▼

First check for a local version with npx --no-install playwright --version and use npx playwright cli if available. Otherwise install it globally with npm install -g @playwright/cli@latest.

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

Video recording adds overhead to automation and large recordings consume significant disk space. Videos show visuals only; for DOM snapshots, network details, and step-by-step replay, use tracing instead.