playwright-cli

Automate browser interactions and Playwright test workflows via command-line commands.

Updated Aug 20, 2026
One-click install
npx skills add https://github.com/bittlinkm/claude-setup --skill playwright-cli-bittlinkm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/bittlinkm/claude-setup/tree/main/skills/playwright-cli
Command: npx skills add https://github.com/bittlinkm/claude-setup --skill playwright-cli-bittlinkm

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 page state is slow and repetitive. This Skill lets you control a real browser through simple CLI commands, with every action automatically generating the equivalent Playwright TypeScript code. ## Core Features & Use Cases - Browser Automation: Open pages, click, fill forms, navigate tabs, and take snapshots using element refs from accessibility snapshots. - Test Authoring & Healing: Plan, generate, and debug Playwright tests by attaching to paused test runs and rehearsing fixes interactively. - Network & Storage Control: Mock requests, manage cookies/localStorage, save and restore authentication state, and record traces or videos. - Use Case: A failing CI test needs diagnosis — run it with --debug=cli, attach playwright-cli to the paused session, inspect the snapshot and console, rehearse the corrected locator, and paste the generated code back into the test. ## 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 like e5, and interact with click, fill, or type commands. Each action prints the equivalent Playwright TypeScript code you can reuse in tests.

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 debugging instructions with a session name, then attach using playwright-cli attach tw-XXXX. You can inspect snapshots, console output, and network requests while the test is paused.

Can playwright-cli connect to an already running Chrome browser?

Yes, use playwright-cli attach --cdp=chrome to connect to a running Chrome or Edge instance with remote debugging enabled, or attach --cdp=http://localhost:9222 for a CDP endpoint. Detach later without closing the external browser.

Does playwright-cli support mocking network requests?

Yes, the route command intercepts URL patterns to return custom status codes, JSON bodies, or headers, and unroute removes them. For conditional logic or response modification, use run-code with page.route in Playwright code.

How do I save and reuse login state between browser sessions?

Log in once, then run playwright-cli state-save auth.json to capture cookies and localStorage. Later, run state-load auth.json before navigating, and the session is restored without repeating the login flow.

What are the limitations of playwright-cli snapshots?

Snapshots show the accessibility tree, so attributes like id, class, or data-testid are not visible by default. Use the eval command with a ref to read those properties, or limit large snapshots with --depth or the find command.