CLIco browser
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
co browser "screenshot localhost:3000"
output
[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
# Local development co browser "screenshot localhost:3000" # Specific port co browser "screenshot localhost:8080" # External site co browser "screenshot example.com" # Full URL co browser "screenshot https://docs.connectonion.com"

Save to Specific Path

code
# Save to temp directory co browser "screenshot localhost:3000 save to /tmp/debug.png" # Save to current directory co browser "screenshot localhost:3000 save to homepage.png" # Save to subdirectory co browser "screenshot localhost:3000 save to screenshots/test.png"

Device Sizes

code
# iPhone viewport co browser "screenshot localhost:3000 size iphone" # Custom dimensions co browser "screenshot localhost:3000 size 390x844" # Common presets co browser "screenshot localhost:3000 size ipad" co browser "screenshot localhost:3000 size desktop"

Device Presets

PresetDimensionsDevice
iphone390x844iPhone 14/15
android360x800Common Android
ipad768x1024iPad
desktop1920x1080Full HD Desktop

Complete Examples

Debug Mobile Checkout

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

Document Bug

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

Test Responsive Design

code
# Test multiple viewports co browser "screenshot localhost:3000 save to mobile.png size 390x844" co browser "screenshot localhost:3000 save to tablet.png size 768x1024" co 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
# Quick check of homepage co browser "screenshot localhost:3000" # Debug specific route co browser "screenshot localhost:3000/api/status"

2. Document Bugs

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

3. Test Responsive Design

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

4. CI/CD Integration

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

Framework Examples

Next.js

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

FastAPI

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

Django

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

React Dev Server

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

Installation

Browser features require Playwright:

code
# Install Playwright pip install playwright playwright install chromium # Or install ConnectOnion with browser support pip 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.

Star us on GitHub

If ConnectOnion saves you time, a ⭐ goes a long way — and earns you a coffee chat with our founder.