actionbook browser command lets AI agents automate any Chromium-based browser. Three modes are available depending on the use case:
Normal usage: run
actionbook setup once, then use actionbook browser ... commands only.Modes
All three modes are designed for AI agents:
- Local gives agents a clean, reproducible environment.
- Cloud offloads the browser to a remote provider, suited for production workloads, parallel execution at scale, or IP geolocation control.
- Extension lets agents operate inside the user’s real browser when the task requires existing authentication (e.g., “book my flight”, “reply to that email”).
Local Mode
Works out of the box with no setup. The CLI launches a temporary Chrome process with a dedicated profile and connects via CDP.Cloud Providers
Cloud mode lets you run browser sessions on a remote provider instead of launching a local Chrome. Use the-p (or --provider) flag with browser start:
Supported Providers
Quick Start
1
Export your provider API key
2
Start a cloud browser session
session_id and tab_id for subsequent commands.3
Use browser commands as usual
4
Close when done
How It Works
-p <name>automatically implies--mode cloud, so you don’t need to set both-pis mutually exclusive with--cdp-endpointand--mode local/extension- The CLI forwards provider env vars from your current shell to the daemon at start time (the daemon’s own env is frozen at spawn)
browser restart --session <id>mints a fresh remote session while preserving the samesession_id, so you can reset state without losing your addressing handle
Extension Mode Setup
Extension mode is under active development. For most use cases, Local or Cloud mode is recommended.
mode = "extension" in your config file, you only need to perform this one-time setup.
1
Install from Chrome Web Store (recommended)
- Open Actionbook on Chrome Web Store
- Click Add to Chrome
- Confirm Add extension
2
Verify with any browser command
3
Fallback: local debug install (only if Web Store install fails)
- Install the fallback package:
- Open
chrome://extensions - Enable Developer mode
- Click Load unpacked
- Select the local folder printed by:
Extension Commands
Theactionbook extension commands manage the Chrome extension and its connection to the actionbook daemon.
The recommended install method is the Chrome Web Store (current version: 0.4.0). actionbook extension install is a local fallback — after running it, you must manually load the unpacked extension in Chrome via chrome://extensions > Developer mode > Load unpacked, using the path from actionbook extension path.
extension status shows whether the bridge is listening and the extension is connected. extension ping tests connectivity by connecting to the bridge WebSocket at ws://127.0.0.1:19222.
Extension 0.4.0: Tabs opened by Actionbook are automatically grouped into a Chrome “Actionbook” tab group (toggleable via extension popup).
list-tabs in extension mode now returns only Actionbook-managed tabs — other user tabs are hidden. Extensions below 0.4.0 are rejected at handshake.Configuration
The recommended way to set your preferred browser mode is viaactionbook setup.
It writes your choice to ~/.actionbook/config.toml, so you can run browser commands without extra flags.
Set Default Mode
Create or edit~/.actionbook/config.toml:
Browser Commands
Most commands work in all modes. All per-tab commands require--session and --tab flags to address a specific tab.
Session Lifecycle
--session and --set-session-id are get-or-create: they reuse a Running session with the given ID, or create one if not found.
Tab Management
Navigation
Page Interaction
Wait Conditions
Observation & Export
har start accepts --max-entries N to set the ring-buffer cap (default: 10000).
Cookie & Storage Operations
File Upload
Multi-Session (Parallel Tabs)
Available since v0.11.0. Requires local mode (default).
Basic Usage
Use the--session flag to name a session:
--session, commands use a default session.
Session Management
Common Mistakes
Creating separate profiles with different ports
Creating separate profiles with different ports
Running snapshot without session distinction
Running snapshot without session distinction
Recommended Workflow
Combine action manuals with browser automation for the best results:Shutdown
Extension Security
Extension mode connects via a local WebSocket bridge with the following guarantees:- The bridge only listens on
127.0.0.1(loopback), no external network access - No token or pairing is required; local origin is sufficient for authentication
- The extension identifies itself via a WebSocket handshake with role and version fields
- The bridge validates the connection source (origin + extension ID) before accepting commands
Eval Error Handling
browser eval accepts the expression from three mutually-exclusive sources: a positional argument, --file <path>, or stdin (-).
browser eval returns structured error codes on failure. Branch on error.code instead of parsing the message string:
Runtime errors (after browser execution):
CLI-layer errors (before any browser interaction):
CDP Error Handling
Browser commands that interact with elements, navigate, or communicate via CDP return structuredCDP_* error codes. Branch on error.code:
When
error.code is a CDP_* code, error.details includes reason (raw CDP message) and cdp_code (upstream numeric code) when available. CDP_NAV_TIMEOUT also includes timeout_ms.
Some interaction paths (cookies, screenshots, PDF, etc.) still emit the legacy
CDP_ERROR code. These are being migrated to the structured CDP_* taxonomy (ACT-999).Troubleshooting
Browser command waits for extension connection
Browser command waits for extension connection
- Run any browser command once:
actionbook browser open <url>(this auto-starts the bridge) - Keep Chrome open and confirm the Actionbook extension is enabled in
chrome://extensions - First startup can take a few seconds while the bridge starts and the extension reconnects
Extension popup shows 'Waiting for bridge' or keeps reconnecting
Extension popup shows 'Waiting for bridge' or keeps reconnecting
- This usually means the WebSocket handshake did not complete
- Update CLI:
npm update -g @actionbookdev/cli - Reinstall from Chrome Web Store
- If needed, use fallback install:
actionbook extension install --force, then reload it inchrome://extensions - Click Connect in the extension popup to retry
Commands not using my configured mode
Commands not using my configured mode
- Re-run
actionbook setupand choose your preferred browser mode - Check effective config with
actionbook config show - Environment variables (for example
ACTIONBOOK_BROWSER_MODE) can override config
No tab attached
No tab attached
- Make sure Chrome has at least one visible, active tab
- Run
actionbook browser open <url>first to attach a tab - Avoid
chrome://pages; the debugger cannot attach to them
Port 19222 in use
Port 19222 in use
- Browser mode currently uses a fixed bridge address:
ws://127.0.0.1:19222 - Stop the conflicting process on that port (macOS/Linux:
lsof -i :19222) - Then retry your browser command; the bridge will auto-start again
Chrome Web Store install failed
Chrome Web Store install failed
- Retry Web Store install: Actionbook on Chrome Web Store
- Use local debug fallback:
actionbook extension install - Load it manually from
chrome://extensionswith Load unpacked - If GitHub API is rate-limited during fallback, wait and retry or download from GitHub Releases