Overview
This skill provides a command-line tool based on Playwright, used to start a browser service and perform debugging operations such as navigation, evaluating JS, screenshots, element picking, and log listening. Currently only Chromium is supported (connected via CDP).
Quick Start
The working directory should be the directory containing this file, and the example commands are executed from that directory by default. Note: You must execute the script directly, do not use
uv run pythonorpython。
Example of script invocation:
cd skills/pwdebug && ./scripts/pwdebug.py start
Incorrect example:
uv run python skills/pwdebug/scripts/pwdebug.py start
python skills/pwdebug/scripts/pwdebug.py start
- Start the browser service (resident process):
./scripts/pwdebug.py start
- Open a page in a new tab:
./scripts/pwdebug.py nav https://example.com --new
- Execute a JS expression:
./scripts/pwdebug.py evaluate "document.title"
- Screenshot:
./scripts/pwdebug.py screenshot --full
- Interactively pick an element:
./scripts/pwdebug.py pick "点击登录按钮"
- Listen to console logs:
./scripts/pwdebug.py watch-logs
- View recent logs:
./scripts/pwdebug.py logs 100
Notes
- CLI entry point:
./scripts/pwdebug.py - Log path:
~/.cache/pwdebug/console.log.jsonl - State path:
~/.cache/pwdebug/server.json
Dependencies and Installation
- Script dependencies are managed through
uv --script.