CLI Overview
Bruno CLI (bru) allows you to run your API collections from the command line, making it easy to:
- Test APIs in different environments
- Automate testing workflows
- Integrate with CI/CD pipelines
- Run tests in headless environments
.bru files you create in the Bruno desktop app, ensuring consistency between manual and automated testing.
Key Features
Environment Support
Switch between environments and override variables on the fly
Multiple Reporters
Export results as JSON, JUnit, or HTML for CI/CD integration
Flexible Execution
Run individual requests, folders, or entire collections recursively
Custom Certificates
Add custom CA certificates and client certificates for secure connections
Quick Start
Navigate to your collection directory and run all requests:Common Use Cases
CI/CD Integration
Generate JUnit reports for your CI/CD pipeline:Environment Testing
Test against multiple environments with overrides:Selective Testing
Run only requests that have tests:Filtered Execution
Run requests with specific tags:Exit Codes
Bruno CLI returns specific exit codes for scripting and automation:| Exit Code | Description |
|---|---|
0 | Execution successful |
1 | An assertion, test, or request failed |
2 | The specified output directory does not exist |
3 | The request chain loops endlessly |
4 | Bru was called outside of a collection root directory |
5 | The specified input file does not exist |
6 | The specified environment does not exist |
7 | The environment override was not a string or object |
8 | An environment override is malformed |
9 | An invalid output format was requested |
255 | Another error occurred |
Next Steps
Installation
Install Bruno CLI globally or in your project
Running Tests
Learn how to run API tests with various options
CLI Options
Complete reference of all CLI flags and options
Importing Collections
Import collections from OpenAPI and other formats