Bruno's CLICommand Options

Command Options

Bruno CLI provides a variety of command options to help you customize your API testing and execution process. These options allow you to specify environments, configure reports, handle security, and much more. Below is a comprehensive list of available options:

Bruno version

To check the current version of your Bruno CLI installation, use the following command:

bru --version

This will display the version number of the Bruno CLI you have installed. It’s a helpful command for ensuring you’re working with the latest version or for troubleshooting version-specific issues.

Getting Started

Navigate to the directory where your API collection resides, and run the following command:

bru run

This will run all the requests in your collection. If you want to run a single request, specify its filename:

bru run request.bru

Running Requests in a Folder

To run all the requests within a folder, use:

bru run folder

Using Environments

If you need to use a specific environment, you can pass it with the --env option:

bru run folder --env Local

Passing Environment Variables

Variables marked as secrets in Bruno app are not accessible via the CLI. Pass them directly as command-line arguments.

bru run folder --env Local --env-var JWT_TOKEN=1234

Outputting Results

To save the results of your API tests to a file, use the --output option:

bru run folder --output results.json

Adding Delay

If you need to add a delay between requests during the execution of your API collection, you can use the --delay option.

Example:

bru run  --delay 1000

Using Client Certificates for API Requests

If your API requests require client certificates for authentication, you can specify using the --client-cert-config option. The configuration should be provided in a JSON file. Here’s an example of how to use this option:

bru run folder --client-cert-config /path/to/client-cert-config.json

The client-cert-config.json file should contain the following fields:

{
  "enabled": true,
  "certs": [
    {
      "domain": "usebruno.com",
      "type": "cert",
      "certFilePath": "certs/server_1.crt",
      "keyFilePath": "private/server_1.key",
      "passphrase": "Iu$eBrun0_#Secure!"
    },
    {
      "domain": "the-example.com",
      "type": "pfx",
      "pfxFilePath": "pfx/server_3.pfx",
      "passphrase": "L!ghT_Y@g@mi_2024!"
    }
  ]
}

Options

OptionDetails
-h, —helpShow help
—versionShow version number
-rIndicates a recursive run (default: false)
—cacert [string]CA certificate to verify peer against
—env [string]Specify environment to run with
—env-var [string]Overwrite a single environment variable, multiple usages possible
-o, —output [string]Path to write file results to
-f, —format [string]Format of the file results; available formats are “json” (default) or “junit”
—reporter-json [string]Path to generate a JSON report
—reporter-junit [string]Path to generate a JUnit report
—reporter-html [string]Path to generate an HTML report
—insecureAllow insecure server connections
—tests-onlyOnly run requests that have tests
—bailStop execution after a failure of a request, test, or assertion
—csv-file-pathCSV file to run the collection with
—reporter—skip-all-headersSkip all headers in the report
—reporter-skip-headersSkip specific headers in the report
—client-cert-configClient certificate configuration by passing a JSON file
—delay [number]Add delay to each request

Demo

bru cli

Support

If you encounter any issues or have any feedback or suggestions, please raise them on our GitHub repository