CLI Reference
Complete reference for all TestBro CLI commands.
Global Options
testbro --version # Show version number
testbro --help # Show help for any command
testbro <cmd> --help # Show help for a specific command
testbro login
Authenticate with the TestBro API.
testbro login --token <api-token> [--url <api-url>]
| Flag | Description |
|---|---|
-t, --token <token> | API token for authentication (required) |
-u, --url <url> | API URL (default: http://localhost:3024) |
Credentials are stored in ~/.testbro/config.json.
testbro logout
Remove stored credentials from your machine.
testbro logout
testbro whoami
Show the currently authenticated user and active project.
testbro whoami
testbro quickstart
Interactive setup wizard that creates a demo project with sample test cases.
testbro quickstart [--skip-test]
| Flag | Description |
|---|---|
--skip-test | Skip running the sample test verification |
The wizard:
- Verifies authentication
- Creates a "My First Project"
- Generates sample test cases for httpbin.org
- Creates a
test-bro.config.jsonfile - Sets the project as active
testbro run
Run tests against a URL. This is the main test execution command.
testbro run [options]
Options
| Flag | Description | Default |
|---|---|---|
-u, --url <url> | Target URL to test | From config baseUrl |
--file <path> | Path to file (AC/PRD) to generate and run tests from | -- |
-d, --description <text> | Feature description to test | -- |
-p, --project <id> | Project ID (overrides active project) | Active project |
-t, --test-case <id> | Run a specific test case only | -- |
-m, --mode <mode> | Execution mode: selector, ai, or hybrid | selector |
--headed | Run browser in visible mode | false |
--remote | Run tests on remote staging environment | false |
-f, --format <format> | Output format: pretty or json | pretty |
-v, --verbose | Show verbose output | false |
--timeout <ms> | Timeout per step in milliseconds (min: 1000) | 30000 |
--learn-selectors | Learn selectors from AI actions | false |
--yes | Auto-confirm selector learning prompts | false |
--no-dedup | Skip deduplication check when using --file | -- |
--auto-merge | Auto-apply smart merge without prompting (with --file) | -- |
Test Source Priority
The run command needs a test source. It resolves in this order:
--description-- Generates an ad-hoc test from the description--file-- Generates test cases from the file and saves them to the project--project/ active project -- Runs existing test cases from the project
Examples
# Run with a description
testbro run --url https://example.com --description "Verify login works" --mode ai
# Run existing project test cases
testbro run --url https://example.com --project my-project --mode hybrid
# Generate from file and run
testbro run --url https://example.com --file spec.md --project my-project --mode ai
# Run a specific test case
testbro run --url https://example.com --test-case tc-123 --mode selector
# Run in headed mode with verbose output
testbro run --url https://example.com --mode ai --headed --verbose
testbro generate
Generate test cases from a file or text description using AI.
testbro generate [options]
| Flag | Description |
|---|---|
-f, --file <path> | Path to file containing requirements/PRD |
-d, --description <text> | Text description to generate tests from |
-s, --save | Save generated test cases to the project |
-p, --project <id> | Project ID (overrides active project) |
Examples
# Generate from a file and save
testbro generate --file requirements.md --save --project my-project
# Generate from a description (preview only)
testbro generate --description "User registration with email verification"
# Generate and save to active project
testbro generate --file acceptance-criteria.md --save
testbro projects
List all projects.
testbro projects
testbro projects create
Create a new project interactively.
testbro projects create
You will be prompted for a project name and optional description.
testbro use-project
Set or clear the active project.
testbro use-project <project-id>
testbro use-project --clear
| Flag | Description |
|---|---|
-c, --clear | Clear the active project |
testbro config
Show or update configuration.
testbro config # Show current configuration
testbro config show # Same as above
testbro config init # Create test-bro.config.json template
testbro config init
Creates a test-bro.config.json file in the current directory with default settings.
testbro config show
Displays user config, project config, and authentication status.
Exit Codes
| Code | Meaning |
|---|---|
0 | All tests passed / command succeeded |
1 | One or more tests failed / command error |
Next Steps
- Execution Modes -- How each mode works
- Test Cases -- Test case structure and management
- CI/CD Integration -- Using the CLI in automated pipelines