Installation
bw command. Requires Node.js 22+ on macOS or Linux.
bw login
Authenticate with BrowserWire via your browser.
~/.config/browserwire/config.json with 0600 permissions. The token is valid for 30 days.
If the browser doesn’t open automatically, the CLI prints a URL you can visit manually.
Timeout: 120 seconds. If authentication isn’t completed in time, the command exits with an error.
bw record <url>
Open a browser, navigate to a URL, and record a session.
How it works
- Launches a Chrome browser and navigates to the URL
- You browse freely — recording hasn’t started yet
- Press Enter to start recording (page reloads for a clean snapshot)
- Interact with the site — every DOM mutation, click, keystroke, and navigation is captured
- Press Enter to stop recording
- Events are uploaded and a training run is triggered automatically
- The dashboard opens in your browser to the recording detail page
Terminal output
Authentication
If your session token is missing or expired, the CLI prompts you to log in before uploading. You won’t lose your recording — the auth flow runs after the session is captured.New tabs
Links that would open in a new tab are redirected into the current page so the recording stays continuous.bw run
Start a local execution server that serves your discovered APIs.
Flags
| Flag | Description | Default |
|---|---|---|
-p, --port <number> | Port to listen on | 8787 |
--headless | Run the browser in headless mode (no visible window) | false (headed) |
--max-concurrent <number> | Maximum concurrent browser pages for parallel requests | 3 |
What it does
- Verifies you’re logged in (exits with error if not)
- Fetches all your manifests from the BrowserWire API
- Launches a persistent Chrome browser (headed by default)
- Starts an HTTP server on
127.0.0.1:<port>
Endpoints served
| Method | Endpoint | Description |
|---|---|---|
GET | /api/health | Health check |
GET | /api/sites | List all cached manifests |
GET | /api/sites/:slug/manifest | Full manifest JSON |
GET | /api/sites/:slug/views/:state/:view | Execute a view |
POST | /api/sites/:slug/actions/:state/:action | Execute an action |
Examples
Start with defaults (port 8787, headed, 3 concurrent):Concurrency
Each API request opens a new browser page. If the maximum concurrent limit is reached, additional requests receive a429 Too Many Requests response. Increase --max-concurrent if you need more parallelism.
Graceful shutdown
Press Ctrl+C to stop the server. The browser is closed and the process exits cleanly.bw --version
Print the CLI version.
bw --help
Show usage information for all commands.
Environment variables
| Variable | Description | Default |
|---|---|---|
BW_TOKEN | Session token (overrides config file, useful for CI) | — |
BW_API_URL | BrowserWire backend URL | https://app.browserwire.io |