camoufox-playwright-cli
v0.1.0
Published
Playwright CLI (@playwright/cli), driven by Camoufox for stealth browsing. Profile-based: auto-generated default fingerprint on install, create/rotate/delete named profiles.
Maintainers
Readme
camoufox-playwright-cli
Official @playwright/cli (Microsoft's Playwright CLI — open, click, fill, snapshot, tabs, network, tracing, video, ...), driven by Camoufox instead of stock Chromium/Firefox, so the browser doesn't look automated.
No fork of playwright-cli, no monkey-patching. Camoufox's stealth is just three standard Playwright launch options — executablePath, firefoxUserPrefs, and a CAMOU_CONFIG_* env blob — and playwright-cli already passes those through from a config file. This package generates that config for you and manages it as named profiles.
Short alias: cpw (same binary as camoufox-playwright-cli).
Install
npm install -g camoufox-playwright-cli
cpw installinstall downloads the Camoufox browser binary (shared cache, only happens once even across other Camoufox-based tools) and generates a default profile.
Profiles
A profile is a fingerprint identity + its own isolated browser data (cookies, localStorage, login sessions) — think of it as "one persona". The default profile is created automatically and its fingerprint is generated from your actual machine where possible:
- Real GPU vendor (via
Get-CimInstance Win32_VideoControlleron Windows) — matched to the closest vendor bucket in Camoufox's curated WebGL database. Camoufox only ships a fixed, vetted set of older reference GPU models per vendor (no RTX 20/30/40-series entries at all, for example), so the vendor will match your real hardware but the exact renderer string won't be your literal card model. That vendor-match is what fingerprinting scripts actually cross-check; matching the exact model isn't possible through Camoufox's public API without maintaining a separate spoofing database, which is out of scope here. - Real screen resolution, locale, and timezone (via
Intl+ WMI).
If any of these can't be detected (non-Windows, sandboxed environment, etc.) that field silently falls back to Camoufox's own randomized default — it never errors out.
cpw profile list
cpw profile create work
cpw profile rotate work # wipes cookies + regenerates fingerprint
cpw profile delete workRotating or deleting a profile always wipes its browser session data first — keeping old cookies with a new fingerprint is itself an inconsistency signal, so we don't allow that combination.
Usage
Everything besides install and profile is forwarded verbatim to the real playwright-cli, with --profile mapped to its -s= session flag and (for open) --config= pointed at that profile's generated config:
cpw open https://example.com
cpw snapshot
cpw click e3
cpw fill e5 "hello"
cpw screenshot --filename out.png
cpw close
cpw --profile=work open https://example.com # separate identity + separate cookiesSee the playwright-cli command reference for the full list — tabs, network routing, storage state, tracing, video recording, etc. all work unmodified.
How it works
camoufox-js'slaunchOptions()computes{executablePath, env, firefoxUserPrefs}for a given fingerprint.- We write that into
~/.camoufox-playwright-cli/profiles/<name>/cli.config.json, in the shape@playwright/cliexpects (browser.launchOptions). cpw <command>is a thin wrapper: it ensures that config exists, then spawns the realplaywright-clibinary with-s=<profile>(and--config=onopen) injected.
Dependency versions (@playwright/cli, camoufox-js) are pinned exactly, not range-matched — both are young/prerelease packages and an unpinned npm install could silently pick up a breaking protocol change between Playwright's internal Firefox/Juggler driver and Camoufox's patched binary. Upgrades are deliberate, one version bump at a time, tested against the checks in this README before being released.
Security note
The env passed to the Camoufox process is an explicit allowlist (PATH, temp dirs, etc.) — never your full shell environment. Don't widen it without checking what secrets might be sitting in process.env.
