import { pageMetadata } from "@/lib/page-metadata" export const metadata = pageMetadata("configuration") # Configuration Create an `agent-browser.json` file to set persistent defaults instead of repeating flags on every command. ## Config File Locations agent-browser checks two locations, merged in priority order:
| Priority | Location | Scope |
|---|---|---|
| 1 (lowest) | ~/.agent-browser/config.json | User-level defaults |
| 2 | ./agent-browser.json | Project-level overrides |
| 3 | AGENT_BROWSER_* env vars | Override config values |
| 4 (highest) | CLI flags | Override everything |
| Config Key | CLI Flag | Type |
|---|---|---|
headed | --headed | boolean |
json | --json | boolean |
full | --full, -f | boolean |
debug | --debug | boolean |
session | --session | string |
sessionName | --session-name | string |
executablePath | --executable-path | string |
extensions | --extension | string[] |
profile | --profile | string |
state | --state | string |
proxy | --proxy | string |
proxyBypass | --proxy-bypass | string |
args | --args | string |
userAgent | --user-agent | string |
provider | -p, --provider | string |
device | --device | string |
ignoreHttpsErrors | --ignore-https-errors | boolean |
allowFileAccess | --allow-file-access | boolean |
cdp | --cdp | string |
autoConnect | --auto-connect | boolean |
colorScheme | --color-scheme | string (dark, light, no-preference) |
downloadPath | --download-path | string |
headers | --headers | string (JSON) |
| Variable | Description | Default |
|---|---|---|
AGENT_BROWSER_AUTO_CONNECT | Auto-discover and connect to a running Chrome instance. | (disabled) |
AGENT_BROWSER_ALLOW_FILE_ACCESS | Allow file:// URLs to access local files. | (disabled) |
AGENT_BROWSER_COLOR_SCHEME | Color scheme preference (dark, light, no-preference). | (none) |
AGENT_BROWSER_DOWNLOAD_PATH | Default directory for browser downloads. | (temp directory) |
AGENT_BROWSER_DEFAULT_TIMEOUT | Default Playwright timeout in ms. Keep below 30000 to avoid IPC timeouts. | 25000 |
AGENT_BROWSER_SESSION_NAME | Auto-save/load state persistence name. | (none) |
AGENT_BROWSER_STATE_EXPIRE_DAYS | Auto-delete saved session states older than N days. | 30 |
AGENT_BROWSER_ENCRYPTION_KEY | 64-char hex key for AES-256-GCM session encryption. | (none) |
AGENT_BROWSER_STREAM_PORT | Enable WebSocket streaming on the specified port (e.g., 9223). | (disabled) |
AGENT_BROWSER_IOS_DEVICE | Default iOS device name for the ios provider. | (none) |
AGENT_BROWSER_IOS_UDID | Default iOS device UDID for the ios provider. | (none) |
AGENT_BROWSER_DEBUG | Enable debug output (1 to enable). | (disabled) |