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>]
FlagDescription
-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]
FlagDescription
--skip-testSkip running the sample test verification

The wizard:

  1. Verifies authentication
  2. Creates a "My First Project"
  3. Generates sample test cases for httpbin.org
  4. Creates a test-bro.config.json file
  5. Sets the project as active

testbro run

Run tests against a URL. This is the main test execution command.

testbro run [options]

Options

FlagDescriptionDefault
-u, --url <url>Target URL to testFrom 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 hybridselector
--headedRun browser in visible modefalse
--remoteRun tests on remote staging environmentfalse
-f, --format <format>Output format: pretty or jsonpretty
-v, --verboseShow verbose outputfalse
--timeout <ms>Timeout per step in milliseconds (min: 1000)30000
--learn-selectorsLearn selectors from AI actionsfalse
--yesAuto-confirm selector learning promptsfalse
--no-dedupSkip deduplication check when using --file--
--auto-mergeAuto-apply smart merge without prompting (with --file)--

Test Source Priority

The run command needs a test source. It resolves in this order:

  1. --description -- Generates an ad-hoc test from the description
  2. --file -- Generates test cases from the file and saves them to the project
  3. --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]
FlagDescription
-f, --file <path>Path to file containing requirements/PRD
-d, --description <text>Text description to generate tests from
-s, --saveSave 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
FlagDescription
-c, --clearClear 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

CodeMeaning
0All tests passed / command succeeded
1One or more tests failed / command error

Next Steps