diff --git a/README.md b/README.md index 5c913ec..ab0bafa 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ agent-browser find role button click --name "Submit" ```bash agent-browser open # Navigate to URL (aliases: goto, navigate) -agent-browser click # Click element +agent-browser click # Click element (--new-tab to open in new tab) agent-browser dblclick # Double-click element agent-browser focus # Focus element agent-browser type # Type into element @@ -130,6 +130,7 @@ agent-browser get title # Get page title agent-browser get url # Get current URL agent-browser get count # Count matching elements agent-browser get box # Get bounding box +agent-browser get styles # Get computed styles ``` ### Check State @@ -155,7 +156,9 @@ agent-browser find last [value] # Last match agent-browser find nth [value] # Nth match ``` -**Actions:** `click`, `fill`, `check`, `hover`, `text` +**Actions:** `click`, `fill`, `type`, `hover`, `focus`, `check`, `uncheck`, `text` + +**Options:** `--name ` (filter role by accessible name), `--exact` (require exact text match) **Examples:** ```bash @@ -401,24 +404,25 @@ The `-C` flag is useful for modern web apps that use custom clickable elements ( | Option | Description | |--------|-------------| | `--session ` | Use isolated session (or `AGENT_BROWSER_SESSION` env) | +| `--session-name ` | Auto-save/restore session state (or `AGENT_BROWSER_SESSION_NAME` env) | | `--profile ` | Persistent browser profile directory (or `AGENT_BROWSER_PROFILE` env) | +| `--state ` | Load storage state from JSON file (or `AGENT_BROWSER_STATE` env) | | `--headers ` | Set HTTP headers scoped to the URL's origin | | `--executable-path ` | Custom browser executable (or `AGENT_BROWSER_EXECUTABLE_PATH` env) | +| `--extension ` | Load browser extension (repeatable; or `AGENT_BROWSER_EXTENSIONS` env) | | `--args ` | Browser launch args, comma or newline separated (or `AGENT_BROWSER_ARGS` env) | | `--user-agent ` | Custom User-Agent string (or `AGENT_BROWSER_USER_AGENT` env) | | `--proxy ` | Proxy server URL with optional auth (or `AGENT_BROWSER_PROXY` env) | | `--proxy-bypass ` | Hosts to bypass proxy (or `AGENT_BROWSER_PROXY_BYPASS` env) | -| `-p, --provider ` | Cloud browser provider (or `AGENT_BROWSER_PROVIDER` env) | -| `--json` | JSON output (for agents) | -| `--full, -f` | Full page screenshot | -| `--name, -n` | Locator name filter | -| `--exact` | Exact text match | -| `--headed` | Show browser window (not headless) | -| `--cdp ` | Connect via Chrome DevTools Protocol | -| `--auto-connect` | Auto-discover and connect to running Chrome (or `AGENT_BROWSER_AUTO_CONNECT` env) | -| `--session-name ` | Auto-save/restore session state (or `AGENT_BROWSER_SESSION_NAME` env) | | `--ignore-https-errors` | Ignore HTTPS certificate errors (useful for self-signed certs) | | `--allow-file-access` | Allow file:// URLs to access local files (Chromium only) | +| `-p, --provider ` | Cloud browser provider (or `AGENT_BROWSER_PROVIDER` env) | +| `--device ` | iOS device name, e.g. "iPhone 15 Pro" (or `AGENT_BROWSER_IOS_DEVICE` env) | +| `--json` | JSON output (for agents) | +| `--full, -f` | Full page screenshot | +| `--headed` | Show browser window (not headless) | +| `--cdp ` | Connect via Chrome DevTools Protocol (port or WebSocket URL) | +| `--auto-connect` | Auto-discover and connect to running Chrome (or `AGENT_BROWSER_AUTO_CONNECT` env) | | `--debug` | Debug output | ## Selectors diff --git a/cli/src/output.rs b/cli/src/output.rs index b401b87..e5ab55a 100644 --- a/cli/src/output.rs +++ b/cli/src/output.rs @@ -1887,6 +1887,7 @@ Environment: AGENT_BROWSER_ENCRYPTION_KEY 64-char hex key for AES-256-GCM state encryption AGENT_BROWSER_STATE_EXPIRE_DAYS Auto-delete states older than N days (default: 30) AGENT_BROWSER_EXECUTABLE_PATH Custom browser executable path + AGENT_BROWSER_EXTENSIONS Comma-separated browser extension paths AGENT_BROWSER_PROVIDER Browser provider (ios, browserbase, kernel, browseruse) AGENT_BROWSER_AUTO_CONNECT Auto-discover and connect to running Chrome AGENT_BROWSER_STREAM_PORT Enable WebSocket streaming on port (e.g., 9223) diff --git a/docs/src/app/cdp-mode/page.mdx b/docs/src/app/cdp-mode/page.mdx index 0310355..98ca5de 100644 --- a/docs/src/app/cdp-mode/page.mdx +++ b/docs/src/app/cdp-mode/page.mdx @@ -74,7 +74,7 @@ This enables control of: | --- | --- | | `--session ` | Use isolated session | | `--profile ` | Persistent browser profile directory | -| `-p ` | Cloud browser provider (`browserbase`, `browseruse`) | +| `-p ` | Cloud browser provider (`browserbase`, `browseruse`, `kernel`) | | `--headers ` | HTTP headers scoped to origin | | `--executable-path` | Custom browser executable | | `--args ` | Browser launch args (comma-separated) | @@ -104,6 +104,10 @@ agent-browser -p browserbase open https://example.com export BROWSER_USE_API_KEY="your-api-key" agent-browser -p browseruse open https://example.com +# Kernel +export KERNEL_API_KEY="your-api-key" +agent-browser -p kernel open https://example.com + # Or via environment variable export AGENT_BROWSER_PROVIDER=browserbase agent-browser open https://example.com diff --git a/docs/src/app/commands/page.mdx b/docs/src/app/commands/page.mdx index e57f226..2111203 100644 --- a/docs/src/app/commands/page.mdx +++ b/docs/src/app/commands/page.mdx @@ -6,20 +6,28 @@ export const metadata = { title: "Commands" } ```bash agent-browser open # Navigate (aliases: goto, navigate) -agent-browser click # Click element +agent-browser click # Click element (--new-tab to open in new tab) agent-browser dblclick # Double-click agent-browser fill # Clear and fill agent-browser type # Type into element -agent-browser press # Press key (Enter, Tab, Control+a) +agent-browser press # Press key (Enter, Tab, Control+a) (alias: key) +agent-browser keydown # Hold key down +agent-browser keyup # Release key agent-browser hover # Hover element +agent-browser focus # Focus element agent-browser select # Select dropdown option agent-browser check # Check checkbox agent-browser uncheck # Uncheck checkbox agent-browser scroll [px] # Scroll (up/down/left/right) +agent-browser scrollintoview # Scroll element into view +agent-browser drag # Drag and drop +agent-browser upload # Upload files agent-browser screenshot [path] # Screenshot (--full for full page) +agent-browser pdf # Save page as PDF agent-browser snapshot # Accessibility tree with refs agent-browser eval # Run JavaScript -agent-browser close # Close browser +agent-browser connect # Connect to browser via CDP +agent-browser close # Close browser (aliases: quit, exit) ``` ## Get info @@ -33,6 +41,7 @@ agent-browser get title # Get page title agent-browser get url # Get current URL agent-browser get count # Count matching elements agent-browser get box # Get bounding box +agent-browser get styles # Get computed styles ``` ## Check state @@ -45,24 +54,35 @@ agent-browser is checked # Check if checked ## Find elements -Semantic locators with actions (`click`, `fill`, `check`, `hover`, `text`): +Semantic locators with actions (`click`, `fill`, `type`, `hover`, `focus`, `check`, `uncheck`, `text`): ```bash agent-browser find role [value] agent-browser find text agent-browser find label