playwright-cli

Drive browsers from the command line to navigate, interact, snapshot, and debug web pages.

10|9|Updated May 22, 2026
One-click install
npx skills add https://github.com/constructorfabric/insight --skill playwright-cli-constructorfabric
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/constructorfabric/insight/tree/main/.claude/skills/playwright-cli
Command: npx skills add https://github.com/constructorfabric/insight --skill playwright-cli-constructorfabric

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Manually clicking through a browser to explore a page, validate a locator, reproduce a UI bug, or debug a failing Playwright test is slow and hard to script. This Skill gives you a full command-line interface to a real browser so every interaction is repeatable, inspectable, and convertible into test code. ## Core Features & Use Cases - Interactive browser control: Open pages, snapshot the accessibility tree, click and type by element ref, manage tabs, sessions, cookies, and storage state. - Debugging and inspection: Read console output and network requests, record traces and video, mock network routes, and attach to paused Playwright Test runs. - Spec-driven testing: Plan, generate, and heal Playwright test files by driving the live app and capturing the generated TypeScript code. - Use Case: A UI bug report says a form loses input on submit. Open the page with playwright-cli, fill the form by ref, capture console errors and network requests, then record a trace or annotated GIF as evidence for the issue tracker. ## Quick Start Open example.com in a browser, take a snapshot, and click the main button using playwright-cli.

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 of the accessibility tree, then click, fill, and type using element refs from that snapshot. Each command prints the equivalent Playwright TypeScript code you can reuse in tests.

How to debug a failing Playwright test interactively?

Run the test with npx playwright test --debug=cli in the background, wait for the debugging instructions with a session name, then attach with playwright-cli attach. Step to the failing point and inspect the page with snapshot, console, and requests.

Can playwright-cli mock network requests during testing?

Yes, the route command intercepts URL patterns and returns custom status codes, JSON bodies, or headers. For conditional logic or response modification, use run-code with page.route to inspect requests and fulfill them dynamically.

Does playwright-cli support multiple isolated browser sessions?

Yes, the -s flag creates named sessions with independent cookies, storage, cache, and tabs. You can list sessions, attach to running Chrome or Edge instances via CDP, and clean up with close-all or kill-all.

Why does playwright-cli video recording produce no file?

The video-start and video-stop commands can report success without writing a file, so verify the file exists before relying on it. For recordings you intend to share, use run-code with page.screencast, which writes the file itself.

When should I use tracing instead of video or screenshots?

Use tracing when debugging, since traces capture DOM snapshots, network activity, console logs, and per-action timing for step-by-step replay. Video suits demos and documentation, while screenshots are best for quick single-frame captures.