English | Português Brasileiro
browser-automation-cli
One-shot Chrome CDP automation for AI agents. NASCE, EXECUTA, FINALIZE, MORRE.
What is it
- Single-process browser automation CLI for AI agents
- Talks to system Chrome or Chromium through chromiumoxide CDP
- No daemon, no npm packaging, no remote telemetry
- Lifecycle is always NASCE, EXECUTA, FINALIZE, MORRE
The Pain
- Agent workflows need multi-step browser work without a sticky daemon
- Node and npm browser stacks add runtime weight and supply-chain surface
- Session-based tools leave orphan Chrome processes and unclear ownership
- JSON contracts often drift from real CLI flags and exit codes
Why browser-automation-cli
- One process owns one Chrome lifecycle from launch to kill fallback
- Multi-step work uses
run --scriptNDJSON in the same process - Accessibility snapshot refs
@eNstay valid only inside that process --jsonenvelopes are stable for programmatic agents- Install path is pure Rust via cargo
Superpowers
- Navigation and page lifecycle:
goto,back,forward,reload,page - Input:
press,write,type,keys,hover,drag,fill-form,upload - Observation:
view,grab,extract,text,attr,scroll,assert - Capture:
consoleandnetwith optional global capture flags - DevTools depth:
eval,emulate,resize,perf,lighthouse,heap - Optional categories: memory, extensions, third-party, webmcp
- Experimental: vision
click-at, screencast with ffmpeg export - Discovery:
doctor,commands,schema,completions
Quick Start
Installation
- Local development install:
- From crates.io after the first publish:
- Runtime needs Chrome or Chromium on PATH
- Optional:
ffmpegfor screencast file export - Optional:
lighthousebinary for lighthouse audits
Usage
- Always pass
--jsonfor agent pipelines - Keep human diagnostics on stderr with
-qwhen piping - Use
--timeoutfor wall-clock process budget in seconds - Use
run --scriptfor multi-step sessions that need shared@eNrefs
Commands
- Discovery:
doctor,commands,schema,version,completions - Navigate:
goto,back,forward,reload,scrape - Snapshot and input:
view,press,write,type,keys,wait,hover,drag,fill-form,upload - Content:
extract,text,scroll,attr,assert,grab - Tabs and dialogs:
page,dialog,cookie - Capture:
console,net - Advanced:
eval,emulate,resize,perf,lighthouse,screencast,heap - Categories:
extension,devtools3p,webmcp - Multi-step:
run,exec
Environment Variables
BROWSER_AUTOMATION_CLI_JSONenables JSON envelopesBROWSER_AUTOMATION_CLI_QUIETsuppresses non-error stderr proseBROWSER_AUTOMATION_CLI_VERBOSEraises tracing to infoBROWSER_AUTOMATION_CLI_DEBUGraises tracing to debugBROWSER_AUTOMATION_CLI_TIMEOUTsets global timeout secondsBROWSER_AUTOMATION_CLI_STEP_TIMEOUTsets per-step timeout forrunBROWSER_AUTOMATION_CLI_HEADEDlaunches visible ChromeBROWSER_AUTOMATION_CLI_ARTIFACTS_DIRstores artifactsBROWSER_AUTOMATION_CLI_LANGselects locale messagingBROWSER_AUTOMATION_CLI_CAPTURE_CONSOLEenables console captureBROWSER_AUTOMATION_CLI_CAPTURE_NETWORKenables network captureBROWSER_AUTOMATION_CLI_IGNORE_ROBOTSandBROWSER_AUTOMATION_CLI_I_ACCEPT_ROBOTS_RISKcontrol robots policyBROWSER_AUTOMATION_CLI_CATEGORY_MEMORYenables deep heap toolsBROWSER_AUTOMATION_CLI_CATEGORY_EXTENSIONSenables extension toolsBROWSER_AUTOMATION_CLI_CATEGORY_THIRD_PARTYenables third-party toolsBROWSER_AUTOMATION_CLI_CATEGORY_WEBMCPenables webmcp toolsBROWSER_AUTOMATION_CLI_EXPERIMENTAL_VISIONenablesclick-atBROWSER_AUTOMATION_CLI_EXPERIMENTAL_SCREENCASTenables screencastBROWSER_AUTOMATION_CLI_ENCRYPTION_KEYencrypts optional native stateBROWSER_AUTOMATION_CLI_NAMESPACEscopes native state namespacesBROWSER_AUTOMATION_CLI_COLORandNO_COLORcontrol color on stderrRUST_LOGoverrides tracing filters when needed
Features
- This crate has no Cargo feature flags
- Optional categories are process flags, not compile-time features
--category-memoryenables deep heap tools--category-extensionsenables extension tools--category-third-partyenables third-party DevTools helpers--category-webmcpenables webmcp tools--experimental-visionenablesclick-at--experimental-screencastenables screencast export with ffmpeg
Targets
- Documented for
x86_64-unknown-linux-gnu - Documented for
x86_64-apple-darwin - Documented for
aarch64-apple-darwin - Documented for
x86_64-pc-windows-msvc - Documented for
aarch64-unknown-linux-musl - Not supported on
wasm32-unknown-unknown(Chrome CDP requires a desktop browser) - docs.rs metadata declares these targets explicitly after the 2026-05-01 multi-target change
MSRV
- Minimum Supported Rust Version is 1.88.0
- Policy: bump MSRV only in minor or major releases with CHANGELOG note
- Local docs:
timeout 180 cargo doc --no-deps - Nightly docsrs cfg:
RUSTDOCFLAGS="--cfg docsrs" timeout 180 cargo +nightly doc --no-deps
Integration Patterns
- Claude Code, Codex, Cursor, and shell agents spawn one process per action
- Multi-step agent plans must use
run --scriptinstead of chaining separate processes - Parse stdout with
jaqand ignore stderr unless diagnosing failures - See INTEGRATIONS.md and docs/AGENTS.md
Performance
- Cold start is dominated by Chrome launch, not Rust binary size
- Prefer
doctor --offline --quickfor install checks without network - Reuse multi-step scripts to avoid repeated Chrome launches
Memory Requirements
- Expect Chrome process memory far above the CLI binary itself
- Heap tools need
--category-memoryand larger snapshots increase RAM use - Screencast export may invoke ffmpeg as an external helper
Troubleshooting FAQ
- Chrome not found: install Chromium or Google Chrome and re-run
doctor - Exit 69 unavailable: browser binary missing, blocked, or not launchable
- Exit 124 timeout: raise
--timeoutor shorten the script - Exit 2 usage: re-check flags with
browser-automation-cli help <cmd> @eNrefs invalid across commands: keep steps inside onerunprocess- Network empty: pass
--capture-networkon the same process that navigates
Exit Codes
0success2usage or clap parse failure65data error66no input69unavailable70software, browser, or protocol failure74I/O failure78config error124timeout130cancelled by SIGINT141broken pipe255unexpected fatal path
Documentation Map
- docs/HOW_TO_USE.md first command in 60 seconds
- docs/AGENTS.md agent integration contract
- docs/COOKBOOK.md practical recipes
- docs/CROSS_PLATFORM.md platform matrix
- docs/MIGRATION.md version migration notes
- docs/TESTING.md test categories
- docs/schemas/README.md JSON schema index
- skill/browser-automation-cli-en/SKILL.md imperative agent skill
- CHANGELOG.md Keep a Changelog history
- SECURITY.md vulnerability reporting
- CONTRIBUTING.md contributor workflow
- CODE_OF_CONDUCT.md Contributor Covenant 2.1
- llms.txt short LLM discovery map
Contributing
- Read CONTRIBUTING.md before opening a PR
- Follow the Code of Conduct in CODE_OF_CONDUCT.md
Security
- Report vulnerabilities privately via SECURITY.md
- Maintainer contact: daniloaguiarbr@proton.me
Changelog
- Version history lives only in CHANGELOG.md
License
- Dual licensed under MIT OR Apache-2.0
- See LICENSE, LICENSE-MIT, and LICENSE-APACHE