playwright-cli

A command-line browser automation tool that turns plain-language requests into Playwright commands. Playwright is a tool for controlling browsers during testing and debugging.

In plain words
What is it for?
It helps open pages, interact with elements, capture snapshots and screenshots, inspect console or network activity, test assertions, and manage browser tabs.
Why use it?
It reduces the need to remember exact commands for navigation, clicks, form entry, screenshots, PDFs, and browser inspection.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ivancampos/agents/playwright-cli
Any agent
npx skills add IvanCampos/agents --skill playwright-cli
Clone the repo
git clone --depth 1 https://github.com/IvanCampos/agents

Made for: Claude Code, Codex.

Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,103 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00074 $0.01103
Opus 5 $0.00037 $0.00551
Sonnet 5 $0.00015 $0.00221
Haiku 4.5 $0.00007 $0.00110

Measured 2d ago against content hash cfecc4f0f13c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

playwright-cli scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/playwright-cli/SKILL.md · 111 lines

How it starts

The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Playwright CLI

Use playwright-cli directly (already installed) to execute browser automation from natural-language requests.

Quick Start

  1. Verify the CLI is available:
    command -v playwright-cli >/dev/null 2>&1
    
  2. Open a browser session:
    playwright-cli open https://example.com
    
  3. Capture refs before ref-based commands:
    playwright-cli snapshot
    

Natural-Language Execution Workflow

  1. Parse the request into atomic actions.
  2. Convert each action to command templates from references/command-map.md.
  3. Run playwright-cli snapshot before commands that require element refs (click, fill, check, select, hover, drag, etc.) unless a fresh snapshot is already available.
  4. Re-run playwright-cli snapshot after navigation or major DOM changes.
  5. For assertions, prefer playwright-cli eval and parse the ### Result value from stdout.
  6. Treat ### Error output as command failure, even when process exit code is 0.
  7. For screenshots, capture PNG first, then compress to JPEG with ffmpeg before final save/return.
  8. Use explicit filenames when saving artifacts (screenshots, snapshots, PDFs, videos, storage state).
  9. Return executed commands and key results (URLs, counts, file paths, errors).

Command Mapping Rules

  • Map intent verbs directly:
    • open/launch -> open
    • navigate -> goto
    • click/tap -> click
    • double click/double tap -> dblclick
    • type/input -> type
    • fill/set field -> fill
    • back/forward/refresh -> go-back/go-forward/reload
  • Preserve user-provided optional flags and values.
  • Omit optional args when unspecified.
  • Use -s=<name> when the user asks for a named/session-isolated browser.
  • Prefer native commands over eval and run-code; use eval or run-code only if no first-class command exists.
  • Keep session names short and filesystem-safe (lowercase letters + numbers, no punctuation, target <= 12 chars) to avoid local socket path errors on macOS.

Read the full file on GitHub · 111 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 111 lines · 74 tokens per session scan A cfecc4f0f13c

Subscribe to this mod's changes

playwright-cli is a skill published in the GitHub repository IvanCampos/agents (5 stars, last pushed 6mo ago), licensed MIT. It adds 74 tokens to every session and 1,103 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.