bru import converts a Postman collection, OpenAPI specification, or WSDL file into a Bruno collection without opening the desktop app. Point it at a local file or a URL and it writes a ready-to-run collection, which makes it a good fit for CI pipelines and bulk migrations.
Usage
<type> is the format of the source you are importing:
For the full reference of every flag used below, see Options.
Importing Postman collections
bru import postman requires Bruno CLI 4.4.0 or higher.bru run can execute.
copy
copy
Optional name, environment, and scripts
copy
-s,--source: Path to the Postman collection JSON (v2.1)-o,--output: Directory for the generated OpenCollection folder-n,--collection-name: Optional display name for the collection-e,--env: Optional path to a Postman environment JSON export. Repeat the flag to import more than one environment--preserve-scripts: Keep Postman scripts as written instead of translatingpm.*calls to Bruno’sbru.*API
opencollection.yml, folder.yml per folder, one .yml per request). Converter warnings print one line each. If any issue is an error, the command exits non-zero.
For programmatic conversion in your own Node scripts, see Postman to Bruno.
Importing OpenAPI specifications
Collection format (--collection-format)
When you import OpenAPI into a directory (--output), you choose how the collection is laid out on disk:
Use one of:
Option 1: Import to a Bruno collection folder
This imports the OpenAPI specification (YAML or JSON) and writes a collection under the output directory. OpenCollection layout (default):copy
copy
.bru layout:
copy
<your-openapi.yaml>: Path or URL to your OpenAPI spec (YAML or JSON)<preferred-location>: Directory for the generated collection--collection-name: Display name for the collection--collection-format: Optional;opencollection(default) orbru
-s / -o / -n as shorthand for --source, --output, and --collection-name.
Option 2: Import to a single JSON file
This imports the OpenAPI specification and writes one Bruno collection JSON file at the given path.copy
<your-openapi.yaml>: Path or URL to your OpenAPI spec (YAML or JSON)<preferred-location>.json: Path for the exported collection file--collection-name: Custom name for the collection
Import from a URL
--source accepts an http:// or https:// URL as well as a file path. The CLI fetches the spec, converts it, and writes the collection:
copy
--insecure when the URL is served with a self-signed certificate and you want to skip TLS verification.
Group requests by tag or path
By default, imported requests are grouped into folders by their OpenAPI tags. Use--group-by path to build the folder structure from URL paths instead:
copy
Name requests with --request-name-source
--request-name-source applies only to OpenAPI imports. It does not affect Postman or WSDL imports.--request-name-source to prefer a different field:
copy
Place auth on the collection with --auth-placement
--auth-placement applies only to OpenAPI imports. It does not affect Postman or WSDL imports.--auth-placement request). Pass --auth-placement collection to set the spec’s security scheme on the collection and let requests inherit it:
copy
With
collection:
- Operations that share the collection scheme inherit auth
- If the spec has no global security but secured operations share one scheme, that scheme is promoted to the collection
- Operations with a different scheme keep their own auth
security: []maps to auth mode none
Importing WSDL (SOAP APIs)
This imports a WSDL file and generates a Bruno collection in the output directory.copy
<your-service.wsdl>: Path or URL to your WSDL file<preferred-location>: Directory where the collection should be created--collection-name: Optional name for the collection
Keep a collection in sync with the spec in CI
Because the command is non-interactive, you can regenerate the collection on every change to the specification and run it in the same job:Next steps
- Options - the full reference for every
bru importflag - bru run - run the collection you just imported
- bru docs - generate HTML API documentation from it
- Postman to Bruno - convert Postman collections in your own Node scripts
- Import collections in the app - the same importers in the Bruno desktop app
- OpenCollection YAML - the default on-disk format for imported collections