Omarchy Apps Sponsor

Browser automation guide

Playwright CLI on Omarchy

Microsoft's browser automation CLI built for coding agents — your agent opens pages, clicks, and checks your app in a real browser.

Reviewed 2026-11-25 · independent editorial guide

Short answer

Install Playwright CLI with omarchy pkg add playwright-cli, then run playwright-cli install in your project to set up the workspace and download a browser. No account, no API key, no sign-in; add playwright-cli install --skills so your coding agent learns the commands.

Playwright CLI on Omarchy

Playwright CLI on Omarchy is Microsoft’s browser automation CLI built for coding agents: your agent opens pages, clicks, and checks your app in a real browser, using far fewer tokens than an MCP server would.

TL;DR

omarchy pkg add playwright-cli

Then run playwright-cli install, playwright-cli install --skills, and playwright-cli open https://example.com. That installs Playwright CLI v0.1.25-1 (3.8 MB download, 19.2 MB installed, depends on nodejs, Apache-2.0). No account, no API key, no sign-in. playwright-cli install sets up the workspace and downloads a browser, and the skill install teaches your coding agent the commands.

Getting started (5 minutes)

1. Install and set up a workspace.

Run omarchy pkg add playwright-cli, then in your project folder run playwright-cli install. It creates a .playwright directory in the current working directory, adds it to .gitignore, and downloads the configured browser if it is missing. Browsers live in ~/.cache/ms-playwright. You need Node.js 20 or newer; the Omarchy package depends on nodejs, so it comes along. If your project already depends on Playwright 1.59 or newer, you can skip the global install and use npx playwright cli instead.

2. Install the agent skill.

Coding agents like Claude Code and GitHub Copilot use locally installed skills for richer context about the available commands:

playwright-cli install --skills        # project skill, .claude/skills/playwright-cli
playwright-cli install --skills -g     # home directory, ~/.claude/skills, for every project

Use --skills=agents instead if your agent reads .agents/skills (Codex does). The skill teaches the agent the commands without dumping a help page into its context.

3. Three things worth doing in the first session:

  • Open a page and watch it work. playwright-cli open https://example.com opens the page headless by default. Add --headed to see the browser window, and --browser=chrome or --browser=firefox to pick a browser. playwright-cli list shows your sessions, and playwright-cli show opens a dashboard with a live view of every session, where you can take over the keyboard if the agent gets stuck on something like a CAPTCHA.
  • Use named sessions for separate logins. Each named session gets its own browser, cookies, storage, and tabs, so an admin login and a student login never share state. Start one with playwright-cli open -s=admin <url>, or tie a whole agent session to one with PLAYWRIGHT_CLI_SESSION=checkout claude ..
  • Keep auth state out of git. The docs recommend keeping saved logins under playwright/.auth and warn that the state file “may contain sensitive cookies and headers that could be used to impersonate you or your test account”. Add playwright/.auth to .gitignore before you save any login.

Common issues & fixes

On Omarchy (Arch), playwright-cli install-browser --with-deps fails with “apt-get: command not found” and exit code 127

Playwright’s dependency installer assumes Debian/Ubuntu and calls apt-get, which does not exist on Arch. This is unverified on Omarchy specifically; it is documented for Arch in general, and it is the first thing to check on this machine.

Fix: Install the system libraries with pacman instead, or skip the auto-install and point Playwright at the Chromium you already have: sudo pacman -S chromium, then set executablePath: "/usr/bin/chromium" in your Playwright config’s launch options. The bundled Chromium often fights Arch on library versions anyway, so the system browser is the reliable path. (Arch Playwright gist)

A test run stops with “Host system is missing dependencies to run browsers”

The browsers downloaded fine, but the system libraries never were installed. This is usually an old Playwright: versions before 1.45 ask apt for Ubuntu 22.04 package names that newer Ubuntu renamed.

Fix: Upgrade the package, then install browsers and libraries together with playwright-cli install-browser --with-deps (or npx playwright install --with-deps in a project). (maazzindani.com fix guide)

Browser install fails with “Playwright does not support chromium on ubuntu26.04-x64”

Your Playwright is too old for your OS. Support for Ubuntu 26.04 arrived in Playwright 1.61.0, and 1.62.0 dropped Debian 11 while 1.63.0 dropped Ubuntu 20.04, so the fix direction depends on which side is stale: upgrade Playwright if your OS is new, or pin an older Playwright if your OS is old. On Omarchy, which tracks Arch, this exact Ubuntu error should not appear, but the same version-mismatch shape can.

