playwright-cli

Automates browser interactions for web testing, form filling, screenshots, and data extraction.

Updated May 16, 2026
One-click install
npx skills add https://github.com/michalo1334/ScenarioImpactDSL --skill playwright-cli-michalo1334
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/michalo1334/ScenarioImpactDSL/tree/main/.opencode/skills/playwright-cli
Command: npx skills add https://github.com/michalo1334/ScenarioImpactDSL --skill playwright-cli-michalo1334

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 applications, fill forms, or scrape page data is repetitive and error-prone. This Skill provides a command-line interface to Playwright so an AI agent can navigate pages, interact with elements, capture snapshots, and manage browser state without writing a full test harness first. ## Core Features & Use Cases - Page Interaction and Navigation: Open pages, click elements by snapshot refs, fill forms, press keys, drag elements, and move through tabs, history, and iframes. - State and Session Management: Run multiple isolated named browser sessions, persist profiles, and save or restore cookies, localStorage, sessionStorage, and full storage state files. - Network Control and Debugging: Mock or block requests with route rules, inspect console and network logs, record traces and videos, and execute arbitrary Playwright code via run-code. - Test Generation: Every CLI action emits corresponding Playwright TypeScript code that can be pasted directly into test files. - Use Case: Log into a web app, save the authenticated storage state to auth.json, then reuse that state in later sessions to skip the login flow while scraping dashboard data. ## Quick Start Ask the agent to open a website with playwright-cli, take a snapshot to list interactive elements, then fill the login form and click the submit 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 list elements with refs like e1 or e5. Interact using commands such as click, fill, type, and press, and close the browser with playwright-cli close when finished.

How do I fill and submit a web form using Playwright CLI?▼

Open the page, take a snapshot to identify field refs, then use playwright-cli fill with each element ref and value. Submit by clicking the button ref, and verify the result with another snapshot.

Can playwright-cli run multiple isolated browser sessions?▼

Yes, the -s flag creates named sessions with independent cookies, storage, cache, and tabs. Use playwright-cli list to view sessions, close to stop one, and close-all or kill-all for cleanup.

How do I mock network requests in Playwright CLI?▼

Use playwright-cli route with a URL pattern plus options like --status, --body, or --header to mock responses. For conditional logic or response modification, use run-code with page.route in custom Playwright code.

Does playwright-cli support saving login state for reuse?▼

Yes, state-save writes cookies and localStorage to a JSON file after login, and state-load restores it in later sessions. This lets you skip repeated authentication flows when revisiting the same application.

What should I do if the playwright-cli command is not found?▼

If the global binary fails, prefix commands with npx, for example npx playwright-cli open https://example.com. This runs the locally installed package without requiring a global installation.