Working locally with Postman - Introducing Postman CLI

Hi everyone,

I’ve been engaged with a project to see how we can enable the editing, version control and general management of Postman scripts, requests and responses on the local file system, instead of through the Postman app.

The idea behind this is to allow for things like:

  • Being able to write code in your chosen editor
  • Ability to apply your own lint rules
  • Using packages from npm you aren’t otherwise able to include
  • Working from files/folders on your machine, version controlling them in the same way as the rest of your API code

I’ve created a CLI which allows you to get started with this. All you need is:

  • A Postman API key
  • Node version 10.12 or later

You can find the README and instructions for install here:

We’ve been testing this CLI in a few different places, and would be really keen to hear what the community makes of it. I’m welcoming all bugs, feedback and comments either here or in the Issues tab of the repo.

If you’re using Postman in a team setting - feel free to drop me a message - I’d be happy to give your team a demo/walkthrough of the capability.

Cheers,
Matt

7 Likes

Awesome stuff @matt :trophy:

I was wanting this also. I think there have been some posts on the forums asking for something similar. This would make it very handy. I might test this out on my side projects to get a feel for it. But I definately love this ide!.

2 Likes

@matt - So the main point of this is working on Postman scripts locally instead of in the app?

Or what is the main use case?

I can’t say I’m super familiar with Newman, but is this something you can’t do with Newman?

Looking at your Github, I saw your “postman-read-file”. I need to try this out, been looking for something like this :slight_smile: :grinning:

@TreyT - exactly, therefore by editing them locally you can version control those files like all your other code too.

Newman is for executing collection runs at the command line or through a script. This is particularly useful if your collection is full of tests and you want to run them in CI.

There isn’t any overlap between the two as things stand.

Glad to hear the read file project might be useful to you!

1 Like

Too busy right now to play with it but it looks awesome! Keep up and thank you.

Could not get beyond “postman setup”. When I enter the API Key, it always comes back with Invalid Postman Api key!

Does that API key work for other Postman API interactions?

Try creating a new key here?

https://go.postman.co/settings/me/api-keys

I have tried regenerating a new key several times. It still won’t work. I have no other Postman API interactions. I was hoping to use Postman CLI because I have a npm package that I need to include.

Assuming there are no issues with how you’re pasting the key, I would try making a request to our API through Postman:

https://documenter.getpostman.com/view/631643/JsLs/?version=latest#647806d5-492a-eded-1df6-6529b5dc685c

If you still have issues, please message me!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.