| name | camoufox-cli |
| description | Anti-detect browser automation CLI & Skills for AI agents. Use when the user needs to interact with websites with bot detection, CAPTCHAs, or anti-bot blocks, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task that requires bypassing fingerprint checks. |
Anti-Detect Browser Automation with camoufox-cli
What Makes This Different
camoufox-cli is built on Camoufox (anti-detect Firefox) with C++-level fingerprint spoofing:
navigator.webdriver = false
- Real browser plugins, randomized canvas/WebGL/audio fingerprints
- Real Firefox UA string -- passes bot detection on sites that block Chromium automation
Use camoufox-cli instead of agent-browser when the target site has bot detection.
Core Workflow
Every browser automation follows this pattern:
- Navigate:
camoufox-cli open <url>
- Snapshot:
camoufox-cli snapshot -i (get element refs like @e1, @e2)
- Interact: Use refs to click, fill, select
- Re-snapshot: After navigation or DOM changes, get fresh refs
- Close:
camoufox-cli close (close the browser when the entire task is fully complete; keep it open if the user may have follow-up instructions)
camoufox-cli open https://example.com/form
camoufox-cli snapshot -i
camoufox-cli fill @e1 "user@example.com"
camoufox-cli fill @e2 "password123"
camoufox-cli click @e3
camoufox-cli snapshot -i
Command Chaining
Commands can be chained with && in a single shell invocation. The browser persists between commands via a background daemon, so chaining is safe and more efficient than separate calls.
camoufox-cli open https://example.com && camoufox-cli snapshot -i
camoufox-cli fill @e1 "user@example.com" && camoufox-cli fill @e2 "password123" && camoufox-cli click @e3
camoufox-cli open https://example.com && camoufox-cli screenshot page.png
When to chain: Use && when you don't need to read the output of an intermediate command before proceeding (e.g., open + screenshot). Run commands separately when you need to parse the output first (e.g., snapshot to discover refs, then interact using those refs).
Essential Commands
camoufox-cli open <url>
camoufox-cli back
camoufox-cli forward
camoufox-cli reload
camoufox-cli url
camoufox-cli title
camoufox-cli close
camoufox-cli close --all
camoufox-cli snapshot
camoufox-cli snapshot -i
camoufox-cli snapshot -s "#selector"
camoufox-cli click @e1
camoufox-cli fill @e1 "text"
camoufox-cli type @e1 "text"
camoufox-cli select @e1 "option"
camoufox-cli check @e1
camoufox-cli hover @e1
camoufox-cli press Enter
camoufox-cli press "Control+a"
camoufox-cli text @e1
camoufox-cli text body
camoufox-cli eval "document.title"
camoufox-cli screenshot
camoufox-cli screenshot page.png
camoufox-cli screenshot --full p.png
camoufox-cli pdf output.pdf
camoufox-cli scroll down
camoufox-cli scroll up
camoufox-cli scroll down 1000
camoufox-cli wait @e1
camoufox-cli wait 2000
camoufox-cli wait --url "*/dashboard"
camoufox-cli tabs
camoufox-cli switch 2
camoufox-cli close-tab
camoufox-cli --tab <unique-name> open <url>
camoufox-cli cookies
camoufox-cli cookies import file.json
camoufox-cli cookies export file.json
camoufox-cli sessions
camoufox-cli --session work open <url>
camoufox-cli close --all
camoufox-cli install
camoufox-cli install --with-deps
Common Patterns
Form Submission
camoufox-cli open https://example.com/signup
camoufox-cli snapshot -i
camoufox-cli fill @e1 "Jane Doe"
camoufox-cli fill @e2 "jane@example.com"
camoufox-cli select @e3 "California"
camoufox-cli check @e4
camoufox-cli click @e5
camoufox-cli snapshot -i
Data Extraction
camoufox-cli open https://example.com/products
camoufox-cli snapshot -i
camoufox-cli text @e5
camoufox-cli eval "document.title"
camoufox-cli screenshot results.png
Cookie Management (Persist Login)
camoufox-cli open https://app.example.com/login
camoufox-cli snapshot -i
camoufox-cli fill @e1 "user"
camoufox-cli fill @e2 "pass"
camoufox-cli click @e3
camoufox-cli cookies export auth.json
camoufox-cli open https://app.example.com
camoufox-cli cookies import auth.json
camoufox-cli reload
For long-lived accounts where the site also verifies device stability (not just the cookie), combine this with --persistent so the fingerprint stays fixed alongside the cookies — see the Persistent Identity section below.
Multiple Tabs
camoufox-cli open https://site-a.com
camoufox-cli eval "window.open('https://site-b.com')"
camoufox-cli tabs
camoufox-cli switch 1
camoufox-cli snapshot -i
Parallel Tabs (shared identity, one browser)
Named tabs share one browser within a session — same fingerprint, same cookies/login state — but each tab keeps its own page, element refs, and navigation history, so concurrent agents never clobber each other. This is the cheap way to parallelize: one Firefox total, roughly 50-150MB per extra tab.
camoufox-cli --tab inbox-scan-x4q open https://app.example.com/inbox
camoufox-cli --tab report-pull-9kf open https://app.example.com/reports
camoufox-cli --tab inbox-scan-x4q snapshot -i
camoufox-cli tabs
camoufox-cli --tab inbox-scan-x4q close-tab
Picking your tab name. Nothing enforces uniqueness — two agents using the same name share one page pointer and will clobber each other. Generate your name ONCE at the start of your task: a short slug of your specific task plus a shell-generated random suffix — don't invent the suffix yourself, LLM-"random" characters are biased and concurrent agents may produce the same ones. Then reuse the printed name verbatim in every subsequent command. (If your instructions explicitly assign you a tab name, use that instead.)
TAB="price-scan-$(openssl rand -hex 2)" && echo "$TAB" && camoufox-cli --tab "$TAB" open https://example.com
camoufox-cli --tab price-scan-9f3c snapshot -i
Use tabs when subagents should act as the same identity (e.g. all operating the same logged-in account). Note close still shuts down the whole browser for every tab — a finishing subagent should use close-tab instead, and only the coordinator should run close at the end.
Tabs share one browser process, so commands from different tabs may queue behind a slow navigation or wait; separate sessions run as independent processes and execute fully in parallel. If a few agents are extremely command-heavy, consider giving those their own session and keeping the rest on tabs.
Parallel Sessions (isolated identities)
Each named session is a separate browser process, so each gets its own randomly-generated fingerprint and its own cookies. Use this when agents must NOT share identity (multi-account work) — it costs a full Firefox (~300-500MB) per session:
camoufox-cli --session s1 open https://site-a.com
camoufox-cli --session s2 open https://site-b.com
camoufox-cli sessions
camoufox-cli --session s1 snapshot -i
camoufox-cli --session s2 snapshot -i
Separate sessions alone only isolate the browser side. For multi-account work that must survive scrutiny, also give each session its own proxy (sites correlate accounts by IP — use the config file's sessions.<name>.proxy) and --persistent (otherwise the fingerprint is re-randomized every launch, which looks like a new device on each login).
Visual Browser (Debugging)
camoufox-cli --headed open https://example.com
camoufox-cli snapshot -i
camoufox-cli screenshot debug.png
Session Management and Cleanup
When running multiple agents or automations concurrently, give each agent its own name so they don't conflict. Two isolation levels:
--tab <name> (shared identity, recommended default): all agents share one browser — same fingerprint and login state — but each gets an independent tab. Cheap: one Firefox total.
--session <name> (isolated identity): each agent gets its own browser with its own fingerprint and cookies. Expensive: a full Firefox per session. Use only when identities must be separate.
camoufox-cli --tab orders-audit-p2m open https://app.example.com/a
camoufox-cli --tab user-export-j8w open https://app.example.com/b
camoufox-cli --tab billing-check-r4t open https://app.example.com/c
camoufox-cli --session shop-a-buyer open https://site-a.com
camoufox-cli --session shop-b-buyer open https://site-b.com
camoufox-cli sessions
Names are just strings and nothing enforces uniqueness — follow the "Picking your tab name" rule above (task slug + shell-generated random suffix, chosen once). The same applies to session names.
Always close your browser session when done to avoid leaked processes:
camoufox-cli --tab orders-audit-p2m close-tab
camoufox-cli close
camoufox-cli --session shop-a-buyer close
camoufox-cli close --all
Note close shuts down the whole session's browser for every tab in it — finishing subagents should use close-tab; the coordinator runs close at the end.
If a previous session was not closed properly, the daemon may still be running. Use camoufox-cli close to clean it up before starting new work.
Timeouts and Slow Pages
Some pages take time to fully load, especially those with dynamic content or heavy JavaScript. Use explicit waits before taking a snapshot:
camoufox-cli wait @e1
camoufox-cli snapshot -i
camoufox-cli wait --url "*/dashboard"
camoufox-cli snapshot -i
camoufox-cli wait 3000
camoufox-cli snapshot -i
When dealing with slow pages, always wait before snapshotting. If you snapshot too early, elements may be missing from the output.
Ref Lifecycle (Important)
Refs (@e1, @e2, etc.) are temporary identifiers assigned by sequential numbering during each snapshot. They are invalidated when the page changes.
Always re-snapshot after:
- Clicking links or buttons that navigate
- Form submissions
- Dynamic content loading (dropdowns, modals, lazy-loaded content)
- Scrolling that triggers new content
camoufox-cli click @e5
camoufox-cli snapshot -i
camoufox-cli click @e1
camoufox-cli click @e1
camoufox-cli snapshot -i
camoufox-cli click @e7
camoufox-cli open https://example.com
camoufox-cli click @e1
camoufox-cli click @e5
camoufox-cli click @e3
Always take a fresh snapshot before interacting with elements after navigation or page changes.
Troubleshooting
"Ref @eN not found"
The ref was invalidated. Re-snapshot to get fresh refs:
camoufox-cli snapshot -i
Element Not Visible in Snapshot
camoufox-cli scroll down 1000
camoufox-cli snapshot -i
camoufox-cli wait 2000
camoufox-cli snapshot -i
Too Many Elements in Snapshot
camoufox-cli snapshot -s "#main-content"
camoufox-cli snapshot -i -s "form.login"
Page Not Fully Loaded
camoufox-cli wait --url "*/dashboard"
camoufox-cli snapshot -i
camoufox-cli wait 3000
camoufox-cli snapshot -i
Global Flags
--session <name> Named session (default: "default")
--tab <name> Named tab within the session's shared browser: same
fingerprint and cookies/login, independent page/refs/
history (default: "default")
--headed Show browser window (default: headless)
--timeout <seconds> Daemon idle timeout (default: 1800)
--json Output as JSON instead of human-readable
--persistent [path] Persistent identity — reuse the same fingerprint + cookies across launches
(default path: ~/.camoufox-cli/profiles/<session>)
--proxy <url> Proxy server (http:// or https://; auth: http://user:pass@host:port)
--no-geoip Disable automatic GeoIP spoofing (auto-enabled with --proxy)
--locale <tag> Force browser locale (e.g. "en-US" or "en-US,zh-CN")
Config file (optional). To avoid repeating flags, set defaults in ~/.camoufox-cli/config.json (override path with $CAMOUFOX_CLI_CONFIG): a default block applies to all sessions, and an optional sessions.<name> block layers extra overrides on top whenever you run --session <name> (the name is just whatever you pass to --session — sessions are never pre-registered). Settable keys: proxy, locale, geoip, persistent (true/false/path), headed, timeout, json. Command-line flags always win over the file. Config is read only when a session's daemon first launches.
{
"default": { "persistent": true, "timeout": 3600 },
"sessions": { "<your-session-name>": { "proxy": "socks5://127.0.0.1:1080", "locale": "zh-CN" } }
}
Persistent Identity
By default, every launch gets a fresh random fingerprint. Add --persistent [path] to reuse the same fingerprint + cookies across launches — fingerprint/OS/canvas+font seeds are frozen on first launch (delete the directory to reset); --locale and proxy-derived timezone/geolocation are stored but refreshed whenever you pass the flag; --proxy / --no-geoip are never stored, so pass them every launch.
Use it when the same device should see the same fingerprint across visits (account-bound tasks, parallel independent identities, or when cookies import/export alone isn't enough because the site also checks device stability). Skip it for one-off scraping or quick debugging.
camoufox-cli --session a --persistent ~/.camoufox-cli/profiles/alice open https://app.example.com
camoufox-cli --session b --persistent ~/.camoufox-cli/profiles/bob open https://app.example.com
rm -rf ~/.camoufox-cli/profiles/alice
Documentation