| name | webctl |
| description | Browser automation via CLI. Use when browsing websites, filling forms, extracting data from web pages, taking screenshots, or automating web interactions. Preferred over MCP browser tools for better context control. |
| allowed-tools | Bash(webctl *), Bash(webctl), Bash(pip install *), Read |
webctl - Browser Automation CLI
Setup
If webctl is not installed, run: pip install webctl && webctl setup
Workflow
webctl navigate "https://example.com"
webctl click @e3
webctl type "Email" "user@example.com"
webctl stop
Choosing the Right Approach
| Goal | Command |
|---|
| Browse / interact with a page | navigate URL — returns structured data + page summary (add --snapshot for full a11y with @refs) |
| Read article content | navigate URL --read — returns readable markdown |
| Search a website | navigate URL --search "query" — types query + returns results |
| Filter specific elements | navigate URL --grep "€|price" — filtered a11y snapshot |
Commands (10 total)
navigate - Go to URL
webctl navigate "https://example.com"
webctl navigate "https://example.com" --snapshot
webctl navigate "https://example.com" --grep "€|price"
webctl navigate "https://example.com" --read
webctl navigate "https://duckduckgo.com" --search "query"
The default returns structured data (JSON-LD, Open Graph — price, rating, etc.) plus a page summary. Add --snapshot for the full a11y snapshot with @refs for interaction.
snapshot - Re-scan current page
webctl snapshot
webctl snapshot --interactive-only
webctl snapshot --read
webctl snapshot --count
webctl snapshot --grep "pattern"
webctl snapshot --within "role=main"
click - Click an element
webctl click @e3
webctl click "Submit"
webctl click 'role=button name~="Submit"'
webctl click "Submit" --snapshot
webctl click "Next" --snapshot --grep "result"
type - Type text (auto-detects dropdowns and checkboxes)
webctl type @e2 "user@example.com"
webctl type "Email" "user@test.com"
webctl type "Country" "Germany"
webctl type "Search" "query" --submit
webctl type "Email" "x" --snapshot
do - Batch multiple actions in one call
webctl do '[["type","Email","user@test.com"],["type","Password","secret"],["click","Log in"]]' --snapshot
Actions: click, type, press, wait. Stops on first failure.
press - Keyboard key
webctl press Enter
webctl press Escape
webctl press Tab
wait - Wait for condition
webctl wait stable
webctl wait network-idle
webctl wait 'exists:role=button name~="Continue"'
webctl wait 'url-contains:"/dashboard"'
webctl wait 'hidden:role=dialog'
save - Save session state
webctl save
webctl save my-auth
stop - Close everything
webctl stop
webctl stop --keep-daemon
start - Explicit session start (usually not needed)
webctl start
webctl start --mode unattended
webctl navigate URL --mode attended
Target Syntax
Actions (click, type) accept three target formats:
| Format | Example | When to use |
|---|
| @ref | @e3 | After a snapshot (fastest, most reliable) |
| Text | "Submit" | When you know the element text |
| Query | 'role=button name~="Submit"' | When text is ambiguous |
@refs are assigned by snapshot and navigate --snapshot/--search/--grep. They reset on each snapshot.
Text descriptions are fuzzy-matched against interactive elements. webctl prefers the right role for the action (click prefers buttons/links, type prefers textboxes).
Query syntax is the fallback: role=X name~="Y" (use name~= for contains, name= for exact).
Automatic Fallbacks
These happen transparently — you don't need to handle them:
- Cookie/popup auto-dismiss: Overlays are dismissed before actions
- Scroll-to-find: If element not found, scrolls down and retries (2x)
- Click retry on overlay: If click intercepted by overlay, dismisses and retries
- Smart type:
type on combobox auto-uses select_option; on checkbox auto-uses check/uncheck
Common Patterns
Price Lookup (e-commerce)
webctl navigate "https://amazon.de/dp/B09HM94VDS"
webctl stop
Read Article
webctl navigate "https://spiegel.de" --read
webctl stop
Search and Extract
webctl navigate "https://duckduckgo.com" --search "query"
webctl stop
Login
webctl navigate "https://example.com/login"
webctl do '[["type","Email","user@example.com"],["type","Password","secret"],["click","Log in"]]' --snapshot
webctl wait 'url-contains:"/dashboard"'
webctl stop
Form with Dropdown
webctl navigate "https://example.com/form"
webctl do '[["type","Name","John"],["type","Email","john@test.com"],["type","Country","Germany"],["click","Submit"]]' --snapshot
webctl stop
Find Specific Data on Complex Pages
webctl navigate "https://example.com" --grep "€|price|shipping"
webctl stop
Human-In-The-Loop
For CAPTCHA, MFA, or manual steps (requires visible browser — don't use --mode unattended):
webctl start
webctl navigate "https://example.com/login"
webctl type "Email" "user@example.com" --submit
webctl prompt-secret --prompt "Enter MFA code:"
webctl wait 'url-contains:"/dashboard"'
webctl stop