Rodney: CLI for Persistent Headless Chrome Automation

Launch a single persistent headless Chrome instance and control it via CLI commands for scripting web navigation, interactions, data extraction, accessibility checks, and CI assertions—exit code 1 for failed checks vs 2 for errors.

Persistent Chrome Management Enables Efficient Scripting

Rodney starts a long-running headless Chrome process (via Go's rod library) that persists across CLI invocations, storing the WebSocket debug URL in ~/.rodney/state.json (or ./.rodney/state.json with --local for project isolation). Use rodney start to launch (headless by default; --show for visible window), rodney connect host:port for existing instances, rodney status to check, and rodney stop to shut down and clean up. Tabs and state persist between commands, avoiding repeated launches. Set ROD_CHROME_BIN for custom Chrome path, RODNEY_HOME to override ~/.rodney, and ROD_TIMEOUT=30 seconds default for queries. Authenticated proxies (HTTPS_PROXY=http://user:pass@host:port) get auto-handled via a background local proxy on start.

Add .rodney/ to .gitignore for local sessions. Auto-detects ./.rodney/state.json first, falling back to global.

Core Commands for Web Interactions and Extraction

Navigate with rodney open URL, back, forward, reload [--hard], clear-cache. Extract via url, title, html [selector], text <selector>, attr <selector> <name>. Interact using click <selector>, input <selector> <text>, clear <selector>, file <selector> path|- (stdin via -), download <selector> [file|-], select <selector> <value>, submit <selector>, hover/focus <selector>.

Run JS with rodney js 'expression' (auto-wrapped as () => { return (expr); }), wait via wait <selector>, waitload, waitstable, waitidle, sleep <seconds>. Capture output: screenshot [-w N -h N] [file], screenshot-el <selector> [file], pdf [file]. Manage tabs: pages, page <index>, newpage [url], closepage [index], count <selector>.

Checks and Assertions for CI/Smoke Tests

Dedicated check commands exit with code 1 (not 2) on failure, printing results to stdout without stderr noise: exists/visible <selector>, ax-find [--name N --role R], assert 'expr' [expected] -m msg (truthy or string-equals; JS result stringified). Accessibility uses Chrome CDP: ax-tree [--depth N], ax-node <selector>, exposing getFullAXTree, queryAXTree, getPartialAXTree.

Chain in scripts with set -e: errors (code 2, e.g. no session/timeout) abort immediately; check failures (code 1) allow explicit handling. Ideal for post-deploy verification, a11y audits, or staging smoke tests—e.g., rodney exists '#login' || echo 'Login missing'.

Exit codes: 0=success, 1=check failed, 2=error.

Summarized by x-ai/grok-4.1-fast via openrouter

7823 input / 1706 output tokens in 12905ms

© 2026 Edge