playwright-cli

SkillWeb & browsing

Once added, your AI can control a web browser to take screenshots, inspect page elements, and generate browser automation code. It bundles the common Playwright actions, so tasks like checking how a page looks or turning a manual browser routine into code can be handled on request.

Use playwright-cli in Claude, ChatGPT or Ahel Desktop

Free. Sign in, add playwright-cli and connect your AI. About a minute.

Also: Claude Code · Cursor · Codex

Then ask your AI: use the playwright-cli skill

Details

Instructions available. Your AI can read the instructions. Execution depends on the setup they require.

After adding it, ask your AI to open a page and take a screenshot, or describe a set of browser steps and have it record and generate the automation code.

playwright-cliStart free

What your AI can do with it

  • Take screenshots of web pages
  • Inspect page elements and their selectors
  • Record browser actions and generate Playwright code from them
  • Control a web browser to carry out tasks on pages

What this skill tells your AI

The instructions your AI receives, as published by appautomaton/webmaton in skills/playwright-cli/SKILL.md and read by Ahel’s review.

playwright-cli is a token-efficient shell interface to Playwright. It keeps browser state across commands, exposes page snapshots with stable element refs such as e15, and prints the Playwright code it ran so the interaction can be converted into tests.

Core Workflow

playwright-cli open https://example.com
playwright-cli snapshot
playwright-cli click e15
playwright-cli fill e5 "user@example.com"
playwright-cli press Enter
playwright-cli close

Use refs from the latest snapshot by default. Re-run snapshot after navigation, major DOM changes, or a failed ref action. Use CSS selectors or Playwright locators only when refs are unavailable or unstable.

Operating Rules

  • Discover exact syntax with playwright-cli --help and playwright-cli <command> --help; the CLI changes quickly.
  • Use --raw when piping values into other tools. Use --json only if the installed CLI advertises it.
  • Use named sessions with -s=<name> for concurrent or long-lived work.
  • Use open --persistent only when disk-persisted cookies/storage are needed.
  • Prefer attach --cdp=chrome, attach --cdp=msedge, or attach --cdp=http://127.0.0.1:9222 when the task needs an existing browser/session.
  • Close sessions when finished. Reserve close-all and kill-all for cleanup of stale sessions.

Common Tasks

playwright-cli open https://example.com --browser=chrome
playwright-cli snapshot --depth=4
playwright-cli screenshot --filename=page.png
playwright-cli console warning
playwright-cli requests --filter="/api/.*"
playwright-cli request-headers 3
playwright-cli run-code "async page => await page.context().grantPermissions(['geolocation'])"
playwright-cli tracing-start
playwright-cli tracing-stop

For a broader command map, read references/cli-reference.md.

Playwright Test Debugging

When a Playwright test fails, prefer the CLI debug workflow:

PLAYWRIGHT_HTML_OPEN=never npx playwright test --debug=cli
# wait for "Debugging Instructions", then attach to the printed session
playwright-cli attach tw-abcdef

Keep the test process running while inspecting the paused page. Use snapshots, console/network inspection, and generated Playwright code to identify the fix.

References

Load only what the task needs:

  • references/cli-reference.md — command groups, output modes, and version-sensitive features
  • references/playwright-tests.md — running and debugging Playwright tests
  • references/request-mocking.md — route mocking and request interception
  • references/running-code.md — custom Playwright snippets with run-code
  • references/session-management.md — named sessions and cleanup
  • references/storage-state.md — cookies, localStorage, sessionStorage, auth state
  • references/test-generation.md — turning CLI output into tests
  • references/tracing.md — trace capture and inspection
  • references/video-recording.md — WebM recording and chapter markers
  • references/element-attributes.md — inspect IDs/classes/data attributes not shown in snapshots

Signals

GitHub stars
20
Forks
1
Last commit
Aug 2026
Hacker News mentions
1

What people say

Users report that Playwright CLI makes browser interactions with coding agents more reliable and predictable, with one user fully replacing Playwright MCP with it. However, others complain it still burns through tokens like MCP and can get stuck or fail to load project profiles, with some unsure of its actual use case.

Praised for
more reliable/predictable browser interactions for agents
solid replacement for Playwright MCP
Complaints
still burns through tokens quickly
gets stuck or fails to find project profile
unclear use case / doesn't write tests itself

Summarized from 13 public posts. Opinions are theirs, not Ahel's.

Advanced
Item type
skill
Key
playwright-cli
Source
github.com/appautomaton/webmaton