Add --profile flag for persistent browser profiles (#68)

* Add --profile flag for persistent browser profiles

Adds support for persistent browser profiles that preserve cookies,
localStorage, and login sessions across browser restarts.

Changes:
- Add --profile <path> CLI flag (flags.rs)
- Add AGENT_BROWSER_PROFILE environment variable support
- Add profile field to LaunchCommand type (types.ts)
- Use launchPersistentContext when profile is specified (browser.ts)
- Update help text and README with documentation

Usage:
  agent-browser --profile ~/.myapp-profile open myapp.com

This enables AI agents to maintain authenticated sessions across
browser restarts without re-authenticating each time.

* Expand tilde in profile path to home directory

* fix: add missing profile field to test Flags struct

---------

Co-authored-by: Chris Tate <chris@ctate.dev>
This commit is contained in:
Lindsey Simon
2026-01-22 08:05:25 -06:00
committed by GitHub
co-authored by Chris Tate
parent c6a92a1472
commit 36cca10c10
7 changed files with 64 additions and 2 deletions
+1
View File
@@ -17,6 +17,7 @@ export interface LaunchCommand extends BaseCommand {
cdpPort?: number;
cdpUrl?: string;
extensions?: string[];
profile?: string; // Path to persistent browser profile directory
proxy?: {
server: string;
bypass?: string;