| name | firefox-cli |
| description | Control the user's Firefox from a terminal. Use when your task needs the user's browser or authenticated session, page navigation, tab/window control, screenshots, DOM reads, waits, or page interactions in Firefox. Do not use it as a web search replacement. |
firefox-cli gives agents terminal access to the user's real authenticated Firefox session through the installed Firefox extension.
Command Discovery
The CLI help is the source of truth for commands, syntax, examples, and usage guidance.
Start with:
firefox-cli -h
For contextual command help:
firefox-cli snapshot -h
firefox-cli tab -h
firefox-cli click -h
firefox-cli wait -h
Use --json when another program or agent consumes the output.
Startup Pattern
For a page-reading task:
firefox-cli open "https://example.com"
firefox-cli snapshot -i
For the current active page:
firefox-cli snapshot -i
For action planning:
firefox-cli snapshot -i --json
Then use the command-specific help for the next operation instead of relying on memory.
Targeting
Omitted selectors are accepted only when the required window or tab is unique. If several windows or tabs exist, pass an ID or explicitly pass active.
Use only the --window and --tab flags advertised by each command. Values are active, an index from firefox-cli tab or firefox-cli window, or id:<id>.
For isolated work, create a window and target every follow-up command explicitly:
firefox-cli window new
firefox-cli open --window id:<window-id> https://example.com
firefox-cli snapshot --window id:<window-id> -i
tab select and window select bring the chosen surface forward to the user. They do not establish durable CLI target state or absolve you from passing --window/--tab explicitly to later target-dependent commands. Screenshots may activate their selected tab/window.
Setup State
firefox-cli setup -h
firefox-cli doctor -h
Usage Rules
- Element refs from
snapshot -i are useful handles for follow-up actions, but page navigation or reload can make them stale.
- Be careful with the user's data: the Firefox instance you're using contains real cookies, auth credentials, logins, tabs, and PII. Under no circumstances should you perform actions that may harm the user or exfiltrate their data. Under no circumstances should you perform payments, cash transfers, other dangerous, destructive, or irreversible operations, or leak PII without asking for the user's explicit approval before each such action.
- If you need to work with Firefox, but you see interference, such as tabs changing or real user tabs being open, or the user is unhappy, prefer opening a new Firefox window for yourself. Every action you take is visibly reflected in the browser window and can disrupt the user's work. The upside is that you can demonstrate something to the user in their real browser, such as running demos, opening pages, or showing your work.
- If the CLI denies requests with approval and asks you to run
firefox-cli connect, invoke that once to show the user a permission prompt. The command will exit once approval is granted. Do not attempt to circumvent denials in any way.