Skip to main content

CLI Options Reference

Complete reference for all Bruno CLI commands, options, and flags.

Global Options

These options are available for all commands:
--help
boolean
Show help information.Aliases: -h
bru --help
bru run --help
--version
boolean
Show version number.
bru --version

Run Command

Execute API requests and tests from your collection.
bru run [paths...] [options]

Paths

paths
string[]
One or more request files or folders to run. If omitted, runs all requests in the current directory recursively.
bru run                          # Run all requests
bru run request.bru              # Run single request
bru run folder                   # Run folder
bru run auth users -r            # Run multiple paths recursively

Execution Options

-r
boolean
default:false
Run requests recursively in subdirectories.
bru run tests -r
--tests-only
boolean
default:false
Only run requests that have tests or active assertions.
bru run --tests-only
--bail
boolean
default:false
Stop execution immediately after a failure of a request, test, or assertion.
bru run --bail
--delay
number
Add delay between each request in milliseconds.
bru run --delay 1000  # 1 second delay
bru run --delay 500   # 500ms delay
--verbose
boolean
default:false
Enable verbose output for debugging purposes.
bru run --verbose

Environment Options

--env
string
Specify environment to run with. Loads from environments/<name>.bru or environments/<name>.yml.
bru run --env production
bru run --env local
--env-file
string
Path to environment file (.bru, .json, or .yml) - absolute or relative.
bru run --env-file custom-env.bru
bru run --env-file /path/to/env.json
--env-var
string
Override a single environment variable. Can be used multiple times.
bru run --env-var apiKey=secret123
bru run --env-var baseUrl=https://api.test.com --env-var token=xyz
--global-env
string
Global environment name (requires collection to be in a workspace).
bru run --global-env production
bru run --global-env staging --workspace-path /path/to/workspace
--workspace-path
string
Path to workspace directory (auto-detected if not provided).
bru run --global-env production --workspace-path ~/my-workspace

Output and Reporting

--output
string
Path to write file results to. Use with --format to specify format.Aliases: -o
bru run --output results.json
bru run --output results.xml --format junit
bru run -o report.html --format html
--format
string
default:"json"
Format of the file results.Aliases: -fOptions: json, junit, html
bru run --output results.xml --format junit
--reporter-json
string
Path to generate a JSON report.
bru run --reporter-json results.json
--reporter-junit
string
Path to generate a JUnit XML report.
bru run --reporter-junit results.xml
--reporter-html
string
Path to generate an HTML report.
bru run --reporter-html report.html

Reporter Customization

--reporter-skip-all-headers
boolean
default:false
Omit all headers from the reporter output.
bru run --reporter-skip-all-headers
--reporter-skip-headers
array
default:[]
Skip specific headers from the reporter output.
bru run --reporter-skip-headers Authorization Cookie
bru run --reporter-skip-headers "X-Api-Key"
--reporter-skip-request-body
boolean
default:false
Omit request body from the reporter output.
bru run --reporter-skip-request-body
--reporter-skip-response-body
boolean
default:false
Omit response body from the reporter output.
bru run --reporter-skip-response-body
--reporter-skip-body
boolean
default:false
Omit both request and response bodies from the reporter output.
bru run --reporter-skip-body

Security and Certificates

--cacert
string
CA certificate to verify peer against. By default, uses system truststore + custom cert.
bru run --cacert myCustomCA.pem
bru run --cacert corporate-ca.crt
--ignore-truststore
boolean
default:false
Use only the specified custom CA certificate (—cacert) and ignore the default truststore.
bru run --cacert myCustomCA.pem --ignore-truststore
--insecure
boolean
default:false
Allow insecure server connections (skip SSL certificate verification).
Only use in development/testing environments.
bru run --insecure
--client-cert-config
string
Path to client certificate configuration JSON file.
bru run --client-cert-config client-certs.json
Config format:
{
  "enabled": true,
  "certs": [
    {
      "domain": "https://api.example.com",
      "certFilePath": "/path/to/cert.pem",
      "keyFilePath": "/path/to/key.pem",
      "passphrase": "optional"
    }
  ]
}

Network Options

--noproxy
boolean
default:false
Disable all proxy settings (both collection-defined and system proxies).
bru run --noproxy
--disable-cookies
boolean
default:false
Disable automatic cookie saving and sending with requests.
bru run --disable-cookies

Advanced Options

--sandbox
string
default:"safe"
JavaScript sandbox runtime to use.Options:
  • safe - Uses QuickJS (secure, limited features)
  • developer - Uses Node.js VM (more features, less secure)
bru run --sandbox developer
--tags
string
Comma-separated list of tags to include in the run.
bru run --tags=smoke,critical
bru run --tags=api
--exclude-tags
string
Comma-separated list of tags to exclude from the run.
bru run --exclude-tags=skip,wip
bru run --tags=api --exclude-tags=slow

