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.1.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.1-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file pm2insomnia-0.1.1.tar.gz.

File metadata

  • Download URL: pm2insomnia-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 15b4487ccc616d9e3a93e8063c6c4e640ed6ef0f50fb12e1a22d5b46312a6481
MD5 e68c9a529a19c523084df4bc6bf9192c
BLAKE2b-256 a72f17747e5626cffe7246779aa914fb4a34b832cc527500b4c8643563a182fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pm2insomnia-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: pm2insomnia-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 76d4866eb46068b376b77a89606f1ed87bbfc6b2b67cf30df8a6263fa1cf3bfb
MD5 14532acd87d6eba6ecf9ab28098d6726
BLAKE2b-256 d3d56bc6cb2a074f3dcfa5bf2bfc50bb5149a95bac17fc3e949d945d49a54a5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pm2insomnia-0.1.1-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