Skip to main content

CLI to convert Postman collections into Insomnia imports

Project description

pm2insomnia icon
pm2insomnia

Tests Python 3.11+ Code style: Ruff MIT License

Move your Postman collections to Insomnia in seconds — no manual work.

InstallUsageWhat gets convertedLicense


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

  1. Open Insomnia → Import
  2. Select the .insomnia.json file
  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pm2insomnia-0.1.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pm2insomnia-0.1.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

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

Hashes for pm2insomnia-0.1.0.tar.gz
Algorithm Hash digest
SHA256 92b4fc40ca14a9d920a137684462ead08c27f29f8b1c15965c716a05011f6bf3
MD5 4f8ccce1381a01b9dff582234bbc4990
BLAKE2b-256 c60930f5a6c3e5620ffedbc2ce07c6cd101adb206e81f2bc21b1f39d8b52298e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pm2insomnia-0.1.0.tar.gz:

Publisher: publish-package.yml on antonillos/pm2insomnia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pm2insomnia-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b13c5139403533ad8e08e38d72f103d9a4cbe6d94cbdfc0b19b38e896bdfcfa4
MD5 a0a5f0e1eb82a048400e9a30f37c65db
BLAKE2b-256 3742ae58b816479611c2908fc942cfb1c694413eb3222b67a92b1f40c20319f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pm2insomnia-0.1.0-py3-none-any.whl:

Publisher: publish-package.yml on antonillos/pm2insomnia

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page