Loading...
Loading...
Web browser automation with AI-optimized snapshots for claude-flow agents
npx skill4agent add ruvnet/ruflo browser# 1. Navigate to page
agent-browser open <url>
# 2. Get accessibility tree with element refs
agent-browser snapshot -i # -i = interactive elements only
# 3. Interact using refs from snapshot
agent-browser click @e2
agent-browser fill @e3 "text"
# 4. Re-snapshot after page changes
agent-browser snapshot -i| Command | Description |
|---|---|
| Navigate to URL |
| Go back |
| Go forward |
| Reload page |
| Close browser |
| Command | Description |
|---|---|
| Full accessibility tree |
| Interactive elements only (buttons, links, inputs) |
| Compact (remove empty elements) |
| Limit depth to 3 levels |
| Capture screenshot (base64 if no path) |
| Command | Description |
|---|---|
| Click element |
| Clear and fill input |
| Type with key events |
| Press key (Enter, Tab, etc.) |
| Hover element |
| Select dropdown option |
| Toggle checkbox |
| Scroll page |
| Command | Description |
|---|---|
| Get text content |
| Get innerHTML |
| Get input value |
| Get attribute |
| Get page title |
| Get current URL |
| Command | Description |
|---|---|
| Wait for element |
| Wait milliseconds |
| Wait for text |
| Wait for URL |
| Wait for load state |
| Command | Description |
|---|---|
| Use isolated session |
| List active sessions |
# Get refs from snapshot
agent-browser snapshot -i
# Output: button "Submit" [ref=e2]
# Use ref to interact
agent-browser click @e2agent-browser click "#submit"
agent-browser fill ".email-input" "test@test.com"agent-browser find role button click --name "Submit"
agent-browser find label "Email" fill "test@test.com"
agent-browser find testid "login-btn" clickagent-browser open https://example.com/login
agent-browser snapshot -i
agent-browser fill @e2 "user@example.com"
agent-browser fill @e3 "password123"
agent-browser click @e4
agent-browser wait --url "**/dashboard"agent-browser open https://example.com/contact
agent-browser snapshot -i
agent-browser fill @e1 "John Doe"
agent-browser fill @e2 "john@example.com"
agent-browser fill @e3 "Hello, this is my message"
agent-browser click @e4
agent-browser wait --text "Thank you"agent-browser open https://example.com/products
agent-browser snapshot -i
# Iterate through product refs
agent-browser get text @e1 # Product name
agent-browser get text @e2 # Price
agent-browser get attr @e3 href # Link# Session 1: Navigator
agent-browser --session nav open https://example.com
agent-browser --session nav state save auth.json
# Session 2: Scraper (uses same auth)
agent-browser --session scrape state load auth.json
agent-browser --session scrape open https://example.com/data
agent-browser --session scrape snapshot -ibrowser/browser/openbrowser/snapshotbrowser/clickbrowser/fillbrowser/screenshot# Store successful patterns
npx @claude-flow/cli memory store --namespace browser-patterns --key "login-flow" --value "snapshot->fill->click->wait"
# Retrieve before similar task
npx @claude-flow/cli memory search --query "login automation"# Pre-browse hook (get context)
npx @claude-flow/cli hooks pre-edit --file "browser-task.ts"
# Post-browse hook (record success)
npx @claude-flow/cli hooks post-task --task-id "browse-1" --success true-i