playwright-cli

Automate browser interactions and generate Playwright tests via a command-line interface.

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

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 record user flows is slow and error-prone. This Skill lets an AI agent control a real browser through the playwright-cli command line, capturing snapshots, interacting with elements, and producing ready-to-use Playwright TypeScript code. ## Core Features & Use Cases - Interactive Browser Automation: Open pages, click, fill forms, navigate tabs, manage cookies and storage, and inspect accessibility snapshots with element refs. - Test Authoring and Healing: Run Playwright tests in debug mode, attach to the paused session, rehearse fixes live, and copy the auto-generated TypeScript back into test files following a plan-generate-heal workflow. - Debugging and Recording: Capture traces, network requests, console logs, screenshots, and annotated videos, plus mock network requests for controlled testing. - Use Case: A failing CI test needs diagnosis. Run it with --debug=cli, attach playwright-cli to the paused session, snapshot the page to find the changed locator, rehearse the corrected click, and paste the generated code into the test. ## Quick Start Ask the agent to open a website with playwright-cli, take a snapshot, and click or fill elements by their snapshot refs to automate the browser task you describe.

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 step by step.

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 snapshot the page, inspect console and network activity, and rehearse fixes.

Can playwright-cli generate Playwright test code automatically?

Yes. Every action performed with playwright-cli prints the equivalent Playwright TypeScript code, such as page.getByRole locators, which you can copy directly into test files. Assertions must be added manually using matchers like toBeVisible or toHaveText.

Does playwright-cli support multiple isolated browser sessions?

Yes. Use the -s flag to create named sessions with independent cookies, storage, cache, and tabs. You can list sessions with playwright-cli list and clean up with close, close-all, or delete-data.

How do I mock network requests during browser automation?

Use playwright-cli route with a URL pattern and options like --status, --body, or --header to intercept requests. For conditional logic or response modification, use run-code with page.route to inspect requests and fulfill custom responses.

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 debugging with DOM snapshots and network details, tracing is a better fit than video.