Playwright Cli logo

Playwright Cli

Community
fugazi
playwright-cli

Drive a live browser from the CLI with playwright-cli to navigate, interact, snapshot, and capture evidence. Use for ad-hoc browser commands, page inspection, screenshots, traces, network mocking, session management, or interactive debugging—not authoring @playwright/test specs. Keywords: playwright-cli, browser automation, live session, snapshot, console, tracing.

Overview

Publisherfugazi
Repositorytest-automation-skills-agents
Skill nameplaywright-cli
Stars
238
Forks
42
Bundled files
12
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 12 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by fugazi on GitHub. Read the source before you install it.

Installation

Install the Playwright Cli AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/fugazi/test-automation-skills-agents.git /tmp/test-automation-skills-agents
mkdir -p .claude/skills
cp -r /tmp/test-automation-skills-agents/skills/playwright-cli .claude/skills/playwright-cli
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Playwright Cli in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Playwright Cli on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Playwright Cli is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Browser Automation with playwright-cli

Quick start

bash
playwright-cli open
playwright-cli goto https://playwright.dev
playwright-cli click e15        # use refs from snapshot
playwright-cli type "search query"
playwright-cli press Enter
playwright-cli snapshot
playwright-cli close

Commands

Core

bash
playwright-cli open [url]
playwright-cli goto <url>
playwright-cli type "<text>"
playwright-cli click <ref>
playwright-cli dblclick <ref>
playwright-cli fill <ref> "<text>" [--submit]
playwright-cli drag <ref> <ref>
playwright-cli drop <ref> [--path=<file> | --data="mime=value"]
playwright-cli hover <ref>
playwright-cli select <ref> "<value>"
playwright-cli upload <path>
playwright-cli check <ref>
playwright-cli uncheck <ref>
playwright-cli snapshot
playwright-cli find "<text>" | --regex "<pattern>" [--regex "/pattern/i"]
playwright-cli eval "<js>" [ref]
playwright-cli dialog-accept ["text"]
playwright-cli dialog-dismiss
playwright-cli resize <w> <h>
playwright-cli close

Navigation & Keyboard

bash
playwright-cli go-back | go-forward | reload
playwright-cli press <key>          # Enter, ArrowDown, etc.
playwright-cli keydown | keyup <key>

Mouse

bash
playwright-cli mousemove <x> <y>
playwright-cli mousedown [right]
playwright-cli mouseup [right]
playwright-cli mousewheel <dx> <dy>

Save as

bash
playwright-cli screenshot [ref] [--filename=<f>] [--hires]
playwright-cli pdf --filename=<f>

Tabs

bash
playwright-cli tab-list
playwright-cli tab-new [url]
playwright-cli tab-close [index]
playwright-cli tab-select <index>

Storage

bash
playwright-cli state-save [file] | state-load <file>
playwright-cli cookie-list [--domain=] | cookie-get <name>
playwright-cli cookie-set <name> <val> [--domain= --httpOnly --secure]
playwright-cli cookie-delete <name> | cookie-clear
playwright-cli localstorage-list | localstorage-get <key>
playwright-cli localstorage-set <key> <val> | localstorage-delete <key> | localstorage-clear
playwright-cli sessionstorage-list | sessionstorage-get <key>
playwright-cli sessionstorage-set <key> <val> | sessionstorage-delete <key> | sessionstorage-clear

Network

bash
playwright-cli route "<glob>" [--status= | --body=]
playwright-cli route-list
playwright-cli unroute ["<glob>"]

DevTools

bash
playwright-cli console [warning|error]
playwright-cli requests
playwright-cli request <index>
playwright-cli run-code "<js>" | --filename=<f>
playwright-cli tracing-start | tracing-stop
playwright-cli recording-start      # record user actions; print Playwright code on stop
playwright-cli recording-stop
playwright-cli video-start <file> | video-chapter "<title>" [--description= --duration=] | video-stop
playwright-cli video-show-actions [--duration= --position=] | video-hide-actions
playwright-cli show --annotate          # UI review / design feedback
playwright-cli generate-locator <ref> [--raw]
playwright-cli highlight <ref> [--style=] | highlight <ref> --hide | highlight --hide

