Camoufox-backed browser automation CLI for AI agents.
Status: v0.1 “core drop-in” compatibility with agent-browser (core subset). Non-core commands return Not yet implemented: <command>.
npm i -g camoufox-browser
# Download Camoufox binaries (required before `open`)
camoufox-browser install
# Linux only: also install system libraries (uses sudo/root)
camoufox-browser install --with-depscamoufox-browser open https://example.com
camoufox-browser snapshot -i
# Click an element from the snapshot (refs look like [ref=e1])
camoufox-browser click @e1
camoufox-browser get url
camoufox-browser screenshot page.png
camoufox-browser closeUse --json to get machine-friendly output:
camoufox-browser --json snapshot -i
camoufox-browser --json get titleEach session has its own long-lived daemon (browser instance). Use this to isolate runs:
camoufox-browser --session prod open https://example.com
camoufox-browser --session prod snapshot -i
camoufox-browser --session prod closeEnvironment variables:
CAMOUFOX_BROWSER_SESSION(alias:AGENT_BROWSER_SESSION)CAMOUFOX_BROWSER_SOCKET_DIR(alias:AGENT_BROWSER_SOCKET_DIR)CAMOUFOX_BROWSER_IDLE_TIMEOUT_MS(alias:AGENT_BROWSER_IDLE_TIMEOUT_MS)
--headed/CAMOUFOX_BROWSER_HEADED=1--debug/CAMOUFOX_BROWSER_DEBUG=1--profile <dir>: persistent context (durable cookies/storage)--state <path>: load Playwright storageState on launch (ephemeral mode)--proxy <url>/--proxy-bypass <list>--user-agent <ua>--args "<comma-or-newline-separated args>"
Notes:
--headedis applied at browser launch time. If a session already has a running headless browser,open|goto|navigatewith--headedwill relaunch the browser to apply headed mode (this may close existing tabs/pages for that session).
- Navigation:
open|goto|navigate,back,forward,reload,close - Tabs:
tab [new [url]|list|close [n]|<n>] - Frame:
frame <selector|main>(alias:frame main→mainframe) - Dialog:
dialog <accept|dismiss> [text] - Snapshot:
snapshot [-i] [-c] [-C] [--depth N] [--selector <css>] - Eval:
eval [-b|--base64] [--stdin] <script> - Interact:
click,dblclick,focus,fill,type,press,hover,check,uncheck,select,drag,upload,download - Keyboard:
keydown <key>,keyup <key>,keyboard <type|inserttext> <text> - Scroll:
scroll [direction] [amount] [--selector <css>],scrollintoview <selector> - Get:
get url|title|text|html|value|attr|count|box|styles - Is:
is visible|enabled|checked <selector> - Wait:
wait <ms|selector|@ref>orwait --url <pattern>/wait --load <state>/wait --text <text> - Screenshot:
screenshot [selector|@ref] [path](also supports--full-page,--format,--quality) - Debug:
console [--clear],errors [--clear],highlight <selector> - Storage:
cookies [get|set|clear],storage <local|session> [get|set|clear] [key] [value]
camoufox-browser focuses on a high-frequency drop-in subset. If you need full agent-browser functionality, use agent-browser directly.
Not yet implemented in camoufox-browser (non-exhaustive):
- Network tooling:
route,unroute,requests,responsebody - Locator helpers:
find,getbyrole/getbytext/... and related subcommands (nth, etc.) - State vault:
state save|load|list|show|clear|rename|clean - Recording / profiling: HAR/recording/profiler/screencast commands
- Misc:
pdf,clipboard, touch/mouse low-level input, permissions/geolocation/media emulation, devtools inspect/pause, diff tools
Snapshot scoped to a container:
camoufox-browser snapshot -i --selector "main"Wait for a ref to become visible:
camoufox-browser wait @e1Use a persistent profile directory:
camoufox-browser --profile ~/.camoufox-profile open https://example.comManage cookies and web storage:
camoufox-browser cookies
camoufox-browser cookies set sid abc --url https://example.com --httpOnly --secure
camoufox-browser storage local set theme dark
camoufox-browser storage local get theme
camoufox-browser storage localCamoufox/Playwright execution is Node-based, but the CLI is shipped as a native Rust binary for:
- Faster cold-start per invocation (especially in agent loops)
- Easier distribution of a single executable per platform
- Keeping the Node daemon isolated as a long-lived process per session
If the native binary can’t be downloaded or executed, camoufox-browser falls back to a JS implementation (dist/cli.js).
- If you see an error about missing
~/.cache/camoufox/version.json, runcamoufox-browser install. - If you use
pnpmand seebetter-sqlite3“Could not locate the bindings file”, run:pnpm -C camoufox-browser installpnpm -C camoufox-browser rebuild better-sqlite3