# Playwright CLI

> Automate browser interactions with Playwright CLI workflows, including ordered form filling, selector clicks, and coordinate-based screen clicks. Use when tasks require logging in, submitting web forms, clicking buttons/links, or taking screenshots after UI actions. Use when this capability is needed.

- Skill: `tomevault-io/playwright-cli-20` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/playwright-cli-20`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/playwright-cli-20/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/playwright-cli-20

---


# Playwright CLI

Run scripted browser actions with a deterministic step list.

## Prerequisites

- Ensure Python dependencies are installed (`playwright` is required).
- If browsers are not installed yet, run:

```bash
playwright install chromium
```

## Primary Script

Use `app/skills/playwright-cli/scripts/playwright_cli.py`.

## Quick Examples

### Fill a login form and submit

```bash
python app/skills/playwright-cli/scripts/playwright_cli.py ^
  --url "https://example.com/login" ^
  --step "fill:#email=user@example.com" ^
  --step "fill:#password=super-secret" ^
  --step "click:button[type='submit']" ^
  --step "wait:2000" ^
  --step "screenshot:login-result.png"
```

### Click by screen coordinates

```bash
python app/skills/playwright-cli/scripts/playwright_cli.py ^
  --url "https://example.com/canvas" ^
  --step "clickxy:420,315" ^
  --step "screenshot:clicked-point.png"
```

### Run steps from a JSON file

```bash
python app/skills/playwright-cli/scripts/playwright_cli.py --url "https://example.com" --steps-file steps.json
```

`steps.json` structure:

```json
[
  {"action": "fill", "selector": "#name", "value": "Ada Lovelace"},
  {"action": "click", "selector": "button[type='submit']"},
  {"action": "screenshot", "path": "result.png"}
]
```

## Step Syntax

- `fill:<selector>=<value>`
- `click:<selector>`
- `clickxy:<x>,<y>`
- `wait:<milliseconds>`
- `waitfor:<selector>`
- `press:<selector>=<key>`
- `screenshot:<path>`

## Notes

- Keep selectors specific (`#id`, `[name='field']`, or explicit button selectors) to reduce flaky runs.
- Prefer headless mode for automation; use `--headed` for troubleshooting interactive pages.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/thebobhuff) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

