Installation
Prerequisites
- Node.js 18 or later
- npm, pnpm, or yarn package manager
- A TestBro account with an API token
Install the CLI
Install TestBro globally using your preferred package manager:
# npm
npm install -g @testbro/cli
# pnpm
pnpm add -g @testbro/cli
# yarn
yarn global add @testbro/cli
Verify Installation
testbro --version
You should see the version number printed (e.g., 0.1.0).
Authenticate
Log in with your API token. You can generate a token from the TestBro web dashboard under Settings > API Tokens.
testbro login --token <your-api-token>
If your TestBro instance is self-hosted or running locally, specify the API URL:
testbro login --token <your-api-token> --url http://localhost:3024
Credentials are stored in ~/.testbro/config.json.
Create a Project Configuration
Initialize a project-level configuration file in your repository root:
testbro config init
This creates a test-bro.config.json file with default settings:
{
"$schema": "https://testbro.dev/schema/config.json",
"baseUrl": "https://your-app.com",
"environment": "local",
"mode": "hybrid",
"timeout": 30000
}
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
baseUrl | string | -- | Default URL for test runs |
environment | string | "local" | Environment label |
mode | string | "selector" | Default execution mode (selector, ai, hybrid) |
timeout | number | 30000 | Timeout per step in ms |
projectId | string | -- | Default project ID |
headed | boolean | false | Run browser in visible mode |
deduplication.enabled | boolean | true | Enable test case deduplication |
deduplication.autoMerge | boolean | false | Auto-merge duplicates |
Environment Variables
You can also configure TestBro via environment variables:
| Variable | Description |
|---|---|
TEST_BRO_TOKEN | API token (alternative to testbro login) |
OPENROUTER_API_KEY | Required for AI execution mode |
These can be set in your shell profile or a .env file in your project root.
Verify Setup
Check your configuration:
testbro config show
This displays your user config, project config, and authentication status.
Next Steps
- Quickstart -- Run your first test
- Authentication -- Token management details
- CLI Reference -- All available commands