| name | agent-electrobun |
| description | CDP controller for Electrobun apps with multi-tab OOPIF architecture. Use when asked to interact with, test, screenshot, click, fill, or automate an Electrobun desktop app. Triggers on: interact with app, click button, test UI, screenshot app, inspect element, automate Electrobun, take screenshot, fill form, test this app, dogfood, QA the app. |
| allowed-tools | Bash(agent-electrobun:*), Bash(bun run ctl:*), Bash(bun scripts/agent-electrobun.ts:*) |
Electrobun App Automation with agent-electrobun
CDP (Chrome DevTools Protocol) controller for Electrobun apps that use multi-tab OOPIF architecture. Unlike agent-browser, this tool attaches to existing CDP targets — it never creates pages or navigates away, preserving the OOPIF lifecycle.
Prerequisites
The Electrobun app must be running with CDP enabled:
QUIVER_DEBUG=1 env var set (enables --remote-debugging-port=9222)
- Dev mode:
bun run dev:electrobun in the app directory
Architecture
Electrobun app
├── Shell webview (mainview) — tab bar, managed by shellRpc
│ └── window.__quiverAutomation — automation bridge (dev only)
└── Tab OOPIFs (tabview) — one OS process per tab, all app content
└── Each at tabview/index.html?tabId=tab-N
CDP targets are discovered via GET http://localhost:9222/json/list. Shell is identified by /mainview/ in URL, tabs by /tabview/.
Core Workflow
Every interaction follows this pattern:
- Discover:
agent-electrobun list or agent-electrobun tabs
- Snapshot:
agent-electrobun snapshot -i (get element refs like @e1, @e2)
- Interact: Use refs to click, fill, type
- Re-snapshot: After UI changes, get fresh refs
agent-electrobun tabs
agent-electrobun snapshot -i
agent-electrobun fill @e2 "/path/to/my/repo"
agent-electrobun snapshot -i
agent-electrobun click @e3
agent-electrobun wait 2000
agent-electrobun snapshot -i
Target Selection
By default, commands target the active tab. Override with --target:
agent-electrobun --target shell snapshot -i
agent-electrobun --target tab-1 snapshot -i
agent-electrobun --target tab-2 screenshot
agent-electrobun snapshot -i
The shell automation bridge (window.__quiverAutomation) is used to discover the active tab. Commands like tabs, new-tab, and shell eval always target the shell implicitly.
Essential Commands
agent-electrobun list
agent-electrobun tabs
agent-electrobun snapshot -i
agent-electrobun snapshot
agent-electrobun snapshot -i -C
agent-electrobun snapshot -c
agent-electrobun snapshot -d 3
agent-electrobun snapshot -s "#main"
agent-electrobun snapshot @e1
agent-electrobun click @e1
agent-electrobun dblclick @e1
agent-electrobun focus @e1
agent-electrobun hover @e1
agent-electrobun fill @e2 "text"
agent-electrobun type "text"
agent-electrobun press Enter
agent-electrobun press Control+a
agent-electrobun check @e1
agent-electrobun uncheck @e1
agent-electrobun select @e1 "value"
agent-electrobun scroll down 500
agent-electrobun scroll up
agent-electrobun scrollintoview @e1
agent-electrobun drag @e1 @e2
agent-electrobun mouse move 100 200
agent-electrobun mouse down left
agent-electrobun mouse up left
agent-electrobun mouse wheel 100
agent-electrobun keyboard type "text"
agent-electrobun keyboard inserttext "text"
agent-electrobun keydown Shift
agent-electrobun keyup Shift
agent-electrobun get text @e1
agent-electrobun get html @e1
agent-electrobun get value @e1
agent-electrobun get attr @e1 placeholder
agent-electrobun get url
agent-electrobun get title
agent-electrobun get count ".selector"
agent-electrobun get box @e1
agent-electrobun get styles @e1
agent-electrobun is visible @e1
agent-electrobun is enabled @e1
agent-electrobun is checked @e1
agent-electrobun wait 2000
agent-electrobun wait "#my-element"
agent-electrobun wait --text "Sign in"
agent-electrobun wait --fn "window.loaded"
agent-electrobun wait --url "**/dashboard"
agent-electrobun wait @e1
agent-electrobun screenshot
agent-electrobun screenshot /tmp/my.png
agent-electrobun screenshot --annotate
agent-electrobun screenshot --full
agent-electrobun diff snapshot
agent-electrobun highlight @e1
agent-electrobun console
agent-electrobun console --clear
agent-electrobun errors
agent-electrobun errors --clear
agent-electrobun dialog accept
agent-electrobun dialog accept "yes"
agent-electrobun dialog dismiss
agent-electrobun find text "Sign In" click
agent-electrobun find label "Email" fill "user@test.com"
agent-electrobun find role button click
agent-electrobun find placeholder "Search" fill "query"
agent-electrobun find testid "submit-btn" click
agent-electrobun find alt "Logo" click
agent-electrobun find title "Close" click
agent-electrobun eval 'document.title'
agent-electrobun eval -b "<base64>"
agent-electrobun eval --stdin
agent-electrobun shell eval 'document.title'
agent-electrobun new-tab
agent-electrobun open-repo /path/to/repo
agent-electrobun tab switch tab-2
agent-electrobun tab close tab-2
agent-electrobun open-repo /path/to/repo tab-2
Command Chaining
Commands can be chained with && in a single shell invocation:
agent-electrobun fill @e2 "/path/to/repo" && agent-electrobun click @e3
agent-electrobun wait 2000 && agent-electrobun screenshot /tmp/result.png
agent-electrobun new-tab && agent-electrobun wait 1000 && agent-electrobun snapshot -i
When to chain: Use && when you don't need to read intermediate output. Run separately when you need to parse snapshot output to get refs before interacting.
Ref System
Refs (@e1, @e2, …) are assigned during snapshot -i and map to accessibility tree nodes via backendDOMNodeId. They are persisted to /tmp/agent-electrobun-refs.json so they survive between CLI invocations.
Ref Lifecycle (Important)
Refs are invalidated when the DOM changes. Always re-snapshot after:
- Clicking buttons that change the view
- Filling inputs that trigger UI updates
- Opening repos or switching tabs
- Any navigation or dynamic content loading
agent-electrobun click @e3
agent-electrobun wait 2000
agent-electrobun snapshot -i
agent-electrobun click @e1
Per-Target Ref Isolation
Refs are stored per-target (shell, tab:tab-1, tab:tab-2), so switching --target doesn't invalidate other targets' refs.
Annotated Screenshots (Vision Mode)
Use --annotate to take a screenshot with numbered red labels overlaid on interactive elements. Each label [N] maps to ref @eN. This also refreshes refs.
agent-electrobun screenshot --annotate
agent-electrobun click @e2
Use annotated screenshots when:
- You need to verify visual layout
- The page has unlabeled icon buttons
- You need spatial reasoning about element positions
Diffing (Verifying Changes)
Use diff snapshot after performing an action to verify it had the intended effect. Compares the current accessibility tree against the last snapshot -i.
agent-electrobun snapshot -i
agent-electrobun click @e2
agent-electrobun diff snapshot
Common Patterns
Open a Repository
agent-electrobun snapshot -i
agent-electrobun fill @e2 "/path/to/repo"
agent-electrobun snapshot -i
agent-electrobun click @e3
agent-electrobun wait 3000
agent-electrobun snapshot -i
Multi-Tab Workflow
agent-electrobun tabs
agent-electrobun new-tab
agent-electrobun --target tab-2 snapshot -i
agent-electrobun --target tab-2 fill @e2 "/other/repo"
agent-electrobun --target tab-2 click @e3
agent-electrobun --target tab-1 screenshot /tmp/tab1.png
agent-electrobun --target tab-2 screenshot /tmp/tab2.png
Inspect Shell Tab Bar
agent-electrobun --target shell snapshot -i
agent-electrobun --target shell click @e2
Form Interaction
agent-electrobun snapshot -i
agent-electrobun fill @e2 "user@example.com"
agent-electrobun fill @e3 "password"
agent-electrobun check @e4
agent-electrobun select @e5 "admin"
agent-electrobun click @e6
agent-electrobun wait --text "Welcome"
agent-electrobun snapshot -i
Keyboard Navigation
agent-electrobun press Tab
agent-electrobun press Tab
agent-electrobun press Enter
agent-electrobun press Control+a
agent-electrobun press Escape
agent-electrobun press ArrowDown
State Verification
agent-electrobun is visible @e1
agent-electrobun is enabled @e3
agent-electrobun is checked @e4
agent-electrobun get value @e2
agent-electrobun get text @e1
agent-electrobun get styles @e1
agent-electrobun get box @e1
Data Extraction
agent-electrobun snapshot -i
agent-electrobun get text @e13
agent-electrobun get html @e5
agent-electrobun get attr @e1 href
agent-electrobun get count ".file-item"
agent-electrobun eval 'document.querySelectorAll("[data-testid]").length'
Low-Level Mouse Control
agent-electrobun mouse move 100 200
agent-electrobun mouse down left
agent-electrobun mouse move 300 200
agent-electrobun mouse up left
agent-electrobun mouse wheel -200
Drag and Drop
agent-electrobun snapshot -i
agent-electrobun drag @e3 @e7
agent-electrobun wait 1000
agent-electrobun snapshot -i
Semantic Locators (No Snapshot Needed)
agent-electrobun find text "Sign In" click
agent-electrobun find placeholder "Email" fill "user@example.com"
agent-electrobun find placeholder "Password" fill "secret"
agent-electrobun find testid "submit" click
agent-electrobun wait --text "Welcome"
Dialog Handling
agent-electrobun click @e5
agent-electrobun dialog accept
agent-electrobun snapshot -i
Console Debugging
agent-electrobun console
agent-electrobun errors
agent-electrobun console --clear
Timeouts and Slow UI
The default wait timeout is 10 seconds. Use explicit waits for slow operations:
agent-electrobun wait 3000
agent-electrobun wait "#content"
agent-electrobun wait --text "Loaded"
agent-electrobun wait --fn "window.ready"
Deep-Dive Documentation