| name | tab-agent |
| description | Browser control via CLI - snapshot, click, type, navigate, find, get, drag, pdf |
Tab Agent
Control browser tabs via CLI. User activates tabs via extension icon (green = active).
Before First Command
curl -s http://localhost:9876/health || (npx tab-agent start &)
sleep 2
Commands
npx tab-agent snapshot
npx tab-agent click <ref>
npx tab-agent type <ref> <text>
npx tab-agent fill <ref> <value>
npx tab-agent press <key>
npx tab-agent scroll <dir> [amount]
npx tab-agent navigate <url>
npx tab-agent tabs
npx tab-agent wait <text|selector>
npx tab-agent wait --url <pattern>
npx tab-agent wait --visible <ref>
npx tab-agent screenshot
npx tab-agent evaluate <script>
npx tab-agent hover <ref>
npx tab-agent select <ref> <value>
npx tab-agent drag <from> <to>
npx tab-agent get text <ref>
npx tab-agent get value <ref>
npx tab-agent get attr <ref> <name>
npx tab-agent get url
npx tab-agent get title
npx tab-agent find text "Submit"
npx tab-agent find role button
npx tab-agent find label "Email"
npx tab-agent find placeholder "Search"
npx tab-agent cookies get
npx tab-agent cookies clear
npx tab-agent storage get [key]
npx tab-agent storage set <key> <val>
npx tab-agent pdf [file.pdf]
Workflow
snapshot first - always start here to get element refs
- Use refs [e1], [e2]... with
click/type/fill
snapshot again after actions to see results
- Use
find to locate elements without a full snapshot
- Use
get to extract specific data from elements
- Only use
screenshot if:
- Snapshot is missing expected content
- Page has complex visuals (charts, images, canvas)
- Debugging why an action didn't work
Examples
npx tab-agent navigate "https://google.com"
npx tab-agent snapshot
npx tab-agent type e1 "hello world"
npx tab-agent press Enter
npx tab-agent snapshot
npx tab-agent find text "Sign In"
npx tab-agent click e1
npx tab-agent get text e5
npx tab-agent get attr e3 href
npx tab-agent pdf report.pdf
Notes
- Refs reset on each snapshot - always snapshot before interacting
find assigns new refs without resetting existing ones
- Keys: Enter, Escape, Tab, Backspace, ArrowUp/Down/Left/Right
- Prefer snapshot over screenshot - faster and text-based
- Use
--browser=safari or --browser=chrome to target specific browser