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. Data-Driven Testing
Objective: Create a CSV or JSON data file, use row values in the02-echo-bru request, and run it from the CLI with an HTML report.
The Bruno Starter Guide includes 02-echo-bru, a POST request to the echo.usebruno.com endpoint. You will send a different JSON body on each iteration using data from a file.
Update the request in Bruno
- Open the Bruno Starter Guide collection in Bruno.
- Open the
02-echo-brurequest. - Select the
localenvironment (top-right). - Go to the Body tab and update the JSON to use placeholders that match your data file columns:
- Save the request.
Create a data file
Create one of the following files in your collection folder (bruno-starter-guide/):
- CSV
- JSON
Create
users.csv:Try it in the Bruno app (optional)
- Open the collection Runner (runner icon in the top right corner).
- Attach
users.csvorusers.jsonas the data file. - Select the
localenvironment and run02-echo-bru. - Review the Timeline to confirm each iteration sent a different
titleandmsg.
Run from the CLI
From the collection directory, run02-echo-bru once per data row and write an HTML report:
- CSV
- JSON
results.html:
results.html in your browser for a visual summary of all three iterations. See Generating Reports for JSON, JUnit, and other reporter options.
Success Criteria:
users.csvorusers.jsonexists in the collection folder withtitleandmsgcolumns.02-echo-brubody uses{{title}}and{{msg}}.- CLI run completes with 3 (3 Passed) in the execution summary.
results.htmlis created and shows one result per data row.
8. 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:
- Collection runs successfully with overridden variables.
- No changes are required to environment files on disk.
9. 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.
10. 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, run data-driven tests, 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
- Data Driven Testing — CSV/JSON iteration in the app and CLI
- Generating Reports — HTML, JSON, and JUnit reporters
- Proxy Configuration — run collections behind a proxy
- Bruno Quick Start — build the same collection in the Bruno app