playwright-cli

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

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

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 UI evidence is slow and error-prone. This Skill gives an AI agent a complete command-line interface to open browsers, interact with page elements via snapshot refs, manage sessions and storage, mock network requests, and record traces or videos. ## Core Features & Use Cases - Browser Automation: Open pages, click, fill, drag, and navigate using snapshot element refs, CSS selectors, or Playwright locators, with automatic TypeScript code generation for every action. - Test Plan-Generate-Heal Workflow: Explore an app to write a test plan spec, generate Playwright test files from live interactions, and debug or heal failing tests via --debug=cli attach sessions. - Sessions, Storage, and Network Control: Run isolated named browser sessions, save and restore cookies/localStorage state, and mock or block network requests with route rules. - Use Case: A QA engineer asks the agent to verify a login flow: the agent opens the app, fills credentials using snapshot refs, captures a trace and video of the run, and generates a Playwright test file with assertions from the recorded actions. ## Quick Start Ask the agent to open a website with playwright-cli, take a snapshot, and click or fill elements by their 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 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 press using those refs, and close the browser when finished.

How do I 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 with that session name, then inspect snapshots, console output, and network requests.

Can playwright-cli run multiple isolated browser sessions?

Yes, use the -s flag to create named sessions with independent cookies, storage, cache, and tabs. List sessions with playwright-cli list and clean up with close, close-all, or kill-all.

Does playwright-cli support mocking network requests?

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

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 more appropriate than video.