| name | patchright-cli |
| description | Anti-detect browser automation using Patchright (undetected Playwright fork). Use when you need to interact with websites that block regular Playwright/Chrome DevTools, such as Akamai/Cloudflare-protected sites. Provides the same command interface as playwright-cli but bypasses bot detection. Use this skill whenever the user asks to automate a browser, scrape a website, fill forms, log into sites, take screenshots, or do anything involving Chrome automation — especially if the target site has bot protection like Cloudflare or Akamai. |
Anti-Detect Browser Automation with patchright-cli
patchright-cli drives a real Chrome browser that passes bot detection (Cloudflare, Akamai, etc.). It works as a CLI: you issue commands, get back page state. This is the tool to reach for whenever regular Playwright or Chrome DevTools gets blocked.
Quick start
patchright-cli open https://example.com
patchright-cli snapshot
patchright-cli click e5
patchright-cli fill e3 "search query"
patchright-cli press Enter
patchright-cli screenshot
patchright-cli close
Every interaction follows: open -> snapshot -> read refs -> interact -> snapshot again -> repeat. Refs are ephemeral -- they change on every page update. If a ref fails, re-snapshot.
Command chaining
Commands can be chained with &&. The browser persists via a background daemon, so chaining is safe.
patchright-cli open https://example.com && patchright-cli screenshot
patchright-cli snapshot
patchright-cli click e5
Global options
These go before the command:
--headless
--persistent
--profile=/path
--proxy=<url>
-s=mysession
--port=9322
--config=<path>
--cdp=<url>
--device="iPhone 15"
--viewport-size=1280x720
--locale=en-US
--timezone=America/New_York
--geolocation=40.7,-74.0
--user-agent=<ua>
--grant-permissions=geolocation,camera
--timeout-action=10000
--timeout-navigation=30000
--show-port=9322
--raw
--json
Core commands
Browser lifecycle
open [url]
open --persistent
open --headless
attach --cdp=<url>
close
detach
Navigation
goto <url>
go-back / go-forward
reload
url
title
Snapshots
snapshot
snapshot <ref>
snapshot --depth=N
snapshot -i
snapshot --boxes
Interaction
click <ref>
click <ref> right
click <ref> --modifiers=Alt
dblclick <ref>
hover <ref>
drag <ref> <target-ref>
drop <ref> --path=./file.png
drop <ref> --data="text/plain=hello"
Form input
fill <ref> "value"
fill <ref> "value" --submit
type "text"
type "text" --submit
select <ref> "option"
check <ref> / uncheck <ref>
Text and screenshots
text <ref>
text "css-selector"
screenshot
screenshot <ref>
screenshot --full-page
screenshot --filename=F
Scroll, wait, and keyboard
scroll <dx> <dy>
scroll-to <ref>
wait <ms>
wait-for <ref>
wait-for <ref> --state=hidden
press <key>
keydown <key> / keyup <key>
Mouse
mousemove <x> <y>
mousedown / mouseup
mousewheel <dx> <dy>
Tabs
tab-list
tab-new <url>
tab-select <index>
tab-close [index]
Dialogs
Dialogs must be pre-armed before the action that triggers them:
dialog-accept
dialog-accept "OK"
dialog-dismiss
DevTools
console
console warning
network
requests
network --static
request <id>
request <id> --body
generate-locator <ref>
highlight <ref>
highlight <ref> --hide
Recording and capture
screenshot / pdf
video-start / video-stop
tracing-start / tracing-stop
codegen / codegen-stop
resize <w> <h>
upload <file> [ref]
show
Storage
cookie-list / cookie-get / cookie-set / cookie-delete / cookie-clear
cookie-export / cookie-import
localstorage-list / localstorage-get / localstorage-set / localstorage-delete / localstorage-clear
sessionstorage-list / sessionstorage-get / sessionstorage-set / sessionstorage-delete / sessionstorage-clear
state-save <file> / state-load <file>
Network
route "<pattern>" [options]
route-list / unroute
network-state-set offline
network-state-set online
Sessions
list
close-all
kill-all
delete-data
grant-permissions <perms>
Common patterns
Login flow
patchright-cli open https://example.com/login --persistent
patchright-cli snapshot
patchright-cli fill e3 "user@example.com"
patchright-cli fill e5 "password123"
patchright-cli click e8
patchright-cli snapshot
Extracting data
patchright-cli open https://example.com/data
patchright-cli snapshot
cat > /tmp/extract.js << 'JSEOF'
JSON.stringify(
[...document.querySelectorAll('table tr')].map(row =>
[...row.cells].map(cell => cell.textContent.trim())
)
)
JSEOF
patchright-cli eval --file=/tmp/extract.js
Using a proxy
patchright-cli --proxy=http://host:port open https://example.com
patchright-cli --proxy=socks5://host:port open https://example.com
patchright-cli --proxy=http://user:pass@host:port open https://example.com
Handling dialogs
patchright-cli dialog-accept
patchright-cli click e5
Waiting for dynamic content
patchright-cli wait-for e12
patchright-cli wait 1000
Anti-detect notes
- Uses real Chrome (not Chromium) -- this is what makes it undetectable
- Patchright patches
navigator.webdriver and other detection vectors automatically
- Headed by default -- headless mode is more detectable, use only when necessary
- No custom user-agent or headers by default -- preserves Chrome's natural fingerprint
- Persistent profiles maintain realistic browser history and cookies
- The daemon architecture means Chrome stays running between commands, behaving like a real user's browser
attach --cdp lets you connect to an existing Chrome instance
Config files
Create .patchright-cli/config.json in your project directory (auto-discovered) or pass --config=<path>:
{
"headless": false,
"persistent": true,
"proxy": "http://proxy:8080",
"device": "iPhone 15",
"locale": "en-US",
"timezone": "America/New_York"
}
CLI flags always override config file values.
Installation
CLI tool
uvx patchright-cli <command>
pip install patchright-cli
Skill (for AI coding agents)
npx skills add AhaiMk01/patchright-cli
Other methods:
pip install patchright-cli && patchright-cli install --skills
Specific tasks