playwright-cli
БесплатноБез исполняемых скриптовНе проверенUse when the user asks to inspect, test, debug, screenshot, trace, or automate a website or Playwright test flow through Playwright Agent CLI shell commands…
от fanfan-de★ 55 звёзд на GitHubОб этом скилле
Playwright CLI
Use playwright-cli for browser automation when the user asks to open pages, inspect UI state, interact with elements, capture screenshots or PDFs, debug Playwright tests, record traces or videos, manage browser sessions, or verify a rendered frontend.
Preconditions
- Require Node.js 20 or newer.
- Prefer
playwright-cli <command>when the command is already installed. - If unavailable, use
npx -y @playwright/cli@latest <command>. - To install globally, use
npm install -g @playwright/cli@latest. - If browser binaries are missing, run
playwright-cli install-browserornpx -y @playwright/cli@latest install-browser. - Use PowerShell syntax on Windows workspaces.
First Checks
playwright-cli --help
playwright-cli --version
If playwright-cli is not recognized:
npx -y @playwright/cli@latest --help
Core Workflow
Open the target, read the current page state, then use refs from the latest snapshot for deterministic interaction.
playwright-cli open http://localhost:3000 --headed
playwright-cli snapshot
playwright-cli click <ref>
playwright-cli fill <ref> "text"
playwright-cli press Enter
playwright-cli screenshot
After each command, inspect the CLI output before deciding the next action. The output includes the current page state and may point to a snapshot file under .playwright-cli/; read that file when element refs or accessible names are needed.
Useful Commands
Navigation:
playwright-cli open <url> --headed
playwright-cli goto <url>
playwright-cli reload
playwright-cli go-back
playwright-cli go-forward
Interaction:
playwright-cli click <ref>
playwright-cli dblclick <ref>
playwright-cli fill <ref> "value"
playwright-cli type "text"
playwright-cli check <ref>
playwright-cli uncheck <ref>
playwright-cli select <ref> "value"
playwright-cli hover <ref>
playwright-cli upload <file>
playwright-cli press Enter
Inspection and artifacts:
playwright-cli snapshot
playwright-cli screenshot
playwright-cli screenshot <ref>
playwright-cli pdf
playwright-cli console error
playwright-cli eval "() => document.title"
playwright-cli run-code "async ({ page }) => await page.title()"
Sessions and browser mode:
playwright-cli -s=my-session open http://localhost:3000 --headed
playwright-cli list
playwright-cli close
playwright-cli close-all
playwright-cli open --browser=firefox
playwright-cli open --persistent
playwright-cli open --profile=.playwright-profile
Storage and auth:
playwright-cli state-save .playwright-cli/auth.json
playwright-cli state-load .playwright-cli/auth.json
playwright-cli cookie-list
playwright-cli localstorage-list
playwright-cli sessionstorage-list
Tracing and video:
playwright-cli tracing-start
playwright-cli tracing-stop
playwright-cli video-start session.webm
playwright-cli video-chapter "checkout flow"
playwright-cli video-stop
Local App Verification
When verifying a local frontend, make sure the dev server is running before opening the page. Use --headed for visual work and screenshots. Check at least:
- The page is not blank.
- Main interactive controls are visible and clickable.
- Text does not visibly overlap or overflow.
- Console output has no relevant errors.
- Screenshots show the expected state.
Safety Rules
- Ask before submitting real forms, making purchases, deleting content, changing production data, or interacting with authenticated third-party accounts.
- Prefer local URLs, staging sites, and test accounts unless the user explicitly asks for a real external site.
- Keep destructive browser actions out of scripted loops unless the user has approved the exact target and effect.
- Do not store secrets in committed storage-state files. Use local ignored paths for auth artifacts.
- If a command fails, run
playwright-cli --helpor the relevant help output before guessing syntax.
Установить playwright-cli в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл playwright-cli?
Use when the user asks to inspect, test, debug, screenshot, trace, or automate a website or Playwright test flow through Playwright Agent CLI shell commands, including local web apps, browser sessions, snapshots, element refs, storage state, network mocking, console inspection, and visual verification.
Как установить скилл playwright-cli?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл playwright-cli запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic