| name | agent-browser-state |
| version | 1.0.0 |
| description | Browser authentication state management: save and restore login sessions,
cookies, and storage across automation runs.
|
| allowed-tools | ["Bash","Read"] |
Agent Browser: Auth State Management
Save and restore browser authentication state (cookies, localStorage, sessionStorage)
across sessions.
Save State
agent-browser state save <path>
Captures cookies, localStorage, and sessionStorage for the current context.
Load State
agent-browser state load <path>
Load before navigating to apply saved authentication.
List Saved States
agent-browser state list
Inspect State
agent-browser state show <file>
Rename State
agent-browser state rename <old> <new>
Clear State
agent-browser state clear [name]
agent-browser state clear --all
Clean Old States
agent-browser state clean --older-than <days>
Examples
agent-browser open https://app.example.com/login
agent-browser fill "#email" "user@example.com"
agent-browser fill "#password" "secret"
agent-browser click "button[type=submit]"
agent-browser wait --url "/dashboard"
agent-browser state save auth-prod.json
agent-browser state load auth-prod.json
agent-browser open https://app.example.com/dashboard
agent-browser state list
agent-browser state show auth-prod.json
agent-browser state clean --older-than 30
Guidelines
- Save state after successful login to avoid re-authenticating
- State files contain sensitive session data - do not commit to git
- Load state before
open to ensure cookies are set before navigation
- Use descriptive filenames:
auth-staging.json, auth-admin.json
- Periodically clean old states to avoid stale sessions