playwright-cli

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

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

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 repetitive. This Skill lets an AI agent control a real browser session via the playwright-cli command line, producing snapshots, generated test code, traces, and recordings without writing boilerplate automation scripts. ## Core Features & Use Cases - Interactive Browser Automation: Open pages, click, fill forms, drag, upload files, and inspect accessibility snapshots using element refs, CSS selectors, or Playwright locators. - Test Plan, Generate, and Heal: Explore an app through a seed test, write spec files, generate Playwright TypeScript tests from recorded actions, and debug or fix failing tests via --debug=cli attach sessions. - Session, Storage, and Network Control: Run isolated named browser sessions, save and restore cookies/localStorage state, mock network requests, capture traces, and record annotated videos. - Use Case: A QA engineer asks the agent to reproduce a login bug: the agent opens the app, fills the form, captures console errors and network requests, then generates a regression test from the recorded actions. ## Quick Start Ask the agent to open a website with playwright-cli, take a snapshot of the page, and click or fill elements by their snapshot refs.

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 to launch a browser, then use snapshot to get element refs and commands like click, fill, and type to interact with the page. Each command returns an updated accessibility snapshot of the current page state.

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

Run the test with npx playwright test --debug=cli in the background, then attach using playwright-cli attach with the printed session name. You can snapshot the paused page, inspect console and network requests, and copy the generated code back into the test.

Can playwright-cli run multiple isolated browser sessions?

Yes, use the -s flag to create named sessions with independent cookies, storage, cache, and tabs. Commands like playwright-cli list, close-all, and delete-data manage session lifecycle and cleanup.

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 the Playwright page.route API.

What are the limitations of playwright-cli snapshots?

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