Explore Postman's command-line companion

The Postman CLI is a secure command-line companion for Postman. It's secured and supported by Postman. The Postman CLI enables you to:

  • Run a collection with its collection ID or path.
  • Send run results to Postman by default.
  • Supports sign in and sign out.
  • Check API definitions against configured API Governance and API Security rules

Comparing the Postman CLI and Newman

The table below shows some high-level differences between the Postman CLI and Newman.

Postman CLINewman
Created by PostmanCreated by Postman
Maintained and supported by PostmanOpen source; supported by community contributions
Supports collection runsSupports collection runs
Automatically sends collection run results to Postman by defaultSupports ingesting run results to Postman using a reporter
Package is signed by PostmanPackage isn't signed by Postman
Distributed as a downloadable packageDistributed on npm
Downloadable programmaticallyDownloadable programmatically
Not available as a libraryAvailable as a library
Supports sign in and sign outDoesn't support sign in and sign out
Checks API definition against configured API Governance and API Security rulesDoesn't check API definition against configured API Governance and API Security rules

Deciding which command-line companion to use

Both the Postman CLI and Newman enable you to run and test collections directly from the command line. One may be a better fit than the other, depending on your use case or preferences.

For example, assume you already manage your own security for open-source software, and you want to run collections from a script. Also assume you want visibility into any software you build into your CI/CD pipeline. Newman would be a good fit for this use case because Newman's repository is public and Newman isn't signed or secured by Postman.

Here's another example. Assume you don't already support or secure any open-source software, and you want any software you use to be signed and secured by its developer. The Postman CLI would be a good fit for this use case because the Postman CLI is signed and secured by Postman.

About the Postman CLI and Postman API usage

Some Postman CLI commands use the Postman API to fetch data from and send data to Postman's servers. These commands count toward your monthly Postman API usage. The number of Postman API calls you can make each month depends on your Postman plan.

The following Postman CLI commands make calls to the Postman API and count toward your Postman API usage:

  • postman login - Uses one call to authenticate a user with a Postman API key.
  • postman collection run - Uses one call to fetch a collection by ID, one call to fetch an environment (if any), and one call to send data back to Postman.
  • postman api lint - Uses one call to fetch the governance and security rules and one call to send a report back to Postman.

Learn more about Postman CLI command options.

Last modified: 2023/03/20