ConnectOnionConnectOnion
DocsCLIco browser

co browser

Quick browser screenshots and automation with one command. Perfect for debugging, testing, and visual proof.

Quick Start: co browser "screenshot localhost:3000" - instant screenshot, no code required.

Basic Usage

code
1co browser "screenshot localhost:3000"
Python REPL
Interactive
[browser] Taking screenshot of http://localhost:3000
[browser] Saved to .tmp/screenshot_20260310_143022.png
 
✓ Screenshot saved successfully

Saves to .tmp/screenshot_YYYYMMDD_HHMMSS.png by default.

Command Format

co browser "screenshot [URL] [save to PATH] [size SIZE]"

All parts except URL are optional.

Basic Screenshots

code
1# Local development 2co browser "screenshot localhost:3000" 3 4# Specific port 5co browser "screenshot localhost:8080" 6 7# External site 8co browser "screenshot example.com" 9 10# Full URL 11co browser "screenshot https://docs.connectonion.com"

Save to Specific Path

code
1# Save to temp directory 2co browser "screenshot localhost:3000 save to /tmp/debug.png" 3 4# Save to current directory 5co browser "screenshot localhost:3000 save to homepage.png" 6 7# Save to subdirectory 8co browser "screenshot localhost:3000 save to screenshots/test.png"

Device Sizes

code
1# iPhone viewport 2co browser "screenshot localhost:3000 size iphone" 3 4# Custom dimensions 5co browser "screenshot localhost:3000 size 390x844" 6 7# Common presets 8co browser "screenshot localhost:3000 size ipad" 9co browser "screenshot localhost:3000 size desktop"

Device Presets

PresetDimensionsDevice
iphone390x844iPhone 14/15
android360x800Common Android
ipad768x1024iPad
desktop1920x1080Full HD Desktop

Complete Examples

Debug Mobile Checkout

code
1co browser "screenshot localhost:3000/checkout save to /tmp/checkout-mobile.png size iphone"

Document Bug

code
1co browser "screenshot localhost:3000/xray save to bug-report.png size 1920x1080"

Test Responsive Design

code
1# Test multiple viewports 2co browser "screenshot localhost:3000 save to mobile.png size 390x844" 3co browser "screenshot localhost:3000 save to tablet.png size 768x1024" 4co browser "screenshot localhost:3000 save to desktop.png size 1920x1080"

URL Handling

The command intelligently handles URLs:

localhosthttp://localhost
localhost:3000http://localhost:3000
example.comhttps://example.com
http://example.comhttp://example.com(unchanged)

Use Cases

1. Debug Local Development

code
1# Quick check of homepage 2co browser "screenshot localhost:3000" 3 4# Debug specific route 5co browser "screenshot localhost:3000/api/status"

2. Document Bugs

code
1# Capture error state 2co browser "screenshot localhost:3000/error save to bug.png" 3 4# Mobile-specific issue 5co browser "screenshot localhost:3000/mobile-bug save to mobile-issue.png size iphone"

3. Test Responsive Design

code
1# Test different viewports 2for size in iphone android ipad desktop; do 3 co browser "screenshot localhost:3000 save to view-$size.png size $size" 4done

4. CI/CD Integration

code
1# In GitHub Actions or similar 2co browser "screenshot $DEPLOY_URL save to artifacts/deployed.png"

Framework Examples

Next.js

code
1co browser "screenshot localhost:3000" 2co browser "screenshot localhost:3000/_error save to error.png"

FastAPI

code
1co browser "screenshot localhost:8000" 2co browser "screenshot localhost:8000/docs save to api-docs.png"

Django

code
1co browser "screenshot localhost:8000" 2co browser "screenshot localhost:8000/admin save to admin.png"

React Dev Server

code
1co browser "screenshot localhost:3000" 2co browser "screenshot localhost:3000 size iphone"

Installation

Browser features require Playwright:

code
1# Install Playwright 2pip install playwright 3playwright install chromium 4 5# Or install ConnectOnion with browser support 6pip install connectonion[browser]

Common Errors

❌ Browser tools not installed

Run: pip install playwright && playwright install chromium

❌ Cannot reach http://localhost:3000

Is your server running? Start it first.

❌ Natural language browser agent unavailable. Set OPENAI_API_KEY

Set your OpenAI API key for natural language commands

Tips & Best Practices

Quick Debug: Just co browser "screenshot localhost:3000" for instant feedback
Organize Screenshots: Use descriptive paths like save to bugs/issue-123.png
Test Viewports: Use device names (iphone, ipad) for common sizes
Timestamps: Default filenames include timestamp for versioning

Limitations

  • • Screenshots only (no interaction, clicking, forms)
  • • Single page at a time
  • • Headless browser only
  • • PNG format only

For complex browser automation, use the full ConnectOnion browser agent or Playwright directly.

Enjoying ConnectOnion?

⭐ Star us on GitHub = ☕ Coffee chat with our founder. We love meeting builders.