Browser automation for AI agents and humans
npm install vibiumBrowser automation for AI agents and humans.
``bash`
npm install vibium
This automatically downloads Chrome for Testing on first install.
`javascript
import { browser } from 'vibium'
import { writeFile } from 'fs/promises'
// In a REPL: const { browser } = require('vibium')
// In a REPL: const { writeFile } = require('fs/promises')
const vibe = await browser.launch()
await vibe.go('https://example.com')
const link = await vibe.find('a')
console.log(await link.text())
await link.click()
const screenshot = await vibe.screenshot()
await writeFile('screenshot.png', screenshot)
await vibe.quit()
`
`javascript
import { browserSync } from 'vibium'
import { writeFileSync } from 'fs'
// In a REPL: const { browserSync } = require('vibium')
// In a REPL: const { writeFileSync } = require('fs')
const vibe = browserSync.launch()
vibe.go('https://example.com')
const link = vibe.find('a')
console.log(link.text())
link.click()
const screenshot = vibe.screenshot()
writeFileSync('screenshot.png', screenshot)
vibe.quit()
`
Launch a new browser session.
`javascript`
const vibe = await browser.launch({ headless: true })
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| headless | boolean | false | Run without visible window |
Navigate to a URL.
`javascript`
await vibe.go('https://example.com')
Find an element by CSS selector.
`javascript`
const button = await vibe.find('button.submit')
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| timeout | number | 30000 | Max wait time in ms |
Capture a screenshot. Returns a Buffer (PNG).
`javascript`
const png = await vibe.screenshot()
Close the browser session.
`javascript`
await vibe.quit()
Click the element. Waits for element to be visible, stable, and enabled.
`javascript`
await element.click()
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| timeout | number | 30000 | Max wait time in ms |
Type text into the element. Waits for element to be visible, stable, enabled, and editable.
`javascript`
await element.type('hello@example.com')
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| timeout | number | 30000 | Max wait time in ms |
Get the element's text content.
`javascript`
const text = await element.text()
Get an attribute value.
`javascript`
const testId = await element.getAttribute('data-testid')
Get the element's position and size. Returns {x, y, width, height}.
`javascript`
const box = await element.boundingBox()
| Variable | Description |
|----------|-------------|
| VIBIUM_SKIP_BROWSER_DOWNLOAD | Set to 1 to skip Chrome download on install |
Add Vibium to Claude Code:
`bash`
claude mcp add vibium -- npx vibium
#### browser_launch
Start a browser session.
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| headless | boolean | false | Run without visible window |
#### browser_navigate
Navigate to a URL.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| url | string | yes | The URL to navigate to |
#### browser_click
Click an element. Waits for element to be visible, stable, and enabled.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| selector | string | yes | CSS selector |
#### browser_type
Type text into an element. Waits for element to be visible, stable, enabled, and editable.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| selector | string | yes | CSS selector |text
| | string | yes | Text to type |
#### browser_screenshot
Capture a screenshot.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| filename | string | no | Save to file (e.g., screenshot.png) |
#### browser_find
Find an element and return its info (tag, text, bounding box).
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| selector` | string | yes | CSS selector |
#### browser_quit
Close the browser session.
- GitHub / Documentation
- Website
Apache-2.0