Fix: Upgrade Playwright if your OS is new, or pin an older Playwright if your OS is old. (cybernative.ai guide)

After a global npm install, your shell says “playwright-cli: command not found”

The global bin directory is not on your PATH. With the Omarchy package this should not happen, since pacman-managed binaries land on PATH.

Fix: Try the local version with npx playwright-cli --version first; if that works, use npx playwright-cli for every command, or fix your PATH so the global npm bin directory is included. (npm.io, @mseep/cli)

The agent cannot see what the browser is doing, or it gets stuck on a login or CAPTCHA

Run playwright-cli show to open the visual dashboard. It shows a live view of every running browser session, and you can take over the keyboard yourself when the agent is stuck. The browser profile is kept in memory by default, so a session that ends loses its login.

Fix: Open the dashboard with playwright-cli show and take over the keyboard when the agent is stuck; save auth state to playwright/.auth if you need a login to survive. (Medium, coding agents with Playwright CLI)

Pairs well with / If you hate this, try

Pairs well with

  • Claude Code or Codex (the agents it was built for), Playwright Test (npm init playwright@latest) to run the specs your agent writes, and git (specs and snapshots belong in the repo).

If you hate this, try

  • If you hate the CLI shape: Playwright MCP (npx @playwright/mcp@latest) gives the same browser control through the Model Context Protocol, Puppeteer is the script-first alternative for hand-written automation, and Selenium covers the broadest browser and language matrix.

Comparison: Playwright CLI vs Playwright MCP vs Puppeteer vs Selenium

Playwright CLIPlaywright MCPPuppeteerSelenium
PriceFree, Apache-2.0; no account, no keyFree, MIT; no account, no keyFree, Apache-2.0; no account, no keyFree, Apache-2.0; no account, no key
Best forCoding agents driving a browser with minimal token useAI agents that work through MCP tool callsHand-written browser scripts in Node.jsCross-browser, cross-language test grids
Omarchy installomarchy pkg add playwright-clinpx @playwright/mcp@latestnpm install puppeteerPer-language package install

Verdict: Pick Playwright CLI if a coding agent is doing the driving; its commands avoid loading large tool schemas and accessibility trees into the model context, which is the whole point of the CLI over the MCP server. Pick Playwright MCP if your agent only speaks MCP, and Puppeteer if a human is writing the script.

How to switch from Playwright MCP (~10 minutes per project)

  1. Export from MCP: your MCP server entry is a line in your agent config (for Claude Code, claude mcp add playwright npx @playwright/mcp@latest). Note which browsers and settings it used; nothing else to export.
  2. Import into the CLI: install the package, run playwright-cli install in the project, then playwright-cli install --skills so the agent learns the commands. Point the agent at the CLI and let it discover commands on its own, or set PLAYWRIGHT_CLI_SESSION to pin it to one named session.
  3. What doesn’t transfer: MCP tool-call history and any MCP-specific server config. The browser itself, the tests, and the project config are the same.
  4. Time estimate: about 10 minutes per project.

Open the Playwright CLI package

See the live version, upstream screenshot, requirements, source and exact Omarchy install command.

View Playwright CLI →

Frequently asked questions

Do I need a coding agent to use Playwright CLI?

No, but it was built for one. You can run every command yourself in the terminal; the skill install and the session model just make it much more useful when an agent is driving.

Which browsers does it use?

Chromium, Firefox, and WebKit. The CLI downloads the browser automatically on first use, or you can install explicitly with playwright-cli install-browser, including one browser at a time (playwright-cli install-browser firefox).

Where are the browsers stored?

In ~/.cache/ms-playwright. The workspace itself lives in a .playwright directory inside the project, which playwright-cli install also adds to .gitignore.

Does it need an account or API key?

No. There is no sign-in, no key, and no billing. It is a local tool that drives a local browser.

How is it different from Playwright MCP?

Both drive the same browsers. The CLI is more token-efficient for coding agents because commands avoid loading large tool schemas and verbose accessibility trees into the model context; the snapshot sits in a file the agent opens only when it needs it. MCP loads tool schemas into context on every call.

Can I watch what the agent is doing in the browser?

Yes. playwright-cli show opens a dashboard with a live view of every session, and you can take over the keyboard. Add --headed to playwright-cli open to see the browser window directly.

Official sources

Commands and fixes verified against official sources November 2026; on-machine verification pending.