rtrvr CLI & SDK
One CLI, three execution modes. Browser automation for AI agents and humans — across cloud, local browser extension, or auto-routed.
Cloud Mode
Run agents and scrape via rtrvr's managed cloud browsers.
Extension Mode
Route to your local browser extension for authenticated sessions.
Auto Mode
Smart routing with automatic fallback between cloud and extension.
CLI (global)
npm install -g @rtrvr-ai/cliProgrammatic API
curl https://api.rtrvr.ai/agentThe CLI provides the rtrvr command. Programmatic callers can use the HTTP API directly.
rtrvr auth loginrtrvr run "Extract the top 10 products and prices" --url https://example.com# Scrape a page
rtrvr scrape --url https://example.com
# Check your capabilities
rtrvr capabilities
# Run diagnostics
rtrvr doctorEvery command supports three execution targets. Use --target or the shortcut flags.
Cloud
--cloudManaged browsers via api.rtrvr.ai. No local setup needed. Best for scraping, data extraction, and tasks that don't require your login sessions.
Extension
--extensionRoute to your local browser via the rtrvr Chrome extension. Use for authenticated sessions (logged-in sites) and tasks that need your cookies/sessions.
Auto (default)
--target autoSmart routing — checks if extension devices are online, tries extension first, falls back to cloud automatically. This is the default behavior.
Auto mode routing flow
The response includes routing metadata showing which mode was selected and whether fallback was applied:
{
"metadata": {
"selectedMode": "cloud",
"fallbackApplied": true,
"fallbackReason": "no extension devices online"
}
}# Positional input
rtrvr run "Find the latest pricing for each plan" --url https://example.com
# From file
rtrvr run --input-file ./task.txt --url https://example.com --target cloud
# From stdin
echo "Summarize this page" | rtrvr run --url https://example.com<input>Task description (positional argument)
--input <text>Task description (flag alternative)
--input-file <path>Read task description from a file
--url <url>Target URL(s) for the agent
--target <mode>default: autoRouting mode: auto, cloud, or extension
--cloudShortcut for --target cloud
--extensionShortcut for --target extension
--device-id <id>Target a specific browser extension device
--schema-file <path>JSON schema file for structured output
--jsonMachine-readable JSON output
--no-streamDisable real-time progress streaming
Use the authenticated HTTP API directly for programmatic cloud runs.
Create a Run
curl -X POST https://api.rtrvr.ai/agent \
-H "Authorization: Bearer $RTRVR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "Find latest headline and author",
"urls": ["https://example.com"],
"target": "auto"
}'Client Options
apiKeyYour rtrvr API key (rtrvr_...)
defaultTargetdefault: autoDefault routing mode
baseUrldefault: https://api.rtrvr.aiOverride the API base URL
mcpUrldefault: https://mcp.rtrvr.aiOverride the MCP base URL
Unified Run
{
"input": "Find latest headline and author",
"urls": ["https://example.com"],
"target": "auto"
}Direct Tool Calls
rtrvr raw extract_from_tab --user_input "Extract all product names and prices" --tab_urls '["https://example.com/products"]'
rtrvr raw act_on_tab --user_input "Click the Sign Up button" --tab_urls '["https://example.com"]'
rtrvr raw crawl_and_extract_from_tab --user_input "Find all blog post titles" --tab_urls '["https://example.com/blog"]'Scrape
rtrvr scrape https://example.comUtilities
rtrvr devices
rtrvr credits
rtrvr profile