browser-cli config is JSON.
{
"baseUrl": "https://example.com",
"timeout": 10000,
"downloadDir": "./downloads",
"viewport": {
"width": 1440,
"height": 900
},
"snapshot": {
"globals": []
},
"policy": {
"mode": "normal"
},
"auth": {
"demo": {
"loginUrl": "/login",
"fields": {
"username": "[email protected]",
"password": "replace-me"
},
"csrfField": "_token"
}
}
}Fields:
| Field | Purpose |
|---|---|
baseUrl |
Base URL used for relative paths |
timeout |
Default command timeout in milliseconds |
downloadDir |
Directory for downloaded files and screenshots |
viewport |
Initial viewport for local mode and new CDP contexts |
snapshot.globals |
Explicit page global names to include in snapshot output |
policy.mode |
safe, normal, or aggressive |
auth |
Named login profiles |
Do not commit real credentials. Keep project-specific configs outside this repository or use local ignored files.
Runtime viewport changes use the command surface:
viewport 375x667
viewport desktop