rebrand: agent-browser-stealth → chrome-use, de-fork, reset to v1.0.0
Release binaries / Build macOS ARM64 (push) Has been cancelled
Release binaries / Build macOS x64 (push) Has been cancelled
Release binaries / Build Linux ARM64 (push) Has been cancelled
Release binaries / Build Linux musl ARM64 (push) Has been cancelled
Release binaries / Build Linux musl x64 (push) Has been cancelled
Release binaries / Build Linux x64 (push) Has been cancelled
Release binaries / Build Windows x64 (push) Has been cancelled
Release binaries / Attach binaries to GitHub Release (push) Has been cancelled
Release binaries / Build macOS ARM64 (push) Has been cancelled
Release binaries / Build macOS x64 (push) Has been cancelled
Release binaries / Build Linux ARM64 (push) Has been cancelled
Release binaries / Build Linux musl ARM64 (push) Has been cancelled
Release binaries / Build Linux musl x64 (push) Has been cancelled
Release binaries / Build Linux x64 (push) Has been cancelled
Release binaries / Build Windows x64 (push) Has been cancelled
Release binaries / Attach binaries to GitHub Release (push) Has been cancelled
Standalone product rename across the whole repo (issue: project identity): - Binary/package/repo/skill/docs: agent-browser[-stealth] → chrome-use (single binary name `chrome-use`; old aliases agent-browser/abs dropped). - Version: 0.27.0-fork.51 → 1.0.0 (drop the upstream-fork counter). - Native-messaging host: com.agent_browser.connect → com.leeguoo.chrome_use (CLI + ab-connect extension in lockstep — this is a breaking handshake change, extension bumped 0.4.2 → 0.5.0, needs a Web Store republish). - Config dir: ~/.agent-browser → ~/.chrome-use. - README/zh: reframed from "stealth fork of agent-browser" to a standalone product with a small `originally based on vercel-labs/agent-browser` credit. - Kept AGENT_BROWSER_* env vars working (63 vars across the codebase; renaming them would break every existing script/skill for no user-facing gain). Build green, 802 unit tests pass, fmt + clippy clean. Upstream attribution to vercel-labs/agent-browser preserved.
This commit is contained in:
@@ -44,18 +44,18 @@ Log in to your target site(s) in this Chrome window as you normally would.
|
||||
|
||||
```bash
|
||||
# Auto-discover the running Chrome and save its cookies + localStorage
|
||||
agent-browser --auto-connect state save ./my-auth.json
|
||||
chrome-use --auto-connect state save ./my-auth.json
|
||||
```
|
||||
|
||||
**Step 3: Reuse in automation**
|
||||
|
||||
```bash
|
||||
# Load auth at launch
|
||||
agent-browser --state ./my-auth.json open https://app.example.com/dashboard
|
||||
chrome-use --state ./my-auth.json open https://app.example.com/dashboard
|
||||
|
||||
# Or load into an existing session
|
||||
agent-browser state load ./my-auth.json
|
||||
agent-browser open https://app.example.com/dashboard
|
||||
chrome-use state load ./my-auth.json
|
||||
chrome-use open https://app.example.com/dashboard
|
||||
```
|
||||
|
||||
This works for any site, including those with complex OAuth flows, SSO, or 2FA -- as long as Chrome already has valid session cookies.
|
||||
@@ -65,35 +65,35 @@ This works for any site, including those with complex OAuth flows, SSO, or 2FA -
|
||||
**Tip:** Combine with `--session-name` so the imported auth auto-persists across restarts:
|
||||
|
||||
```bash
|
||||
agent-browser --session-name myapp state load ./my-auth.json
|
||||
chrome-use --session-name myapp state load ./my-auth.json
|
||||
# From now on, state is auto-saved/restored for "myapp"
|
||||
```
|
||||
|
||||
## Persistent Profiles
|
||||
|
||||
Use `--profile` to point agent-browser at a Chrome user data directory. This persists everything (cookies, IndexedDB, service workers, cache) across browser restarts without explicit save/load:
|
||||
Use `--profile` to point chrome-use at a Chrome user data directory. This persists everything (cookies, IndexedDB, service workers, cache) across browser restarts without explicit save/load:
|
||||
|
||||
```bash
|
||||
# First run: login once
|
||||
agent-browser --profile ~/.myapp-profile open https://app.example.com/login
|
||||
chrome-use --profile ~/.myapp-profile open https://app.example.com/login
|
||||
# ... complete login flow ...
|
||||
|
||||
# All subsequent runs: already authenticated
|
||||
agent-browser --profile ~/.myapp-profile open https://app.example.com/dashboard
|
||||
chrome-use --profile ~/.myapp-profile open https://app.example.com/dashboard
|
||||
```
|
||||
|
||||
Use different paths for different projects or test users:
|
||||
|
||||
```bash
|
||||
agent-browser --profile ~/.profiles/admin open https://app.example.com
|
||||
agent-browser --profile ~/.profiles/viewer open https://app.example.com
|
||||
chrome-use --profile ~/.profiles/admin open https://app.example.com
|
||||
chrome-use --profile ~/.profiles/viewer open https://app.example.com
|
||||
```
|
||||
|
||||
Or set via environment variable:
|
||||
|
||||
```bash
|
||||
export AGENT_BROWSER_PROFILE=~/.myapp-profile
|
||||
agent-browser open https://app.example.com/dashboard
|
||||
chrome-use open https://app.example.com/dashboard
|
||||
```
|
||||
|
||||
## Session Persistence
|
||||
@@ -102,42 +102,42 @@ Use `--session-name` to auto-save and restore cookies + localStorage by name, wi
|
||||
|
||||
```bash
|
||||
# Auto-saves state on close, auto-restores on next launch
|
||||
agent-browser --session-name twitter open https://twitter.com
|
||||
chrome-use --session-name twitter open https://twitter.com
|
||||
# ... login flow ...
|
||||
agent-browser close # state saved to ~/.agent-browser/sessions/
|
||||
chrome-use close # state saved to ~/.chrome-use/sessions/
|
||||
|
||||
# Next time: state is automatically restored
|
||||
agent-browser --session-name twitter open https://twitter.com
|
||||
chrome-use --session-name twitter open https://twitter.com
|
||||
```
|
||||
|
||||
Encrypt state at rest:
|
||||
|
||||
```bash
|
||||
export AGENT_BROWSER_ENCRYPTION_KEY=$(openssl rand -hex 32)
|
||||
agent-browser --session-name secure open https://app.example.com
|
||||
chrome-use --session-name secure open https://app.example.com
|
||||
```
|
||||
|
||||
## Basic Login Flow
|
||||
|
||||
```bash
|
||||
# Navigate to login page
|
||||
agent-browser open https://app.example.com/login
|
||||
agent-browser wait --load networkidle
|
||||
chrome-use open https://app.example.com/login
|
||||
chrome-use wait --load networkidle
|
||||
|
||||
# Get form elements
|
||||
agent-browser snapshot -i
|
||||
chrome-use snapshot -i
|
||||
# Output: @e1 [input type="email"], @e2 [input type="password"], @e3 [button] "Sign In"
|
||||
|
||||
# Fill credentials
|
||||
agent-browser fill @e1 "user@example.com"
|
||||
agent-browser fill @e2 "password123"
|
||||
chrome-use fill @e1 "user@example.com"
|
||||
chrome-use fill @e2 "password123"
|
||||
|
||||
# Submit
|
||||
agent-browser click @e3
|
||||
agent-browser wait --load networkidle
|
||||
chrome-use click @e3
|
||||
chrome-use wait --load networkidle
|
||||
|
||||
# Verify login succeeded
|
||||
agent-browser get url # Should be dashboard, not login
|
||||
chrome-use get url # Should be dashboard, not login
|
||||
```
|
||||
|
||||
## Saving Authentication State
|
||||
@@ -146,15 +146,15 @@ After logging in, save state for reuse:
|
||||
|
||||
```bash
|
||||
# Login first (see above)
|
||||
agent-browser open https://app.example.com/login
|
||||
agent-browser snapshot -i
|
||||
agent-browser fill @e1 "user@example.com"
|
||||
agent-browser fill @e2 "password123"
|
||||
agent-browser click @e3
|
||||
agent-browser wait --url "**/dashboard"
|
||||
chrome-use open https://app.example.com/login
|
||||
chrome-use snapshot -i
|
||||
chrome-use fill @e1 "user@example.com"
|
||||
chrome-use fill @e2 "password123"
|
||||
chrome-use click @e3
|
||||
chrome-use wait --url "**/dashboard"
|
||||
|
||||
# Save authenticated state
|
||||
agent-browser state save ./auth-state.json
|
||||
chrome-use state save ./auth-state.json
|
||||
```
|
||||
|
||||
## Restoring Authentication
|
||||
@@ -163,13 +163,13 @@ Skip login by loading saved state:
|
||||
|
||||
```bash
|
||||
# Load saved auth state
|
||||
agent-browser state load ./auth-state.json
|
||||
chrome-use state load ./auth-state.json
|
||||
|
||||
# Navigate directly to protected page
|
||||
agent-browser open https://app.example.com/dashboard
|
||||
chrome-use open https://app.example.com/dashboard
|
||||
|
||||
# Verify authenticated
|
||||
agent-browser snapshot -i
|
||||
chrome-use snapshot -i
|
||||
```
|
||||
|
||||
## OAuth / SSO Flows
|
||||
@@ -178,23 +178,23 @@ For OAuth redirects:
|
||||
|
||||
```bash
|
||||
# Start OAuth flow
|
||||
agent-browser open https://app.example.com/auth/google
|
||||
chrome-use open https://app.example.com/auth/google
|
||||
|
||||
# Handle redirects automatically
|
||||
agent-browser wait --url "**/accounts.google.com**"
|
||||
agent-browser snapshot -i
|
||||
chrome-use wait --url "**/accounts.google.com**"
|
||||
chrome-use snapshot -i
|
||||
|
||||
# Fill Google credentials
|
||||
agent-browser fill @e1 "user@gmail.com"
|
||||
agent-browser click @e2 # Next button
|
||||
agent-browser wait 2000
|
||||
agent-browser snapshot -i
|
||||
agent-browser fill @e3 "password"
|
||||
agent-browser click @e4 # Sign in
|
||||
chrome-use fill @e1 "user@gmail.com"
|
||||
chrome-use click @e2 # Next button
|
||||
chrome-use wait 2000
|
||||
chrome-use snapshot -i
|
||||
chrome-use fill @e3 "password"
|
||||
chrome-use click @e4 # Sign in
|
||||
|
||||
# Wait for redirect back
|
||||
agent-browser wait --url "**/app.example.com**"
|
||||
agent-browser state save ./oauth-state.json
|
||||
chrome-use wait --url "**/app.example.com**"
|
||||
chrome-use state save ./oauth-state.json
|
||||
```
|
||||
|
||||
## Two-Factor Authentication
|
||||
@@ -203,18 +203,18 @@ Handle 2FA with manual intervention:
|
||||
|
||||
```bash
|
||||
# Login with credentials
|
||||
agent-browser open https://app.example.com/login --headed # Show browser
|
||||
agent-browser snapshot -i
|
||||
agent-browser fill @e1 "user@example.com"
|
||||
agent-browser fill @e2 "password123"
|
||||
agent-browser click @e3
|
||||
chrome-use open https://app.example.com/login --headed # Show browser
|
||||
chrome-use snapshot -i
|
||||
chrome-use fill @e1 "user@example.com"
|
||||
chrome-use fill @e2 "password123"
|
||||
chrome-use click @e3
|
||||
|
||||
# Wait for user to complete 2FA manually
|
||||
echo "Complete 2FA in the browser window..."
|
||||
agent-browser wait --url "**/dashboard" --timeout 120000
|
||||
chrome-use wait --url "**/dashboard" --timeout 120000
|
||||
|
||||
# Save state after 2FA
|
||||
agent-browser state save ./2fa-state.json
|
||||
chrome-use state save ./2fa-state.json
|
||||
```
|
||||
|
||||
## HTTP Basic Auth
|
||||
@@ -223,10 +223,10 @@ For sites using HTTP Basic Authentication:
|
||||
|
||||
```bash
|
||||
# Set credentials before navigation
|
||||
agent-browser set credentials username password
|
||||
chrome-use set credentials username password
|
||||
|
||||
# Navigate to protected resource
|
||||
agent-browser open https://protected.example.com/api
|
||||
chrome-use open https://protected.example.com/api
|
||||
```
|
||||
|
||||
## Cookie-Based Auth
|
||||
@@ -235,10 +235,10 @@ Manually set authentication cookies:
|
||||
|
||||
```bash
|
||||
# Set auth cookie
|
||||
agent-browser cookies set session_token "abc123xyz"
|
||||
chrome-use cookies set session_token "abc123xyz"
|
||||
|
||||
# Navigate to protected page
|
||||
agent-browser open https://app.example.com/dashboard
|
||||
chrome-use open https://app.example.com/dashboard
|
||||
```
|
||||
|
||||
## Token Refresh Handling
|
||||
@@ -253,24 +253,24 @@ STATE_FILE="./auth-state.json"
|
||||
|
||||
# Try loading existing state
|
||||
if [[ -f "$STATE_FILE" ]]; then
|
||||
agent-browser state load "$STATE_FILE"
|
||||
agent-browser open https://app.example.com/dashboard
|
||||
chrome-use state load "$STATE_FILE"
|
||||
chrome-use open https://app.example.com/dashboard
|
||||
|
||||
# Check if session is still valid
|
||||
URL=$(agent-browser get url)
|
||||
URL=$(chrome-use get url)
|
||||
if [[ "$URL" == *"/login"* ]]; then
|
||||
echo "Session expired, re-authenticating..."
|
||||
# Perform fresh login
|
||||
agent-browser snapshot -i
|
||||
agent-browser fill @e1 "$USERNAME"
|
||||
agent-browser fill @e2 "$PASSWORD"
|
||||
agent-browser click @e3
|
||||
agent-browser wait --url "**/dashboard"
|
||||
agent-browser state save "$STATE_FILE"
|
||||
chrome-use snapshot -i
|
||||
chrome-use fill @e1 "$USERNAME"
|
||||
chrome-use fill @e2 "$PASSWORD"
|
||||
chrome-use click @e3
|
||||
chrome-use wait --url "**/dashboard"
|
||||
chrome-use state save "$STATE_FILE"
|
||||
fi
|
||||
else
|
||||
# First-time login
|
||||
agent-browser open https://app.example.com/login
|
||||
chrome-use open https://app.example.com/login
|
||||
# ... login flow ...
|
||||
fi
|
||||
```
|
||||
@@ -284,20 +284,20 @@ fi
|
||||
|
||||
2. **Use environment variables for credentials**
|
||||
```bash
|
||||
agent-browser fill @e1 "$APP_USERNAME"
|
||||
agent-browser fill @e2 "$APP_PASSWORD"
|
||||
chrome-use fill @e1 "$APP_USERNAME"
|
||||
chrome-use fill @e2 "$APP_PASSWORD"
|
||||
```
|
||||
|
||||
3. **Clean up after automation**
|
||||
```bash
|
||||
agent-browser cookies clear
|
||||
chrome-use cookies clear
|
||||
rm -f ./auth-state.json
|
||||
```
|
||||
|
||||
4. **Use short-lived sessions for CI/CD**
|
||||
```bash
|
||||
# Don't persist state in CI
|
||||
agent-browser open https://app.example.com/login
|
||||
chrome-use open https://app.example.com/login
|
||||
# ... login and perform actions ...
|
||||
agent-browser close # Session ends, nothing persisted
|
||||
chrome-use close # Session ends, nothing persisted
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user