From b6e169373960f136c555e0db0715503119753bc9 Mon Sep 17 00:00:00 2001 From: Chris Tate Date: Sat, 10 Jan 2026 12:03:30 -0600 Subject: [PATCH] more --- README.md | 126 +++++++++++++++++++-- src/actions.ts | 283 ++++++++++++++++++++++++++++++++++++++++++++++++ src/browser.ts | 143 +++++++++++++++++++++++- src/index.ts | 267 +++++++++++++++++++++++++++++++++++++++++++++ src/protocol.ts | 135 +++++++++++++++++++++++ src/types.ts | 149 ++++++++++++++++++++++++- 6 files changed, 1092 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ff0ffae..c629a7e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # veb -Headless browser automation CLI for agents and humans. Near-complete Playwright parity. +Headless browser automation CLI for agents and humans. Full Playwright parity. ## Installation @@ -15,6 +15,13 @@ pnpm build ```bash # Navigation veb open https://example.com +veb back # Go back +veb forward # Go forward +veb reload # Reload page + +# Page info +veb url # Get current URL +veb title # Get page title # Clicking veb click "#submit-btn" @@ -40,6 +47,9 @@ veb drag "#source" "#target" veb upload "#file-input" ./document.pdf veb upload "#files" ./a.png ./b.png +# Downloads +veb download "#download-btn" ./file.zip + # Waiting veb wait "#loading" # Wait for selector veb wait --text "Welcome" # Wait for text @@ -56,6 +66,15 @@ veb snapshot # Accessibility tree (best for agents) veb extract "#main" # Get HTML veb eval "document.title" # Run JavaScript +# Element info +veb gettext "#message" # Get text content +veb getattr "#link" "href" # Get attribute +veb isvisible "#modal" # Check visibility +veb isenabled "#submit" # Check if enabled +veb ischecked "#checkbox" # Check if checked +veb count ".items" # Count matching elements +veb boundingbox "#element" # Get position/size + # Scrolling veb scroll down 500 veb scroll up @@ -73,6 +92,19 @@ veb placeholder "Search..." fill "query" veb frame "#iframe" # Switch to iframe veb mainframe # Switch back to main +# Network interception +veb route "**/*.png" --abort # Block images +veb route "**/api/*" --body '{"mock":true}' # Mock API +veb unroute # Remove all routes +veb requests # View tracked requests +veb requests --filter "api" # Filter requests + +# Browser settings +veb viewport 1920 1080 # Set viewport size +veb device "iPhone 14" # Emulate device +veb geolocation 37.7749 -122.4194 # Set location (SF) +veb permissions grant geolocation notifications + # Cookies veb cookies # Get all cookies veb cookies set '[{"name":"session","value":"abc123","domain":".example.com"}]' @@ -116,14 +148,24 @@ Use `--json` flag for machine-readable output: ```bash veb snapshot --json veb eval "document.title" --json +veb isvisible "#modal" --json ``` -## Commands Reference +## All Commands -### Navigation & Interaction +### Navigation | Command | Description | |---------|-------------| | `open ` | Navigate to URL | +| `back` | Go back | +| `forward` | Go forward | +| `reload` | Reload page | +| `url` | Get current URL | +| `title` | Get page title | + +### Interaction +| Command | Description | +|---------|-------------| | `click ` | Click element | | `dblclick ` | Double-click | | `type ` | Type text | @@ -136,8 +178,20 @@ veb eval "document.title" --json | `focus ` | Focus | | `drag ` | Drag & drop | | `upload ` | Upload files | +| `download ` | Download file | | `scroll [amount]` | Scroll | +### Element Info +| Command | Description | +|---------|-------------| +| `gettext ` | Get text content | +| `getattr ` | Get attribute | +| `isvisible ` | Check visibility | +| `isenabled ` | Check enabled | +| `ischecked ` | Check checked | +| `count ` | Count elements | +| `boundingbox ` | Get bounds | + ### Semantic Locators | Command | Description | |---------|-------------| @@ -154,6 +208,22 @@ veb eval "document.title" --json | `snapshot` | Accessibility tree | | `extract ` | Get HTML | | `eval