ワンクリックで
playwright-cli
Playwright CLI for browser automation, code generation, screenshots, tracing, and test running via npx playwright
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Playwright CLI for browser automation, code generation, screenshots, tracing, and test running via npx playwright
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Web search, context extraction, and AI answers via Brave Search API (bx CLI). Use when you need to search the web, look up documentation, research errors, check latest releases, find discussions, or get AI-synthesized answers with citations.
Android device control via ADB - screenshots, UI interaction, app management, file transfer, and backup/restore using adb and uiautomator
Brave browser via Flatpak - launching, remote debugging via CDP, profile management, and Flatpak sandbox considerations
Niri Wayland compositor control via IPC - window management, workspace operations, output configuration, and compositor automation
Podman operations, Containerfile/Dockerfile creation, rootless containers, image building, and container security
Managing Distrobox development containers, portable environments, host integration, and application export
| name | playwright-cli |
| description | Playwright CLI for browser automation, code generation, screenshots, tracing, and test running via npx playwright |
There are two distinct tools — use the right one for the job:
| Tool | Binary | Best for |
|---|---|---|
playwright-cli | ~/.local/share/mise/installs/node/25.3.0/bin/playwright-cli | Live browser automation, connecting to existing sessions, interactive CLI control |
npx playwright | via mise/npx | Test running, codegen recording, tracing, CI |
playwright-cli — Interactive CLI AutomationCreate a config file to point at the running Brave CDP endpoint:
// playwright-cli.json (in cwd, or specify with --config)
{
"browser": {
"cdpEndpoint": "http://localhost:9222"
}
}
Then all playwright-cli commands talk to the live Brave session automatically. No scripts needed.
Alternatively use the env var: PLAYWRIGHT_MCP_CDP_ENDPOINT=http://localhost:9222 playwright-cli snapshot
playwright-cli snapshot # get current page state + element refs (e1, e2, ...)
playwright-cli click e42 # click element by ref
playwright-cli click 'text=Submit' # click by text
playwright-cli fill e7 "hello" # fill input by ref
playwright-cli screenshot # screenshot current page
playwright-cli go-back # navigate back
playwright-cli goto https://... # navigate to URL
playwright-cli eval "document.title" # run JS on page
playwright-cli run-code "<playwright code snippet>" # run arbitrary Playwright JS
Always snapshot first — it returns element refs (e1, e2, ...) and page structure so you know exactly what to click without guessing selectors.
playwright-cli open [url] # open browser
playwright-cli goto <url> # navigate
playwright-cli close # close page
playwright-cli snapshot # capture page snapshot → element refs
playwright-cli click <ref> # click element
playwright-cli dblclick <ref> # double click
playwright-cli fill <ref> <text> # fill input
playwright-cli type <text> # type into focused element
playwright-cli hover <ref> # hover
playwright-cli select <ref> <val> # dropdown select
playwright-cli check <ref> # check checkbox/radio
playwright-cli uncheck <ref> # uncheck
playwright-cli drag <ref1> <ref2> # drag and drop
playwright-cli press <key> # keyboard: 'Enter', 'Tab', 'ArrowLeft'
playwright-cli keydown / keyup <key>
playwright-cli mousemove <x> <y>
playwright-cli mousewheel <dx> <dy>
playwright-cli eval <func> [ref] # evaluate JS
playwright-cli run-code <code> # run playwright code snippet
playwright-cli dialog-accept [text] # accept dialog
playwright-cli dialog-dismiss # dismiss dialog
playwright-cli resize <w> <h> # resize window
playwright-cli tab-list
playwright-cli tab-new [url]
playwright-cli tab-select <index>
playwright-cli tab-close [index]
playwright-cli -s=myapp open https://example.com # named session
playwright-cli -s=myapp snapshot
playwright-cli list # list all sessions
playwright-cli close-all
playwright-cli kill-all # force kill stale sessions
Use PLAYWRIGHT_CLI_SESSION=name env var to set session for all commands.
playwright-cli show # opens live screencast dashboard of all sessions
Lets you watch and take over control from any running session.
playwright-cli screenshot # stdout
playwright-cli screenshot --filename=out.png # save to file
playwright-cli screenshot e5 # screenshot specific element
playwright-cli pdf --filename=page.pdf
playwright-cli state-save auth.json # save cookies + localStorage
playwright-cli state-load auth.json # restore auth state
playwright-cli cookie-list
playwright-cli cookie-set name value
playwright-cli localstorage-list
playwright-cli localstorage-set key val
playwright-cli.json)Full config schema highlights:
{
"browser": {
"cdpEndpoint": "http://localhost:9222",
"browserName": "chromium",
"userDataDir": "/tmp/my-profile",
"launchOptions": { "headless": false }
},
"outputDir": "./playwright-output",
"outputMode": "file",
"timeouts": {
"action": 5000,
"navigation": 60000
}
}
npx playwright — Test Runner & Codegen.spec.ts)npx playwright codegen https://example.com
npx playwright codegen --target=javascript -o actions.js https://example.com
npx playwright codegen --browser=firefox https://example.com
npx playwright screenshot --full-page https://example.com full.png
npx playwright pdf https://example.com output.pdf
npx playwright test
npx playwright test tests/login.spec.ts
npx playwright test --project=chromium
npx playwright test --headed
npx playwright test --ui
npx playwright test --trace on
npx playwright show-report
npx playwright show-trace trace.zip
npx playwright install
npx playwright install chromium
npx playwright install --with-deps chromium
When you need full Playwright API control in a script (e.g., loops, complex logic):
// Must run from a dir with playwright installed: cd /tmp/play_test && npm install playwright
const { chromium } = require('playwright');
const browser = await chromium.connectOverCDP('http://localhost:9222');
const context = browser.contexts()[0];
const page = context.pages()[0];
// ... interact with page
await browser.close(); // disconnects, does not close Brave
Note: playwright is not globally installed. Either:
/tmp/play_test/ (has it installed)playwright-cli with CDP config instead — no scripting neededplaywright-cli + CDP config over writing Node.js scripts for live session automation — it's faster and requires no boilerplatesnapshot before clicking — gets accurate element refs, avoids selector guessingplaywright-cli show to visually monitor what the automation is doingnpx playwright codegen to bootstrap test scripts, then refine manually--trace on during test development for failure debugging--remote-debugging-port=9222)