SuperAPI AI Directory

pwdebug

Testing & quality

View repository

Updated 10-15 20:34

About this skill

Playwright Browser Debugging CLI

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 python or python。

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
  1. Start the browser service (resident process):
./scripts/pwdebug.py start
  1. Open a page in a new tab:
./scripts/pwdebug.py nav https://example.com --new
  1. Execute a JS expression:
./scripts/pwdebug.py evaluate "document.title"
  1. Screenshot:
./scripts/pwdebug.py screenshot --full
  1. Interactively pick an element:
./scripts/pwdebug.py pick "点击登录按钮"
  1. Listen to console logs:
./scripts/pwdebug.py watch-logs
  1. 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 .