Skip to main content
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.
Import a Postman Collection v2.1 JSON export into an OpenCollection YAML directory Bruno can open and bru run can execute.
copy
Shorthand:
copy

Optional name, environment, and scripts

copy
Where:
  • -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 translating pm.* calls to Bruno’s bru.* API
The CLI writes OpenCollection YAML only (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
Explicit OpenCollection layout:
copy
Classic .bru layout:
copy
Where:
  • <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) or bru
You can also pass -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
Where:
  • <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
Add --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.
By default, Bruno names each request from the operation summary. Pass --request-name-source to prefer a different field:
copy
If an operation does not have the selected field, Bruno falls back through summary, operationId, description, then method and path. Derived names are cleaned to a single line, with markdown stripped and length capped.

Place auth on the collection with --auth-placement

--auth-placement applies only to OpenAPI imports. It does not affect Postman or WSDL imports.
By default, Bruno writes a full auth block on each request (--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
Where:
  • <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:
For bulk Postman migrations, loop over exported collections:
See GitHub Actions for a complete workflow.

Next steps