Configuration
Create an agent-browser.json file to set persistent defaults instead of repeating flags on every command.
Config file locations
| 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 |
Example config
agent-browser.json
{
"$schema": "https://agentbrowser.dev/schema.json",
"headed": true,
"proxy": "http://localhost:8080",
"profile": "./browser-data",
"userAgent": "my-agent/1.0",
"hideScrollbars": false,
"ignoreHttpsErrors": true
}All options
| Config Key | CLI Flag | Type | Default |
|---|---|---|---|
headed | --headed | boolean | false |
headless | --headless | boolean | true |
proxy | --proxy <url> | string | - |
profile | --profile <path> | string | - |
userAgent | --user-agent <ua> | string | Chrome default |
hideScrollbars | --hide-scrollbars | boolean | true |
ignoreHttpsErrors | --ignore-https-errors | boolean | false |
timeout | --timeout <ms> | number | 30000 |
viewport | --viewport <WxH> | string | 1280x720 |
slowMo | --slow-mo <ms> | number | 0 |
Environment variables
Each config key maps to an AGENT_BROWSER_* environment variable using SCREAMING_SNAKE_CASE:
.env or shell
AGENT_BROWSER_HEADED=true
AGENT_BROWSER_PROXY=http://localhost:8080
AGENT_BROWSER_PROFILE=./browser-data
AGENT_BROWSER_TIMEOUT=60000Custom config path
agent-browser --config ./ci-config.json open example.com
AGENT_BROWSER_CONFIG=./ci-config.json agent-browser open example.comSession-level config
Flags passed at session open time apply to that session only and override the config file:
agent-browser open --headed --viewport 1920x1080 https://example.com
agent-browser open --proxy http://myproxy:8080 https://example.com