Desktop App Control (agent-browser)
Control Electron desktop apps and Chrome browsers using agent-browser by Vercel Labs. Uses accessibility snapshots with ref-based interaction for 82-96% token savings.
Quick Start
# Scan for controllable apps
bash execute.sh scan
# Launch an app with CDP enabled
bash execute.sh launch --app 'Slack' --port 9222
# Connect to a running app
bash execute.sh connect --port 9222
# Take accessibility snapshot (shows refs like @e1, @e2)
bash execute.sh snapshot
# Interactive elements only (recommended for AI)
bash execute.sh snapshot --interactive
# Click an element by ref
bash execute.sh click --ref @e5
# Type text into a field
bash execute.sh fill --ref @e3 --text 'Hello World'
# Press a key
bash execute.sh press --key Enter
# Take screenshot
bash execute.sh screenshot --output /tmp/app.png
# Get text content of element
bash execute.sh get-text --ref @e1
# Scroll
bash execute.sh scroll --direction down
# List tabs/windows
bash execute.sh tabs
# Switch to a tab
bash execute.sh tab --index 2
# Disconnect
bash execute.sh close
# Check agent-browser status and version
bash execute.sh status
Architecture
agent-browser (Vercel Labs)
├── Rust CLI — Fast command parsing
├── Node.js Daemon — Playwright browser lifecycle
└── CDP Connection — Chrome DevTools Protocol
Snapshot + Refs Workflow:
snapshotreturns accessibility tree with[ref=e1]markers- Use
@e1to interact:click @e1,fill @e3 "text",get text @e1 - Re-snapshot after actions to get updated refs
Controllable Apps
Electron Apps (launch with --remote-debugging-port):
- VS Code, Slack, Discord, Notion, Figma, Spotify, Postman, MongoDB Compass, Termius, etc.
Chrome-based Browsers:
- Google Chrome, Brave, Microsoft Edge, Chromium, Arc
Any Electron App — if it's built on Electron, it can be controlled.
Multi-App Control
Use sessions to control multiple apps simultaneously:
bash execute.sh launch --app 'Slack' --port 9222 --session slack
bash execute.sh launch --app 'Visual Studio Code' --port 9223 --session vscode
bash execute.sh snapshot --session slack --interactive
bash execute.sh snapshot --session vscode --interactive
Safety Rules
- NEVER close or kill apps without explicit user permission
- NEVER interact with password fields or sensitive data
- Always snapshot BEFORE and AFTER any action for verification
- All actions logged to
~/.crewly/logs/desktop-app-control.log - Only connect to locally running apps (127.0.0.1)
Requirements
agent-browser(npm install -g agent-browser && agent-browser install)- macOS / Linux / Windows
- Target apps must be relaunched with
--remote-debugging-portflag
Which control surface to use
Crewly has three ways to act on a screen. Pick the lowest one that can do
the job — each step down costs more tokens, breaks more easily, and disturbs
the user more.
| Need | Use | Why |
|---|---|---|
| Anything a Crewly skill or connector already does (mail, Drive, Slack, calendar, git, files) | that skill | No screen at all. Fastest and cannot misclick. |
| Content of a web page, or acting as the signed-in user in Chrome | remote-browser | Real Chrome, real session, per-agent bound tab, and the user sees a takeover banner. |
| An Electron app (VS Code, Slack, Notion, Figma) | desktop-app-control | Accessibility snapshot with element refs — no coordinates. Needs the app started with a debug port. |
| Native macOS apps, system dialogs, anything the above cannot reach | computer-use | Last resort: screen coordinates and pixels. Slowest and most fragile. |
computer-use refuses destructive key combos, typing into password fields and
driving credential apps, holds a machine-wide lock while it works, and logs
every action to ~/.crewly/desktop-actions.jsonl. Run
{"action":"check-permissions"} first — without Screen Recording and
Accessibility every action fails, and the refusal tells you what to grant.