CLI to convert Postman collections into Insomnia imports
Project description

pm2insomnia
Move your Postman collections to Insomnia in seconds — no manual work.
Install • Usage • What gets converted • License
If your team exports collections from Postman but you prefer working in Insomnia, pm2insomnia does the conversion for you. Drop in a Postman export, get an Insomnia file ready to import — folders, requests, environments, auth, and examples included.
Install
The easiest way is with pipx, which installs the tool globally and keeps it isolated from your Python environment:
pipx install pm2insomnia
That's it. The pm2insomnia command is now available anywhere in your terminal.
Don't have pipx? Install it first:
pip install pipx
Usage
Convert a collection
pm2insomnia convert --input my-collection.postman.json
This creates my-collection.insomnia.json in the same folder. Open Insomnia, go to Import, and select that file.
Want to include your Postman environments too?
pm2insomnia convert \
--input my-collection.postman.json \
--environment my-environments.json
Export a versioned bundle
If you want to store the collection and API docs together in a repository:
pm2insomnia bundle \
--input my-api-1.9.1.postman.json \
--workspace-name "My API" \
--output-dir exports/
This generates a tidy folder structure:
exports/
collections/my-api/1.9.1/my-api.insomnia.json
api-docs/my-api/1.9.1/README.md
You can also attach an OpenAPI spec:
pm2insomnia bundle \
--input my-api-1.9.1.postman.json \
--workspace-name "My API" \
--spec openapi.yaml \
--environment environments.zip \
--output-dir exports/
Importing in Insomnia
- Open Insomnia → Import
- Select the
.insomnia.jsonfile - Done — your collection, environments, and examples are ready
Options
| Flag | What it does |
|---|---|
--input |
Path to your Postman collection JSON |
--environment |
Postman environment file (.json or .zip). Repeat for multiple files |
--output |
Where to write the Insomnia file (default: same folder as input) |
--output-dir |
Write the output into a specific directory |
--workspace-name |
Override the workspace name shown in Insomnia |
--pretty |
Format the JSON output so it's readable |
--strict |
Fail with exit code 2 if anything couldn't be converted |
What gets converted
✅ Folders and subfolders
✅ Requests — method, URL, headers, query params
✅ Request and folder descriptions
✅ Body — raw, form, and URL-encoded
✅ Path variables
✅ Bearer auth
✅ Saved response examples
✅ Collection variables → Insomnia base environment
✅ Postman environments → Insomnia sub-environments
What doesn't convert
These Postman features have no direct equivalent in Insomnia and are skipped. The tool will warn you when it encounters them:
- Pre-request and test scripts
- Auth types other than Bearer
- GraphQL body mode
- Variable resolution (placeholders are kept as-is)
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pm2insomnia-0.1.0.tar.gz.
File metadata
- Download URL: pm2insomnia-0.1.0.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92b4fc40ca14a9d920a137684462ead08c27f29f8b1c15965c716a05011f6bf3
|
|
| MD5 |
4f8ccce1381a01b9dff582234bbc4990
|
|
| BLAKE2b-256 |
c60930f5a6c3e5620ffedbc2ce07c6cd101adb206e81f2bc21b1f39d8b52298e
|
Provenance
The following attestation bundles were made for pm2insomnia-0.1.0.tar.gz:
Publisher:
publish-package.yml on antonillos/pm2insomnia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pm2insomnia-0.1.0.tar.gz -
Subject digest:
92b4fc40ca14a9d920a137684462ead08c27f29f8b1c15965c716a05011f6bf3 - Sigstore transparency entry: 1279078314
- Sigstore integration time:
-
Permalink:
antonillos/pm2insomnia@b6c1bcf7abc95f91adb774bc67ed29a3ae9a5665 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/antonillos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@b6c1bcf7abc95f91adb774bc67ed29a3ae9a5665 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pm2insomnia-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pm2insomnia-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b13c5139403533ad8e08e38d72f103d9a4cbe6d94cbdfc0b19b38e896bdfcfa4
|
|
| MD5 |
a0a5f0e1eb82a048400e9a30f37c65db
|
|
| BLAKE2b-256 |
3742ae58b816479611c2908fc942cfb1c694413eb3222b67a92b1f40c20319f1
|
Provenance
The following attestation bundles were made for pm2insomnia-0.1.0-py3-none-any.whl:
Publisher:
publish-package.yml on antonillos/pm2insomnia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pm2insomnia-0.1.0-py3-none-any.whl -
Subject digest:
b13c5139403533ad8e08e38d72f103d9a4cbe6d94cbdfc0b19b38e896bdfcfa4 - Sigstore transparency entry: 1279078321
- Sigstore integration time:
-
Permalink:
antonillos/pm2insomnia@b6c1bcf7abc95f91adb774bc67ed29a3ae9a5665 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/antonillos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-package.yml@b6c1bcf7abc95f91adb774bc67ed29a3ae9a5665 -
Trigger Event:
workflow_dispatch
-
Statement type: