| name | surf-cli |
| description | Control a Chrome browser with surf-cli. Use when the user asks to use Surf or an existing Surf browser session. |
Surf CLI - Browser Automation for AI Agents
Skill for using surf-cli to control Chrome browsers. This tool enables browser automation through simple CLI commands over Unix sockets.
IMPORTANT: Always use npx surf instead of a globally installed surf command.
Prerequisites
- Chrome must be running with the Surf extension loaded
- First run
npx surf to verify connection to browser
Core Commands
Navigation
npx surf go "https://example.com"
npx surf back
npx surf forward
npx surf tab.reload
Reading Page Content
npx surf read
npx surf page.text
npx surf page.state
Screenshots
npx surf screenshot
npx surf screenshot --full
npx surf snap
Interaction
npx surf click "button.submit"
npx surf click "Sign In"
npx surf type "hello world"
npx surf type "hello world" --selector "input[name=email]"
npx surf key "Enter"
npx surf key "Tab"
npx surf key "Escape"
npx surf scroll down
npx surf scroll up
npx surf scroll "selector"
Tab Management
npx surf tab.list
npx surf tab.new "https://example.com"
npx surf tab.switch 2
npx surf tab.switch "Gmail"
npx surf tab.close
npx surf tab.name "My Tab"
AI Service Integration
Use the browser's logged-in sessions to interact with AI services:
npx surf chatgpt "Explain quantum computing"
npx surf gemini "Write a haiku about coding"
npx surf perplexity "Latest news on AI"
Common Workflows
Form Filling
npx surf go "https://example.com/login"
npx surf click "input[name=email]"
npx surf type "user@example.com"
npx surf key "Tab"
npx surf type "password123"
npx surf click "button[type=submit]"
npx surf screenshot
Web Scraping/Reading
npx surf go "https://example.com/article"
npx surf read
npx surf screenshot
Multi-Tab Workflow
npx surf tab.new "https://docs.example.com"
npx surf tab.name "Docs"
npx surf tab.new "https://github.com/repo"
npx surf tab.name "GitHub"
npx surf tab.switch "Docs"
npx surf read
npx surf tab.switch "GitHub"
npx surf read
Smart Defaults
- Screenshots auto-resize to 1200px to conserve tokens
- Actions automatically capture screenshots (reduces round-trips)
- Network requests are logged automatically
Troubleshooting
npx surf
Tips
- Use
npx surf read to understand page structure before clicking
- Use
npx surf snap to see annotated elements when unsure what to click
- Name tabs with
npx surf tab.name for easier management in multi-tab workflows
- Actions return screenshots automatically - check results after each interaction