Raw output

--raw strips status/snapshot, returns only the result value.

bash
playwright-cli --raw eval "JSON.stringify(performance.timing)"
playwright-cli --raw snapshot > before.yml
playwright-cli click e5
playwright-cli --raw snapshot > after.yml
diff before.yml after.yml

For JSON wrapping: playwright-cli list --json

Open parameters

bash
playwright-cli open --browser=chrome|firefox|webkit|msedge
playwright-cli open --mobile | --device="iPhone 15"
playwright-cli open --persistent | --profile=/path/to/profile
playwright-cli attach --extension=chrome | --cdp=chrome|msedge|http://host:port
playwright-cli open --config=<file>
playwright-cli delete-data

Windows: See references/windows-notes.md for URL escaping rules.

Snapshots

After each command, playwright-cli provides a snapshot of the current browser state.

bash
playwright-cli snapshot [ref] [--filename=] [--depth=N] [--boxes]
playwright-cli find "<text>"
playwright-cli find --regex "\\$[0-9]+\\.[0-9]{2}"

Targeting elements

bash
playwright-cli click e15                               # ref from snapshot
playwright-cli click "#main > button.submit"           # CSS selector
playwright-cli click "getByRole('button', { name: 'Submit' })"  # role locator
playwright-cli click "getByTestId('submit-button')"    # test id

Browser sessions

bash
playwright-cli -s=<name> open [url] [--persistent | --profile=<dir>]
playwright-cli -s=<name> click e6
playwright-cli -s=<name> close
playwright-cli list
playwright-cli close-all
playwright-cli kill-all

Installation

bash
# Check local version
npx --no-install playwright --version
# Use local
npx playwright cli
# Install global
npm install -g @playwright/cli@latest

When NOT to Use This Skill

  • Authoring or maintaining versioned @playwright/test spec files (use playwright-e2e-testing).
  • Selenium/Java browser automation (use webapp-selenium-testing).
  • Governing a large regression suite, tiers, or CI sharding (use playwright-regression-testing).
  • Long-running recorded test suites — playwright-cli drives a single live, interactive session, not a parallel run.

Red Flags

  • Relying on --debug=cli as a permanent test runner — it is an exploration/debug aid, not a CI executor.
  • Leaving background debug sessions running between scenarios — they leak state and ports; always stop them.
  • Opening the app URL directly instead of going through the seed test — custom setup in the test is then missed.
  • Using sleeps or networkidle as a fix for timing issues — prefer web-first assertions.

References


Verification

  • Session lifecycle managed — every playwright-cli open/-s=<name> open is paired with a close/close-all; no orphan sessions left running.
  • Elements addressed by ref — interactions use snapshot refs (e15) or generated locators, not guessed CSS selectors.
  • Evidence captured where needed — screenshots, traces, or console/request logs recorded for the task at hand.
  • Background debug sessions stopped--debug=cli runs are terminated before moving on or finishing.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Playwright Cli AI skill do?

Drive a live browser from the CLI with playwright-cli to navigate, interact, snapshot, and capture evidence. Use for ad-hoc browser commands, page inspection, screenshots, traces, network mocking, session management, or interactive debugging—not authoring @playwright/test specs. Keywords: playwright-cli, browser automation, live session, snapshot, console, tracing.

Why use Playwright Cli on TypingMind?

Because you install it once and use it with any model. Playwright Cli is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Playwright Cli in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/fugazi/test-automation-skills-agents/tree/main/skills/playwright-cli. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Playwright Cli?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Playwright Cli?

As many as you like. As long as a model supports skills, you can use Playwright Cli with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Playwright Cli AI skill free?

Yes. It is published on GitHub by fugazi under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