Skip to main content
The bru import command converts API specifications from other formats (OpenAPI, WSDL) into Bruno collections, making it easy to migrate existing API documentation or create collections from API specs.

Synopsis

Arguments

string
required
Type of collection to import. Supported values:
  • openapi - Import from OpenAPI/Swagger specification (JSON or YAML)
  • wsdl - Import from WSDL (Web Services Description Language)

Options

Source

string
required
Path to the source file or URL. Supports:
  • Local file paths (absolute or relative)
  • HTTP/HTTPS URLs
  • For OpenAPI: .json, .yml, or .yaml files
  • For WSDL: .wsdl or .xml files
Examples:
  • --source api.yml
  • --source https://example.com/api-spec.json

Output

string
Path to the output directory where the Bruno collection will be created.
  • If the path is an existing directory, a new subdirectory will be created using the collection name
  • If the path doesn’t exist, it will be created as the collection directory
  • The parent directory must exist
Conflicts with --output-file.Example: --output ~/Desktop/my-collection
string
Path to the output JSON file. Instead of creating a Bruno collection directory structure, this exports the collection as a single JSON file.Conflicts with --output.Example: --output-file ~/Desktop/my-collection.json
You must specify either --output or --output-file, but not both.

Collection Configuration

string
Name for the imported collection. If not specified, the collection name is derived from:
  • The OpenAPI spec’s info.title field
  • The WSDL service name
  • The source filename
Example: --collection-name "My API"
string
default:"opencollection"
Format of the imported collection files. Available formats:
  • opencollection - Uses YAML format (.yml files) for the collection structure
  • bru - Uses Bruno’s native .bru format
Example: --collection-format bru

OpenAPI-Specific Options

string
default:"tags"
How to group the imported requests. Only applicable for OpenAPI imports.Available options:
  • tags - Group requests by OpenAPI tags (default)
  • path - Group requests by URL path structure
Example: --group-by path

Network & Security

boolean
default:"false"
Skip SSL certificate verification when fetching from URLs. Useful when importing from servers with self-signed certificates.
Use with caution. Only use this option when importing from trusted sources.
Example: --source https://self-signed.example.com/api.json --insecure

Exit Codes

Success
Import successful - collection created or JSON file written
Error
Import failed due to one of the following reasons:
  • Unsupported import type
  • Missing required options (source, output, or output-file)
  • Source file or URL not found
  • Failed to parse the specification
  • Invalid specification format
  • Output directory does not exist
  • Output directory is not empty
  • Network error when fetching from URL
  • SSL certificate error

Examples

OpenAPI Import

Basic Import from Local File

Import from a local OpenAPI YAML file:
Using short aliases:

Import from URL

Import from a remote OpenAPI specification:
Import from URL with self-signed certificate:

Export as JSON

Export the imported collection as a single JSON file:
Short form:

Grouping Options

Group requests by OpenAPI tags (default):
Group requests by URL path structure:
Short form:

Collection Format

Import as Bruno native format:
Import as OpenCollection format (YAML):

WSDL Import

Basic Import from Local File

Import from a local WSDL file:
Short form:

Import from URL

Import from a remote WSDL:
Short form:

Understanding OpenAPI Grouping

Group by Tags (Default)

When using --group-by tags, the importer creates folders based on OpenAPI tags:
Results in:

Group by Path

When using --group-by path, the importer creates folders based on URL structure:
Results in:

Collection Formats

OpenCollection Format (YAML)

The opencollection format uses YAML files:

Bruno Native Format

The bru format uses Bruno’s native .bru files:

Error Handling

Common Errors

Source not found:
Solution: Check the file path or URL. Network errors:
Solution: Verify the URL is accessible and your network connection is working. SSL certificate errors:
Solution: Use the --insecure flag if you trust the source. Invalid specification:
Solution: Verify the specification file is valid JSON or YAML. Output directory issues:
Solution: Ensure the parent directory exists before running the import. Directory not empty:
Solution: Choose a different output path or clear the existing directory.

Network Timeouts

When importing from URLs, the command has a 30-second timeout. If the source is large or the network is slow, the import may fail:
In this case, download the specification file locally and import from the file:

Size Limits

The importer has a maximum content length limit of 10 MB for URL imports. For larger specifications, download the file locally first.