patchright-cli

Anti-detect browser automation CLI. Commands follow Microsoft's playwright-cli, but it uses Patchright (undetected Playwright fork) to bypass bot detection.
Install · Quick Start · Commands · Snapshots · Agent Integration
Highlights
| Feature |
|---|
| :shield: | Bypasses Akamai, Cloudflare, and other anti-bot systems |
| :rocket: | playwright-cli's command names and arguments — little to relearn |
| :robot: | Built for AI agents (Claude Code, Codex, etc.) with YAML snapshots |
| :zap: | Daemon architecture — browser stays open between commands |
| :package: | pip install / uvx — no Docker, no config files |
| :lock: | Persistent profiles for maintaining login sessions |
Install
[!TIP]
Just paste this into your AI coding agent — it will do the rest:
Install and set up patchright-cli by following the instructions here:
https://raw.githubusercontent.com/AhaiMk01/patchright-cli/main/docs/installation.md
Your agent handles the install, browser setup, and skill configuration automatically.
For LLM Agents
curl -s https://raw.githubusercontent.com/AhaiMk01/patchright-cli/main/docs/installation.md
[!IMPORTANT]
Requirements: Python 3.12+ and Google Chrome
# Recommended — always runs latest version, no install needed
uvx patchright-cli open https://example.com
Other install methods
# Via pip
pip install patchright-cli
patchright-cli open https://example.com
patchright-cli close
# Update
pip install --upgrade patchright-cli
From source:
git clone https://github.com/AhaiMk01/patchright-cli.git
cd patchright-cli
uv venv && uv pip install -e .
python -m patchright install chromium
Docker
A prebuilt image is available from GHCR:
docker pull ghcr.io/ahaimk01/patchright-cli:latest
By default the container runs patchright-cli directly, so it can be used for normal CLI commands:
docker run --rm ghcr.io/ahaimk01/patchright-cli:latest --help
docker run --rm ghcr.io/ahaimk01/patchright-cli:latest profile-list
Browser sessions live inside the container, so for a sequence of standalone CLI commands keep the same container running:
docker run --rm -it \
--name patchright-cli \
-v patchright-profiles:/root/.patchright-cli \
--entrypoint /bin/sh \
ghcr.io/ahaimk01/patchright-cli:latest
uv run patchright-cli open https://example.com --headless
uv run patchright-cli snapshot
uv run patchright-cli close
For MCP over stdio, set PATCHRIGHT_CLI_MODE=mcp-stdio and keep stdin attached. The volumes keep logins and output after the container exits:
docker run --rm -i \
-e PATCHRIGHT_CLI_MODE=mcp-stdio \
-v ./patchright:/patchright \
-v patchright-profiles:/root/.patchright-cli \
ghcr.io/ahaimk01/patchright-cli:latest
For a long-running MCP server over Streamable HTTP, set PATCHRIGHT_CLI_MODE=mcp-http:
docker run -d \
--name patchright-mcp \
-p 127.0.0.1:9090:9090 \
-e PATCHRIGHT_CLI_MODE=mcp-http \
-e PATCHRIGHT_CLI_MCP_TOKEN=replace-with-a-long-random-token \
-v ./patchright:/patchright \
-v patchright-profiles:/root/.patchright-cli \
ghcr.io/ahaimk01/patchright-cli:latest
The HTTP MCP endpoint is then available at http://localhost:9090/mcp. The MCP server defaults to headless mode in the image and uses /patchright as its filesystem root. CLI commands inside the container still need --headless, since there is no display.
An example compose.yml is included in the repository: