explaingit

microsoft/playwright-cli

Analysis updated 2026-06-24

10,311TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

Playwright CLI is a terminal tool that lets AI coding agents and developers control a real web browser with short commands, enabling efficient browsing, form-filling, and screenshots without loading full page dumps into the AI.

Mindmap

mindmap
  root((playwright-cli))
    Core Idea
      Token-efficient browsing
      AI agent focused
    Commands
      Navigate and reload
      Click and type
      Screenshots and PDF
    Session Features
      Cookie persistence
      Tab management
      File uploads
    Visual Dashboard
      Live session preview
      Human takeover
      Background monitoring
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Enable an AI coding agent like Claude Code to browse the web, click buttons, and fill out forms as part of an automated task.

USE CASE 2

Take screenshots or save pages as PDFs from the terminal during development or automated testing.

USE CASE 3

Run persistent browser sessions with cookies and login state preserved across multiple commands.

USE CASE 4

Watch and optionally take manual control of browser sessions being driven by an AI agent using the live visual dashboard.

What is it built with?

TypeScriptNode.jsPlaywrightnpm

How does it compare?

microsoft/playwright-clics01/gdbguioramasearch/orama
Stars10,31110,33210,336
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

In plain English

Playwright CLI is a command-line tool from Microsoft that lets AI coding agents (and human developers) control a web browser from the terminal. Instead of writing long browser automation scripts upfront, you run short commands like "open a URL," "click this button," or "take a screenshot," and the tool handles the rest. The main audience is AI agents such as Claude Code or GitHub Copilot that need to browse the web, test a site, or fill out forms as part of a larger task. The core idea is token efficiency. When an AI agent uses this tool, it does not need to load the entire structure of a web page into its memory. It just fires a short command and gets back a targeted result. This makes it faster and cheaper for AI agents to do browser work compared to older approaches that dump the full page layout into the model. Once installed via npm, the CLI offers a large set of commands covering navigation (go to a URL, go back, reload), interaction (click, type, fill a form, check a checkbox, drag and drop), keyboard and mouse control, tab management, cookie handling, and file uploads. You can take screenshots or save pages as PDFs. Sessions let you keep browser state across multiple commands, so cookies and login sessions are preserved until you close the browser. A visual dashboard called "show" lets you watch all running browser sessions in real time, see live previews, and even take over mouse and keyboard control from a human if needed. This is useful when an AI agent is doing background browsing and you want to observe or correct it. The tool also supports a "skills" concept where supported coding agents can automatically discover and use the available commands just by reading the help output, requiring no extra configuration.

Copy-paste prompts

Prompt 1
I'm building an AI agent and want to use playwright-cli to browse the web. Write a sequence of CLI commands that logs into a site, navigates to the account dashboard, and takes a screenshot.
Prompt 2
Show me how to configure Claude Code to use playwright-cli as a browser tool so it can open URLs and click elements during a coding session.
Prompt 3
Using playwright-cli sessions, write a script that opens 3 browser tabs, fills a form on each with different data, and saves a screenshot of each result.
Prompt 4
Help me set up playwright-cli in a GitHub Actions workflow so my AI agent can do browser testing and upload screenshots as build artifacts.

Frequently asked questions

What is playwright-cli?

Playwright CLI is a terminal tool that lets AI coding agents and developers control a real web browser with short commands, enabling efficient browsing, form-filling, and screenshots without loading full page dumps into the AI.

What language is playwright-cli written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, Playwright.

How hard is playwright-cli to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is playwright-cli for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.