commit 2d0520b770789b9a52bcee0041d93578503d8231 Author: Chris Tate Date: Sat Jan 10 11:33:37 2026 -0600 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d322e88 --- /dev/null +++ b/.gitignore @@ -0,0 +1,33 @@ +# Dependencies +node_modules/ + +# Build output +dist/ + +# Logs +*.log +npm-debug.log* + +# IDE +.idea/ +.vscode/ +*.swp +*.swo + +# OS +.DS_Store +Thumbs.db + +# Test artifacts +*.png +*.jpeg +*.jpg + +# Package manager +pnpm-lock.yaml +package-lock.json +yarn.lock + +# Environment +.env +.env.local diff --git a/README.md b/README.md new file mode 100644 index 0000000..c9db724 --- /dev/null +++ b/README.md @@ -0,0 +1,123 @@ +# veb + +Headless browser automation CLI for agents and humans. + +## Installation + +```bash +pnpm install +npx playwright install chromium +pnpm build +``` + +## Usage + +```bash +# Open a URL (auto-starts browser daemon) +veb open https://example.com + +# Click elements +veb click "#submit-btn" +veb click "text=Sign In" + +# Type into inputs +veb type "#email" hello@example.com +veb type "#search" "search query" + +# Press keyboard keys +veb press Enter +veb press Tab + +# Wait for things +veb wait "#loading" # wait for selector +veb wait --text "Welcome" # wait for text +veb wait 2000 # wait 2 seconds + +# Take screenshots +veb screenshot page.png +veb screenshot --full page.png # full page +veb screenshot -s "#hero" # specific element + +# Get accessibility snapshot (great for AI agents) +veb snapshot + +# Extract HTML content +veb extract "table" +veb extract "#main" + +# Evaluate JavaScript +veb eval "document.title" +veb eval "window.location.href" + +# Scroll the page +veb scroll down 500 +veb scroll up +veb scroll -s "#container" down + +# Interact with dropdowns +veb select "#country" "US" + +# Hover over elements +veb hover "#menu" + +# Close browser (stops daemon) +veb close +``` + +## Agent Mode + +Use `--json` flag for machine-readable output: + +```bash +veb open https://example.com --json +# {"id":"abc123","success":true,"data":{"url":"https://example.com/","title":"Example Domain"}} + +veb snapshot --json +# {"id":"def456","success":true,"data":{"snapshot":"..."}} +``` + +## How It Works + +veb runs a background daemon that keeps the browser open between commands. The first command automatically starts the daemon. Use `veb close` to shut it down. + +## Commands Reference + +| Command | Description | +|---------|-------------| +| `open ` | Navigate to a URL | +| `click ` | Click an element | +| `type ` | Type text into an element | +| `press ` | Press a keyboard key | +| `wait ` | Wait for condition | +| `screenshot [path]` | Take a screenshot | +| `snapshot` | Get accessibility tree | +| `extract ` | Get element HTML | +| `eval