Quickstart
-
Install
Terminal window npm install -g agent-browser-ffagent-browser-ff setupsetupchecks your PATH, downloads Firefox, and asks whether to install the agent skill. Answernif you only want the CLI. -
Open a page
Terminal window agent-browser-ff open https://example.com -
Snapshot to get refs
Terminal window agent-browser-ff snapshotThe output is one line per element, with refs like
@e1. -
Act on refs
Terminal window agent-browser-ff click @e4agent-browser-ff fill @e2 "hello"agent-browser-ff screenshot --out page.png -
Close
Terminal window agent-browser-ff close
The core loop
Section titled “The core loop”open → snapshot → act on refs → re-snapshot after navigation → close
Refs belong to a snapshot generation. After any navigation or major DOM change, run snapshot again. A stale ref returns E_STALE_REF (exit 4) with a hint.
Watch it work
Section titled “Watch it work”agent-browser-ff open https://example.com --guiagent-browser-ff gui off # back to headless, session preservedA login flow
Section titled “A login flow”agent-browser-ff open https://example.com/loginagent-browser-ff snapshotagent-browser-ff fill @e2 "user@example.com"agent-browser-ff click @e4agent-browser-ff wait url "**/dashboard"agent-browser-ff snapshotagent-browser-ff closeMake it repeatable
Section titled “Make it repeatable”After a manual run that works, save it as a macro:
agent-browser-ff macro from-history my-flow --last 6agent-browser-ff macro play my-flow --var query="firefox"See Macros.