| name | docyrus-browser-cli |
| description | Use Docyrus CLI browser commands for browser automation (local Chrome or remote Cloudflare Browser Rendering). Use when you need to start a browser session, navigate pages, inspect page state, interact with elements, capture screenshots, evaluate JavaScript, read console output, inspect network requests, or run CDP scripts. |
Docyrus Browser CLI
Browser automation via a persistent daemon that holds a raw CDP (Chrome DevTools Protocol) WebSocket connection. No Puppeteer/Playwright framework — direct CDP for speed and flexibility.
Works in both local mode (Chrome on :9222) and remote sandbox mode (Cloudflare Browser Rendering).
Architecture
docyrus browser <command>
→ tool script (Node.js)
→ HTTP request to daemon (localhost:9333)
→ raw CDP WebSocket to Chrome/Cloudflare
The daemon starts automatically on the first command and stays alive for 5 minutes of idle time. All commands share the same browser connection — no reconnection overhead.
Core Workflow for Self-Testing
docyrus browser start
docyrus browser nav https://preview-url.example.com
docyrus browser wait --idle
docyrus browser snapshot
docyrus browser fill @e2 "user@example.com"
docyrus browser click @e3
docyrus browser wait --selector ".success-message"
docyrus browser screenshot
docyrus browser console --level error
docyrus browser network --method POST --status 2xx
Commands
Session Management
docyrus browser start
docyrus browser start --profile
docyrus browser close
Navigation
docyrus browser nav <url>
docyrus browser nav <url> --new
docyrus browser nav <url> --reload
Waiting
docyrus browser wait --idle
docyrus browser wait --selector "h1"
docyrus browser wait --url "**/dashboard"
docyrus browser wait 2000
docyrus browser wait --idle --timeout 30000
Page Snapshot (Element Discovery)
docyrus browser snapshot
docyrus browser snapshot --all
docyrus browser snapshot --selector "#app"
Returns:
{
"snapshot": [
{ "ref": "@e1", "tag": "input", "type": "email", "placeholder": "Email" },
{ "ref": "@e2", "tag": "input", "type": "password" },
{ "ref": "@e3", "tag": "button", "text": "Sign In" }
]
}
Element Interaction
Three targeting modes — refs, CSS selectors, or x,y coordinates:
docyrus browser click @e3
docyrus browser click "button.submit"
docyrus browser click 350 200
docyrus browser fill @e1 "user@test.com"
docyrus browser select @e4 "Option A"
Coordinate clicks pass through iframes, shadow DOM, and cross-origin frames at the compositor level — no DOM piercing needed. Use info for viewport dimensions.
JavaScript Evaluation
docyrus browser eval 'document.title'
docyrus browser eval 'const rows = document.querySelectorAll("tr"); return rows.length'
docyrus browser eval 'await fetch("/api/health").then(r => r.json())'
Supports expressions and multi-statement code. Uses CDP Runtime.evaluate with awaitPromise: true.
Screenshots
docyrus browser screenshot
docyrus browser screenshot --full
docyrus browser screenshot --base64
Console Messages
docyrus browser console
docyrus browser console --level error
docyrus browser console --listen 5000
Run console once early to install the interceptor.
Network Inspection
docyrus browser network
docyrus browser network --method POST
docyrus browser network --status 4xx
docyrus browser network --url "/api/"
docyrus browser network --listen 5000
Network events are captured automatically by the daemon (CDP Network.enable).
Docyrus Devtools
Read runtime diagnostics from @docyrus/devtools (must be loaded on the page):
docyrus browser devtools state
docyrus browser devtools errors
docyrus browser devtools issues
docyrus browser devtools console
docyrus browser devtools console --level error
Use after interacting with a Docyrus-backed app to catch API misuse, failed requests, and runtime issues that console --level error alone would miss.
Content Extraction
docyrus browser content <url>
Cookies
docyrus browser cookies
docyrus browser cookies --name "session"
docyrus browser cookies --domain ".app.com"
Page Info
docyrus browser info
Tab Management
docyrus browser tabs
docyrus browser tabs --switch 1
CDP Scripts
docyrus browser run-script script.js
The script receives raw CDP helpers: cdp, evaluate, navigate, captureScreenshot, clickAt, typeText, pressKey, pageInfo, drainEvents, waitForCondition.
Tips for AI Agents
start auto-launches the daemon — subsequent commands are fast (no reconnection)
- Always
wait --idle after nav before taking snapshots or screenshots
- Use
snapshot → refs → click/fill for reliable element targeting
- Re-snapshot after interactions to get fresh refs
- Use coordinate
click 350 200 for elements inside iframes or shadow DOM
- Check
console --level error and network --status 5xx to catch runtime issues
- Use
screenshot --base64 in remote/sandbox mode
close stops the daemon; it auto-stops after 5 minutes idle anyway