Import Command

Import collections from other formats.
bru import <type> [options]

Import Types

type
string
required
Type of collection to import.Options: openapi, wsdl
bru import openapi --source api.yml --output ./collection
bru import wsdl --source service.wsdl --output ./soap

Import Options

--source
string
required
Path to the source file or URL.Aliases: -s
bru import openapi --source api.yml
bru import openapi -s https://api.example.com/openapi.json
--output
string
Path to the output directory. Conflicts with --output-file.Aliases: -o
bru import openapi -s api.yml -o ~/Desktop/my-collection
--output-file
string
Path to the output JSON file. Conflicts with --output.Aliases: -f
bru import openapi -s api.yml -f ~/Desktop/collection.json
--collection-name
string
Name for the imported collection.Aliases: -n
bru import openapi -s api.yml -o ./collection -n "My API"
--collection-format
string
default:"opencollection"
Format of the imported collection.Options: bru, opencollection
bru import openapi -s api.yml -o ./collection --collection-format bru
--insecure
boolean
default:false
Skip SSL certificate verification when fetching from URLs.
bru import openapi -s https://self-signed.com/api.json --insecure
--group-by
string
default:"tags"
How to group imported requests (OpenAPI only).Aliases: -gOptions: tags, path
bru import openapi -s api.yml -o ./collection --group-by path
bru import openapi -s api.yml -o ./collection -g tags

Exit Codes

Bruno CLI returns specific exit codes for scripting and automation:
Exit CodeConstantDescription
0-Execution successful
1ERROR_FAILED_COLLECTIONAn assertion, test, or request failed
2ERROR_MISSING_OUTPUT_DIRThe specified output directory does not exist
3ERROR_INFINITE_LOOPThe request chain loops endlessly
4ERROR_NOT_IN_COLLECTIONBru was called outside of a collection root
5ERROR_FILE_NOT_FOUNDThe specified input file does not exist
6ERROR_ENV_NOT_FOUNDThe specified environment does not exist
7ERROR_MALFORMED_ENV_OVERRIDEEnvironment override not presented as string or object
8ERROR_INCORRECT_ENV_OVERRIDEEnvironment override format incorrect
9ERROR_INCORRECT_OUTPUT_FORMATInvalid output format requested
10ERROR_INVALID_FILEInvalid file format
11ERROR_WORKSPACE_NOT_FOUNDThe specified workspace was not found
12ERROR_GLOBAL_ENV_REQUIRES_WORKSPACEGlobal environment requires a workspace
13ERROR_GLOBAL_ENV_NOT_FOUNDThe specified global environment was not found
255ERROR_GENERICAnother error occurred

Using Exit Codes in Scripts

#!/bin/bash

bru run --env production
EXIT_CODE=$?

if [ $EXIT_CODE -eq 0 ]; then
  echo "All tests passed!"
elif [ $EXIT_CODE -eq 1 ]; then
  echo "Some tests failed"
  exit 1
elif [ $EXIT_CODE -eq 6 ]; then
  echo "Environment not found"
  exit 1
else
  echo "Error occurred: $EXIT_CODE"
  exit 1
fi

Environment Variables

Bruno CLI respects the following environment variables:
HTTP_PROXY
string
HTTP proxy server URL.
export HTTP_PROXY=http://proxy.example.com:8080
bru run
HTTPS_PROXY
string
HTTPS proxy server URL.
export HTTPS_PROXY=https://proxy.example.com:8443
bru run
NO_PROXY
string
Comma-separated list of hosts to exclude from proxying.
export NO_PROXY=localhost,127.0.0.1,.example.com
bru run

Complete Examples

Production Test Suite

bru run \
  --env production \
  --env-var apiKey=$PROD_API_KEY \
  --reporter-junit results.xml \
  --reporter-html report.html \
  --reporter-skip-headers Authorization \
  --bail \
  --cacert corporate-ca.pem

Development Testing

bru run \
  --env local \
  --env-var baseUrl=http://localhost:3000 \
  --tests-only \
  --verbose \
  --insecure

CI/CD Integration

bru run \
  --env staging \
  --reporter-junit test-results.xml \
  --reporter-json test-results.json \
  --bail \
  --tags=smoke,regression \
  --exclude-tags=manual

Import and Test

# Import collection
bru import openapi \
  --source https://api.example.com/openapi.json \
  --output ./my-api \
  --collection-name "Example API" \
  --group-by path

# Run tests
cd my-api
bru run --env production --reporter-html results.html

Next Steps

CLI Overview

Learn about Bruno CLI fundamentals

Running Tests

Practical guide to running API tests

Importing Collections

Import from OpenAPI and other formats

Installation

Install Bruno CLI in your environment

Build docs developers (and LLMs) love