playwright-cli

Automate browser interactions and test web pages using Playwright CLI commands.

Updated Jul 29, 2026
One-click install
npx skills add https://github.com/MaiconGambini/opencode-harness-guide --skill playwright-cli-maicongambini
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/MaiconGambini/opencode-harness-guide/tree/main/skills/playwright-cli
Command: npx skills add https://github.com/MaiconGambini/opencode-harness-guide --skill playwright-cli-maicongambini

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Manually driving a browser to test pages, fill forms, scrape content, or debug web apps is slow and error-prone. This Skill lets you control a real browser through simple playwright-cli commands, with automatic page snapshots that expose clickable element refs. ## Core Features & Use Cases - Browser Automation: Open pages, click, type, fill forms, drag, hover, and navigate using snapshot element refs or CSS/role locators. - Session & Storage Management: Run isolated named browser sessions, save and restore cookies, localStorage, and full auth state files. - Debugging & Evidence: Capture console logs, network traffic, traces, screenshots, and annotated video recordings of automation runs. - Use Case: Debug a failing Playwright test by running it with --debug=cli, attaching playwright-cli to the paused session, exploring the page interactively, and copying the generated TypeScript code back into the test. ## Quick Start Use the playwright-cli skill to open https://example.com, take a snapshot, and click the main call-to-action 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 to start a browser, then playwright-cli goto to navigate. Each command returns a snapshot with element refs like e5, which you pass to commands such as click, fill, or type to interact with the page.

How to 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. Then attach using playwright-cli attach <session> to explore the paused page and copy the generated TypeScript code into your test.

Can playwright-cli mock network requests?

Yes, playwright-cli route 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 or abort them.

Does playwright-cli support multiple browser sessions?

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

How do I save and reuse login state in Playwright?

After logging in, run playwright-cli state-save auth.json to capture cookies and localStorage. Later, playwright-cli state-load auth.json restores the authenticated state so you can skip the login flow.

What if the playwright-cli command is not installed?

Try the local version with npx --no-install playwright-cli --version. If unavailable, install it globally with npm install -g @playwright/cli@latest, then use playwright-cli directly in all commands.