Prerequisites
- A basic understanding of HTTP and REST
- Node.js (v18 LTS or higher recommended)
- Git (to clone the sample collection)
Getting started
Use the Bruno Starter Guide collection as the hands-on sample for this walkthrough. It contains example requests, tests, assertions, and alocal environment โ the same collection used in the Bruno Quick Start.
Clone the repository:
1. Install Bruno CLI
Objective: Install Bruno CLI globally and verify it is available in your terminal.- npm
- pnpm
- yarn
3.4.2).
Success Criteria:
brucommand is available in your terminal.bru --versionprints a version number without errors.
2. Run the entire collection
Objective: Execute all requests in the Bruno Starter Guide collection from the command line. Make sure you are inside the cloned collection directory (the folder containingopencollection.yml):
bru runexecutes without installation errors.- CLI output lists all five requests in the collection.
- An execution summary table is displayed at the end.
3. Run with an environment
Objective: Run the collection using thelocal environment so variable placeholders like {{baseURL}} resolve correctly.
The Bruno Starter Guide includes a local environment at environments/local.yml with a baseURL variable. Activate it with the --env flag:
{{baseURL}} resolve and their tests and assertions run:
bru run --env localcompletes with โ PASS in the execution summary.- Tests and assertions for
02-echo-brupass (green checkmarks). - All five requests show a successful status.
4. Run a single request
Objective: Run one specific request instead of the entire collection. Specify the request file path afterbru run:
- Only the specified request runs.
- Execution summary shows 1 (1 Passed).
- Response status is 200 OK.
5. Run requests with tests only
Objective: Filter the collection run to requests that have tests or active assertions. Use the--tests-only flag to skip requests without tests:
02-echo-bru (which has tests and assertions) is executed:
- Only requests with tests or assertions are executed.
- Tests show 2/2 passed.
- Assertions show 2/2 passed.
6. Generate test reports
Objective: Export test results to HTML, JSON, and JUnit report files. Run the collection with reporter flags to write results to disk:results.html in a browser for a visual summary. Use results.json for programmatic analysis or results.xml for CI tools that consume JUnit format.
Success Criteria:
results.html,results.json, andresults.xmlare created in the current directory.- HTML report opens in a browser and shows request results.
- JSON and XML files contain test execution data.
7. Override environment variables
Objective: Pass or override environment variables at runtime without editing environment files. Use the--env-var flag to set variables on the command line. This is useful for secrets and CI-specific values:
Variables marked as secrets in the Bruno app are not accessible via the CLI. Pass them directly with
--env-var.- Collection runs successfully with overridden variables.
- No changes are required to environment files on disk.
8. Import an OpenAPI specification
Objective: Create a Bruno collection from an OpenAPI spec using the CLI. Bruno CLI can import OpenAPI documents directly into a collection folder โ useful for bootstrapping collections or CI pipelines that sync with API specs:petstore-apidirectory is created withopencollection.ymland request files.bru runinside the imported collection executes without import errors.
9. Automate with CI/CD
Objective: Understand how Bruno CLI fits into automated testing pipelines. Bruno CLI is designed for CI/CD. A typical GitHub Actions workflow:- Checks out your repository
- Installs
@usebruno/cli - Runs
bru runwith environment and reporter flags - Uploads the HTML report as a build artifact
- You understand the basic CI/CD pattern for Bruno CLI.
- You know where to find a complete GitHub Actions example.
Congratulations on completing the Bruno CLI Quick Start! You have learned how to install the CLI, run collections, use environments, generate reports, import OpenAPI specs, and integrate with CI/CD. Next steps:
- Command Options โ full list of CLI flags
- Command Examples โ data-driven testing, tags, and parallel runs
- Proxy Configuration โ run collections behind a proxy
- Bruno Quick Start โ build the same collection in the Bruno app