You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
236 lines
28 KiB
236 lines
28 KiB
<!DOCTYPE html><html lang="en" data-theme="light"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Agent Browser — ClawHub</title><meta property="og:site_name" content="ClawHub"><meta name="description" content="A fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands."><meta property="og:title" content="Agent Browser — ClawHub"><meta property="og:description" content="A fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands."><meta property="og:type" content="website"><meta property="og:url" content="https://clawhub.ai/TheSethRose/agent-browser"><meta property="og:image" content="https://clawhub.ai/og/skill.png?v=5&slug=agent-browser&owner=TheSethRose&version=0.2.0"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta property="og:image:alt" content="Agent Browser — ClawHub"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="Agent Browser — ClawHub"><meta name="twitter:description" content="A fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands."><meta name="twitter:image" content="https://clawhub.ai/og/skill.png?v=5&slug=agent-browser&owner=TheSethRose&version=0.2.0"><meta name="twitter:image:alt" content="Agent Browser — ClawHub"><link rel="modulepreload" href="/assets/main-D0XDqRWZ.js"><link rel="modulepreload" href="/assets/_slug-OCLwLz8Z.js"><link rel="canonical" href="https://clawhub.ai/TheSethRose/agent-browser"><link rel="stylesheet" href="/assets/styles-B-MS3JMG.css"><script src="/_vercel/insights/script.js" defer="" data-sdkn="@vercel/analytics/react" data-sdkv="1.6.1"></script><link rel="modulepreload" as="script" crossorigin="" href="/assets/SkillFilesPanel-C0RZcamd.js"><link rel="modulepreload" as="script" crossorigin="" href="/assets/index-7jfXtzKw.js"></head><body><div class="app-shell"><header class="navbar"><div class="navbar-inner"><a href="/" class="brand"><span class="brand-mark"><img alt="" aria-hidden="true" src="/clawd-logo.png"></span><span class="brand-name">ClawHub</span></a><nav class="nav-links"><a href="/skills">Skills</a><a href="/upload">Upload</a><a href="/import">Import</a><a href="/skills?focus=search">Search</a></nav><div class="nav-actions"><div class="nav-mobile"><button class="nav-mobile-trigger" type="button" aria-label="Open menu" id="radix-_r_0_" aria-haspopup="menu" aria-expanded="false" data-state="closed"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-menu h-4 w-4" aria-hidden="true"><path d="M4 5h16"></path><path d="M4 12h16"></path><path d="M4 19h16"></path></svg></button></div><div class="theme-toggle"><div role="group" dir="ltr" class="inline-flex items-center gap-1 rounded-full border border-[color:var(--line)] bg-[color:var(--surface)] p-1" aria-label="Theme mode" tabindex="0" style="outline: none;"><button type="button" data-state="on" role="radio" aria-checked="true" class="inline-flex h-9 w-9 items-center justify-center rounded-full text-[color:var(--ink-soft)] transition-colors hover:text-[color:var(--ink)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--accent)] data-[state=on]:bg-[color:var(--accent)] data-[state=on]:text-white" aria-label="System theme" tabindex="-1" data-radix-collection-item=""><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-monitor h-4 w-4" aria-hidden="true"><rect width="20" height="14" x="2" y="3" rx="2"></rect><line x1="8" x2="16" y1="21" y2="21"></line><line x1="12" x2="12" y1="17" y2="21"></line></svg><span class="sr-only">System</span></button><button type="button" data-state="off" role="radio" aria-checked="false" class="inline-flex h-9 w-9 items-center justify-center rounded-full text-[color:var(--ink-soft)] transition-colors hover:text-[color:var(--ink)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--accent)] data-[state=on]:bg-[color:var(--accent)] data-[state=on]:text-white" aria-label="Light theme" tabindex="-1" data-radix-collection-item=""><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sun h-4 w-4" aria-hidden="true"><circle cx="12" cy="12" r="4"></circle><path d="M12 2v2"></path><path d="M12 20v2"></path><path d="m4.93 4.93 1.41 1.41"></path><path d="m17.66 17.66 1.41 1.41"></path><path d="M2 12h2"></path><path d="M20 12h2"></path><path d="m6.34 17.66-1.41 1.41"></path><path d="m19.07 4.93-1.41 1.41"></path></svg><span class="sr-only">Light</span></button><button type="button" data-state="off" role="radio" aria-checked="false" class="inline-flex h-9 w-9 items-center justify-center rounded-full text-[color:var(--ink-soft)] transition-colors hover:text-[color:var(--ink)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--accent)] data-[state=on]:bg-[color:var(--accent)] data-[state=on]:text-white" aria-label="Dark theme" tabindex="-1" data-radix-collection-item=""><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon h-4 w-4" aria-hidden="true"><path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"></path></svg><span class="sr-only">Dark</span></button></div></div><button class="btn btn-primary" type="button"><span class="sign-in-label">Sign in</span><span class="sign-in-provider">with GitHub</span></button></div></div></header><main class="section"><div class="skill-detail-stack"><div class="pending-banner pending-banner-warning"><div class="pending-banner-content"><strong>Skill flagged — suspicious patterns detected</strong><p>ClawHub Security flagged this skill as suspicious. Review the scan results before using.</p></div></div><div class="card skill-hero"><div class="skill-hero-top"><div class="skill-hero-header"><div class="skill-hero-title"><div class="skill-hero-title-row"><h1 class="section-title" style="margin: 0px;">Agent Browser</h1></div><p class="section-subtitle">A fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands.</p><div class="stat">⭐ 369 · <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-package" aria-hidden="true"><path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"></path><path d="M12 22V12"></path><polyline points="3.29 7 12 12 20.71 7"></polyline><path d="m7.5 4.27 9 5.15"></path></svg> 70.5k · 928 current installs · 957 all-time installs</div><div class="stat"><span class="user-badge user-badge-md"><span class="user-badge-prefix">by</span><span class="user-avatar" aria-hidden="true"><img class="user-avatar-img" alt="" loading="lazy" src="https://avatars.githubusercontent.com/u/10383809?v=4"></span><span class="user-name">Seth Rose</span><span class="user-name-sep" aria-hidden="true">·</span><a class="user-handle" href="/u/TheSethRose">@TheSethRose</a></span></div><div class="skill-actions"></div><div class="scan-results-panel"><div class="scan-results-title">Security Scan</div><div class="scan-results-list"><div class="scan-result-row"><div class="scan-result-scanner"><svg class="scan-result-icon scan-result-icon-vt" width="1em" height="1em" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 89" aria-label="VirusTotal"><title>VirusTotal</title><path fill="currentColor" fill-rule="evenodd" d="M45.292 44.5 0 89h100V0H0l45.292 44.5zM90 80H22l35.987-35.2L22 9h68v71z"></path></svg><span class="scan-result-scanner-name">VirusTotal</span></div><div class="scan-result-status scan-status-suspicious">Suspicious</div><a href="https://www.virustotal.com/gui/file/29701aa09cb5e5e4ee1bed1fc35e1307b6a944cf35420b4e2c991abe1178bb53" target="_blank" rel="noopener noreferrer" class="scan-result-link">View report →</a></div><div class="scan-result-row"><div class="scan-result-scanner"><svg class="scan-result-icon scan-result-icon-oc" width="1em" height="1em" viewBox="0 0 24 24" fill="none" aria-label="OpenClaw"><title>OpenClaw</title><path d="M12 2C8.5 2 5.5 4 4 7c-2 4-1 8 2 11 1.5 1.5 3.5 2.5 6 2.5s4.5-1 6-2.5c3-3 4-7 2-11-1.5-3-4.5-5-8-5z" fill="currentColor" opacity="0.2"></path><path d="M9 8c1-2 3-3 5-2s3 3 2 5l-3 4-2-1 3-4c.5-1 0-2-1-2.5S11 7 10.5 8L8 12l-2-1 3-4z" fill="currentColor"></path><path d="M15 8c-1-2-3-3-5-2s-3 3-2 5l3 4 2-1-3-4c-.5-1 0-2 1-2.5S14 7 14.5 8L17 12l2-1-4-3z" fill="currentColor" opacity="0.6"></path></svg><span class="scan-result-scanner-name">OpenClaw</span></div><div class="scan-result-status scan-status-clean">Benign</div><span class="scan-result-confidence">high confidence</span></div><div class="analysis-detail"><button type="button" class="analysis-detail-header" aria-expanded="false"><span class="analysis-summary-text">The skill is an instruction-only wrapper for an agent-browser CLI and its declared requirements (node/npm and an npm-installable CLI) match the documented behavior — nothing in the skill files requests unrelated credentials or system access.</span><span class="analysis-detail-toggle">Details <span class="chevron">▾</span></span></button><div class="analysis-body"><div class="analysis-dimensions"><div class="dimension-row"><div class="dimension-icon dimension-icon-ok">✓</div><div class="dimension-content"><div class="dimension-label">Purpose & Capability</div><div class="dimension-detail">The name and description claim a headless browser CLI wrapper and the SKILL.md exclusively documents how to install and use an agent-browser CLI. Required binaries (node, npm) and the npm install instructions are consistent with building/using a Node-distributed CLI. There are no unrelated credentials, binaries, or config paths requested.</div></div></div><div class="dimension-row"><div class="dimension-icon dimension-icon-ok">✓</div><div class="dimension-content"><div class="dimension-label">Instruction Scope</div><div class="dimension-detail">The runtime instructions direct the agent to run agent-browser CLI commands (open, snapshot, click, fill, screenshot, record, etc.). They do not instruct the agent to read arbitrary local files, environment variables, or other system configuration beyond invoking the CLI. Note: because the CLI automates arbitrary web pages and can capture screenshots, upload files, and record video, those features can expose user data if used against sensitive sites — but that capability is coherent with a browser automation tool.</div></div></div><div class="dimension-row"><div class="dimension-icon dimension-icon-note">ℹ</div><div class="dimension-content"><div class="dimension-label">Install Mechanism</div><div class="dimension-detail">This is an instruction-only skill with no embedded install spec; SKILL.md instructs the user/agent to install via npm (npm install -g agent-browser) or build from a GitHub repo. That is a normal distribution mechanism, but it means the actual code comes from npm/GitHub — verify the npm package and repository provenance before installing globally. Because no install artifacts are bundled with the skill, the security posture depends on the external package source.</div></div></div><div class="dimension-row"><div class="dimension-icon dimension-icon-ok">✓</div><div class="dimension-content"><div class="dimension-label">Credentials</div><div class="dimension-detail">The skill does not request environment variables, keys, or config paths. Requesting node and npm is appropriate for a Node-distributed CLI. There are no unrelated credential requests or excessive environment access declared.</div></div></div><div class="dimension-row"><div class="dimension-icon dimension-icon-ok">✓</div><div class="dimension-content"><div class="dimension-label">Persistence & Privilege</div><div class="dimension-detail">The skill does not request always:true or any persistent elevated privileges. It is user-invocable and allows normal autonomous invocation (platform default). There is no indication it attempts to modify other skills or system-wide agent settings.</div></div></div></div><div class="analysis-guidance benign"><div class="analysis-guidance-label">Assessment</div>This skill appears to be a straightforward wrapper around an agent-browser CLI and is internally consistent. Before installing or invoking it: 1) Verify the npm package and GitHub repository (author, package contents, recent releases) to ensure you trust the upstream code; 2) Prefer installing in a sandbox or container rather than globally if you are unsure; 3) Be mindful that the CLI can navigate arbitrary sites, capture screenshots, upload files, and record video — avoid running it against accounts or pages containing sensitive data unless you trust the CLI and the agent's commands; 4) If you want stronger guarantees, inspect the agent-browser package source (or vendor a vetted binary) before usage. Overall, nothing in the SKILL.md requests unrelated secrets or system access.</div></div></div></div></div><p class="scan-disclaimer">Like a lobster shell, security has layers — review code before you run it.</p></div><div class="skill-hero-cta"><div class="skill-version-pill"><span class="skill-version-label">Current version</span><strong>v0.2.0</strong></div><a class="btn btn-primary" href="https://wry-manatee-359.convex.site/api/v1/download?slug=agent-browser">Download zip</a></div></div></div><div class="skill-tag-row"><span class="tag">automation<span class="tag-meta">v0.1.0</span></span><span class="tag">browser<span class="tag-meta">v0.1.0</span></span><span class="tag">headless<span class="tag-meta">v0.1.0</span></span><span class="tag">latest<span class="tag-meta">v0.2.0</span></span><span class="tag">web<span class="tag-meta">v0.1.0</span></span></div><div class="skill-hero-content"><div class="skill-hero-panels"><div class="skill-panel"><h3 class="section-title" style="font-size: 1rem; margin: 0px;">Runtime requirements</h3><div class="skill-panel-body"><div class="tag">🌐 Clawdis</div><div class="stat"><strong>Bins</strong><span>node, npm</span></div></div></div></div></div></div><div class="card tab-card"><div class="tab-header"><button class="tab-button is-active" type="button">Files</button><button class="tab-button" type="button">Compare</button><button class="tab-button" type="button">Versions</button></div><div class="tab-body"><div><h2 class="section-title" style="font-size: 1.2rem; margin: 0px;">SKILL.md</h2><div class="markdown"><h1>Browser Automation with agent-browser</h1>
|
|
<h2>Installation</h2>
|
|
<h3>npm recommended</h3>
|
|
<pre><code class="language-bash">npm install -g agent-browser
|
|
agent-browser install
|
|
agent-browser install --with-deps
|
|
</code></pre>
|
|
<h3>From Source</h3>
|
|
<pre><code class="language-bash">git clone https://github.com/vercel-labs/agent-browser
|
|
cd agent-browser
|
|
pnpm install
|
|
pnpm build
|
|
agent-browser install
|
|
</code></pre>
|
|
<h2>Quick start</h2>
|
|
<pre><code class="language-bash">agent-browser open <url> # Navigate to page
|
|
agent-browser snapshot -i # Get interactive elements with refs
|
|
agent-browser click @e1 # Click element by ref
|
|
agent-browser fill @e2 "text" # Fill input by ref
|
|
agent-browser close # Close browser
|
|
</code></pre>
|
|
<h2>Core workflow</h2>
|
|
<ol>
|
|
<li>Navigate: <code>agent-browser open <url></code></li>
|
|
<li>Snapshot: <code>agent-browser snapshot -i</code> (returns elements with refs like <code>@e1</code>, <code>@e2</code>)</li>
|
|
<li>Interact using refs from the snapshot</li>
|
|
<li>Re-snapshot after navigation or significant DOM changes</li>
|
|
</ol>
|
|
<h2>Commands</h2>
|
|
<h3>Navigation</h3>
|
|
<pre><code class="language-bash">agent-browser open <url> # Navigate to URL
|
|
agent-browser back # Go back
|
|
agent-browser forward # Go forward
|
|
agent-browser reload # Reload page
|
|
agent-browser close # Close browser
|
|
</code></pre>
|
|
<h3>Snapshot (page analysis)</h3>
|
|
<pre><code class="language-bash">agent-browser snapshot # Full accessibility tree
|
|
agent-browser snapshot -i # Interactive elements only (recommended)
|
|
agent-browser snapshot -c # Compact output
|
|
agent-browser snapshot -d 3 # Limit depth to 3
|
|
agent-browser snapshot -s "#main" # Scope to CSS selector
|
|
</code></pre>
|
|
<h3>Interactions (use @refs from snapshot)</h3>
|
|
<pre><code class="language-bash">agent-browser click @e1 # Click
|
|
agent-browser dblclick @e1 # Double-click
|
|
agent-browser focus @e1 # Focus element
|
|
agent-browser fill @e2 "text" # Clear and type
|
|
agent-browser type @e2 "text" # Type without clearing
|
|
agent-browser press Enter # Press key
|
|
agent-browser press Control+a # Key combination
|
|
agent-browser keydown Shift # Hold key down
|
|
agent-browser keyup Shift # Release key
|
|
agent-browser hover @e1 # Hover
|
|
agent-browser check @e1 # Check checkbox
|
|
agent-browser uncheck @e1 # Uncheck checkbox
|
|
agent-browser select @e1 "value" # Select dropdown
|
|
agent-browser scroll down 500 # Scroll page
|
|
agent-browser scrollintoview @e1 # Scroll element into view
|
|
agent-browser drag @e1 @e2 # Drag and drop
|
|
agent-browser upload @e1 file.pdf # Upload files
|
|
</code></pre>
|
|
<h3>Get information</h3>
|
|
<pre><code class="language-bash">agent-browser get text @e1 # Get element text
|
|
agent-browser get html @e1 # Get innerHTML
|
|
agent-browser get value @e1 # Get input value
|
|
agent-browser get attr @e1 href # Get attribute
|
|
agent-browser get title # Get page title
|
|
agent-browser get url # Get current URL
|
|
agent-browser get count ".item" # Count matching elements
|
|
agent-browser get box @e1 # Get bounding box
|
|
</code></pre>
|
|
<h3>Check state</h3>
|
|
<pre><code class="language-bash">agent-browser is visible @e1 # Check if visible
|
|
agent-browser is enabled @e1 # Check if enabled
|
|
agent-browser is checked @e1 # Check if checked
|
|
</code></pre>
|
|
<h3>Screenshots & PDF</h3>
|
|
<pre><code class="language-bash">agent-browser screenshot # Screenshot to stdout
|
|
agent-browser screenshot path.png # Save to file
|
|
agent-browser screenshot --full # Full page
|
|
agent-browser pdf output.pdf # Save as PDF
|
|
</code></pre>
|
|
<h3>Video recording</h3>
|
|
<pre><code class="language-bash">agent-browser record start ./demo.webm # Start recording (uses current URL + state)
|
|
agent-browser click @e1 # Perform actions
|
|
agent-browser record stop # Stop and save video
|
|
agent-browser record restart ./take2.webm # Stop current + start new recording
|
|
</code></pre>
|
|
<p>Recording creates a fresh context but preserves cookies/storage from your session. If no URL is provided, it automatically returns to your current page. For smooth demos, explore first, then start recording.</p>
|
|
<h3>Wait</h3>
|
|
<pre><code class="language-bash">agent-browser wait @e1 # Wait for element
|
|
agent-browser wait 2000 # Wait milliseconds
|
|
agent-browser wait --text "Success" # Wait for text
|
|
agent-browser wait --url "/dashboard" # Wait for URL pattern
|
|
agent-browser wait --load networkidle # Wait for network idle
|
|
agent-browser wait --fn "window.ready" # Wait for JS condition
|
|
</code></pre>
|
|
<h3>Mouse control</h3>
|
|
<pre><code class="language-bash">agent-browser mouse move 100 200 # Move mouse
|
|
agent-browser mouse down left # Press button
|
|
agent-browser mouse up left # Release button
|
|
agent-browser mouse wheel 100 # Scroll wheel
|
|
</code></pre>
|
|
<h3>Semantic locators (alternative to refs)</h3>
|
|
<pre><code class="language-bash">agent-browser find role button click --name "Submit"
|
|
agent-browser find text "Sign In" click
|
|
agent-browser find label "Email" fill "user@test.com"
|
|
agent-browser find first ".item" click
|
|
agent-browser find nth 2 "a" text
|
|
</code></pre>
|
|
<h3>Browser settings</h3>
|
|
<pre><code class="language-bash">agent-browser set viewport 1920 1080 # Set viewport size
|
|
agent-browser set device "iPhone 14" # Emulate device
|
|
agent-browser set geo 37.7749 -122.4194 # Set geolocation
|
|
agent-browser set offline on # Toggle offline mode
|
|
agent-browser set headers '{"X-Key":"v"}' # Extra HTTP headers
|
|
agent-browser set credentials user pass # HTTP basic auth
|
|
agent-browser set media dark # Emulate color scheme
|
|
</code></pre>
|
|
<h3>Cookies & Storage</h3>
|
|
<pre><code class="language-bash">agent-browser cookies # Get all cookies
|
|
agent-browser cookies set name value # Set cookie
|
|
agent-browser cookies clear # Clear cookies
|
|
agent-browser storage local # Get all localStorage
|
|
agent-browser storage local key # Get specific key
|
|
agent-browser storage local set k v # Set value
|
|
agent-browser storage local clear # Clear all
|
|
</code></pre>
|
|
<h3>Network</h3>
|
|
<pre><code class="language-bash">agent-browser network route <url> # Intercept requests
|
|
agent-browser network route <url> --abort # Block requests
|
|
agent-browser network route <url> --body '{}' # Mock response
|
|
agent-browser network unroute [url] # Remove routes
|
|
agent-browser network requests # View tracked requests
|
|
agent-browser network requests --filter api # Filter requests
|
|
</code></pre>
|
|
<h3>Tabs & Windows</h3>
|
|
<pre><code class="language-bash">agent-browser tab # List tabs
|
|
agent-browser tab new [url] # New tab
|
|
agent-browser tab 2 # Switch to tab
|
|
agent-browser tab close # Close tab
|
|
agent-browser window new # New window
|
|
</code></pre>
|
|
<h3>Frames</h3>
|
|
<pre><code class="language-bash">agent-browser frame "#iframe" # Switch to iframe
|
|
agent-browser frame main # Back to main frame
|
|
</code></pre>
|
|
<h3>Dialogs</h3>
|
|
<pre><code class="language-bash">agent-browser dialog accept [text] # Accept dialog
|
|
agent-browser dialog dismiss # Dismiss dialog
|
|
</code></pre>
|
|
<h3>JavaScript</h3>
|
|
<pre><code class="language-bash">agent-browser eval "document.title" # Run JavaScript
|
|
</code></pre>
|
|
<h3>State management</h3>
|
|
<pre><code class="language-bash">agent-browser state save auth.json # Save session state
|
|
agent-browser state load auth.json # Load saved state
|
|
</code></pre>
|
|
<h2>Example: Form submission</h2>
|
|
<pre><code class="language-bash">agent-browser open https://example.com/form
|
|
agent-browser snapshot -i
|
|
# Output shows: textbox "Email" [ref=e1], textbox "Password" [ref=e2], button "Submit" [ref=e3]
|
|
|
|
agent-browser fill @e1 "user@example.com"
|
|
agent-browser fill @e2 "password123"
|
|
agent-browser click @e3
|
|
agent-browser wait --load networkidle
|
|
agent-browser snapshot -i # Check result
|
|
</code></pre>
|
|
<h2>Example: Authentication with saved state</h2>
|
|
<pre><code class="language-bash"># Login once
|
|
agent-browser open https://app.example.com/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 auth.json
|
|
|
|
# Later sessions: load saved state
|
|
agent-browser state load auth.json
|
|
agent-browser open https://app.example.com/dashboard
|
|
</code></pre>
|
|
<h2>Sessions (parallel browsers)</h2>
|
|
<pre><code class="language-bash">agent-browser --session test1 open site-a.com
|
|
agent-browser --session test2 open site-b.com
|
|
agent-browser session list
|
|
</code></pre>
|
|
<h2>JSON output (for parsing)</h2>
|
|
<p>Add <code>--json</code> for machine-readable output:</p>
|
|
<pre><code class="language-bash">agent-browser snapshot -i --json
|
|
agent-browser get text @e1 --json
|
|
</code></pre>
|
|
<h2>Debugging</h2>
|
|
<pre><code class="language-bash">agent-browser open example.com --headed # Show browser window
|
|
agent-browser console # View console messages
|
|
agent-browser console --clear # Clear console
|
|
agent-browser errors # View page errors
|
|
agent-browser errors --clear # Clear errors
|
|
agent-browser highlight @e1 # Highlight element
|
|
agent-browser trace start # Start recording trace
|
|
agent-browser trace stop trace.zip # Stop and save trace
|
|
agent-browser record start ./debug.webm # Record from current page
|
|
agent-browser record stop # Save recording
|
|
agent-browser --cdp 9222 snapshot # Connect via CDP
|
|
</code></pre>
|
|
<h2>Troubleshooting</h2>
|
|
<ul>
|
|
<li>If the command is not found on Linux ARM64, use the full path in the bin folder.</li>
|
|
<li>If an element is not found, use snapshot to find the correct ref.</li>
|
|
<li>If the page is not loaded, add a wait command after navigation.</li>
|
|
<li>Use --headed to see the browser window for debugging.</li>
|
|
</ul>
|
|
<h2>Options</h2>
|
|
<ul>
|
|
<li>--session <name> uses an isolated session.</li>
|
|
<li>--json provides JSON output.</li>
|
|
<li>--full takes a full page screenshot.</li>
|
|
<li>--headed shows the browser window.</li>
|
|
<li>--timeout sets the command timeout in milliseconds.</li>
|
|
<li>--cdp <port> connects via Chrome DevTools Protocol.</li>
|
|
</ul>
|
|
<h2>Notes</h2>
|
|
<ul>
|
|
<li>Refs are stable per page load but change on navigation.</li>
|
|
<li>Always snapshot after navigation to get new refs.</li>
|
|
<li>Use fill instead of type for input fields to ensure existing text is cleared.</li>
|
|
</ul>
|
|
<h2>Reporting Issues</h2>
|
|
<ul>
|
|
<li>Skill issues: Open an issue at <a href="https://github.com/TheSethRose/Agent-Browser-CLI">https://github.com/TheSethRose/Agent-Browser-CLI</a></li>
|
|
<li>agent-browser CLI issues: Open an issue at <a href="https://github.com/vercel-labs/agent-browser">https://github.com/vercel-labs/agent-browser</a></li>
|
|
</ul></div></div><div class="file-browser"><div class="file-list"><div class="file-list-header"><h3 class="section-title" style="font-size: 1.05rem; margin: 0px;">Files</h3><span class="section-subtitle" style="margin: 0px;">2 total</span></div><div class="file-list-body"><button class="file-row file-row-button" type="button"><span class="file-path">CONTRIBUTING.md</span><span class="file-meta">1.6 KB</span></button><button class="file-row file-row-button" type="button"><span class="file-path">SKILL.md</span><span class="file-meta">10.0 KB</span></button></div></div><div class="file-viewer"><div class="file-viewer-header"><div class="file-path">Select a file</div></div><div class="file-viewer-body"><div class="stat">Select a file to preview.</div></div></div></div></div></div><div class="card"><h2 class="section-title" style="font-size: 1.2rem; margin: 0px;">Comments</h2><p class="section-subtitle">Sign in to comment.</p><div style="display: grid; gap: 12px; margin-top: 16px;"><div class="comment-item"><div class="comment-body"><strong>@bardusco</strong><div class="comment-body-text">Screenshots of web pages → ClawShot feed. Agents could share what they're browsing. Interesting possibilities here.
|
|
|
|
clawshot.ai 🦞</div></div></div></div></div></div></main><script></script><footer class="site-footer"><div class="site-footer-inner"><div class="site-footer-divider" aria-hidden="true"></div><div class="site-footer-row"><div class="site-footer-copy">ClawHub · An <a href="https://openclaw.ai" target="_blank" rel="noreferrer">OpenClaw</a> project · Deployed on <a href="https://vercel.com" target="_blank" rel="noreferrer">Vercel</a> · Powered by <a href="https://www.convex.dev" target="_blank" rel="noreferrer">Convex</a> · <a href="https://github.com/openclaw/clawhub" target="_blank" rel="noreferrer">Open source (MIT)</a> · <a href="https://steipete.me" target="_blank" rel="noreferrer">Peter Steinberger</a>.</div></div></div></footer></div><script type="module" async=""></script></body></html>
|