playwright-cli

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

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

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 pages, debug failing Playwright tests, or capture page state is slow and repetitive. This Skill lets you control a real browser session from the command line—navigating, clicking, filling forms, mocking network requests, and generating Playwright test code from live interactions. ## Core Features & Use Cases - Interactive Browser Automation: Open pages, click elements by snapshot refs, fill forms, manage tabs, cookies, and storage, and capture screenshots, PDFs, traces, and videos. - Playwright Test Workflows: Run and debug tests via --debug=cli, attach to paused sessions, and follow a spec-driven plan → generate → heal workflow where every CLI action emits ready-to-paste TypeScript test code. - Network Mocking & DevTools: Intercept and mock requests, inspect console output and network activity, and run arbitrary Playwright code for geolocation, permissions, and media emulation. - 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 fix interactively, and paste the generated code back into the test. ## Quick Start Use playwright-cli to open https://example.com, take a snapshot, and click the sign-in 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 from the command line?▼

Use playwright-cli to open a browser, navigate with goto, and interact with elements using refs from the snapshot output. Commands like click, fill, and type drive the page, and each action prints the equivalent Playwright TypeScript code.

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 so you can snapshot the page, inspect console and network output, and rehearse fixes.

Can playwright-cli mock network requests?▼

Yes, the route command intercepts URL patterns and returns custom status codes, bodies, or headers, such as playwright-cli route "**/api/users" --body='[{"id":1}]'. For conditional logic or response modification, use run-code with page.route.

Does playwright-cli support multiple browser sessions?▼

Yes, the -s flag creates named sessions with isolated cookies, storage, cache, and tabs, so you can run concurrent sessions like -s=auth and -s=public. Use list, close-all, and kill-all to manage them.

How do I generate Playwright test code from manual browser actions?▼

Every playwright-cli action automatically prints the corresponding Playwright TypeScript, such as page.getByRole('button', { name: 'Submit' }).click(). Collect these lines into a test file and add assertions manually using generate-locator and snapshot output.

What browsers does playwright-cli support?▼

The open command accepts --browser=chrome, firefox, webkit, or msedge. You can also attach to a running Chrome or Edge via CDP channel name or endpoint, or connect through the Playwright browser extension.