As the majority of Bruno users are transitioning from another tool, we support the import of different file formats directly inside the desktop app, including the automatic conversion of scripts/tests from Postman to Bruno.
However, sometimes you may want to do this programmatically. Whether it's collections in a different format you regularly receive from another team, or perhaps every time your OpenAPI spec gets updated, you want a Bruno collection created.
For these situations, we're happy to provide a set of Bruno Converters! In this blog we'll walk through how to install the converters, using them ad-hoc, and even integrating them into a CI/CD workflow.
The Bruno Converters package is an official utility for converting files to Bruno collections. It helps you:
π Migrate your API collections from Postman, Insomnia, or OpenAPI into Bruno's collection format
π Automate the conversion process as part of your scripts or CI workflows
πΎ Preserve your folder structures, requests, and environments for a smooth transition
Whether you're switching tools or simply want to consolidate your collections into Bruno for Git-based workflows, this package helps you get there with minimal effort.
The package currently supports converting the following file types:
β Postman (Collection and Environment)
β Insomnia Collection
β OpenAPI (YAML or JSON)
To install Bruno converters on the system, you need:
In this example we're going to use a Postman collection which is available on this GitHub repo. You can clone the entire repo or only download the collection (demo_collection.postman_collection.json) from the repository. This repo also contains script.js, which will help you to convert the Postman collection to Bruno, or you can follow the script mentioned below for the same.
You can install the Bruno converters package with your favourite node manager, such as NPM, Yarn or PNPM. In this example we're going to use NPM.
# with npm
npm install @usebruno/converters
# with yarn
yarn add @usebruno/converters
# with pnpm
pnpm add @usebruno/converters
π‘ Pro Tip: You can install this package globally by adding -g
after npm i
to use it across your system.
The folder structure or project setup for this example is easy.
Make sure to replace path/to/postman-collection.json
with β£demo_collection.postman_collection.json or any of your Postman collections you have inside your postman-to-bruno folder. Also, it'path/to/bruno-collection.json'
could be any name of your choice just make sure to add .json at the end.
// script.js
const { postmanToBruno } = require('@usebruno/converters');
const { readFile, writeFile } = require('fs/promises');
async function convertPostmanToBruno(inputFile, outputFile) {
try {
const inputData = await readFile(inputFile, 'utf8');
const brunoCollection = postmanToBruno(JSON.parse(inputData));
await writeFile(outputFile, JSON.stringify(brunoCollection, null, 2));
console.log('Conversion successful!');
} catch (error) {
console.error('Error during conversion:', error);
}
}
convertPostmanToBruno(
'path/to/postman-collection.json',
'path/to/bruno-collection.json'
);
Read the official Bruno docs for more details.
Feature | Benefit |
---|---|
π Supports multiple formats | Migrate from Postman, Insomnia, or OpenAPI |
π¦ Install via npm or yarn | Easy to set up |
π§° Programmatic and scriptable | Automate migrations in CI/CD pipelines |
πΎ Outputs local bruno.json files | Fully compatible with Bruno |
Migrating to Bruno doesnβt mean you have to leave your existing API collections behind. With the official Bruno Converters, you can bring over your Postman, Insomnia, or OpenAPI collections and environments in just a few lines of code.
Whether youβre automating your workflows or just testing out Bruno, this tool ensures a smooth, scriptable, and flexible migration.
π Ready to make the switch? Install the converter, import your collections, and let Bruno take care of the rest.
Happy converting! β‘