Explore Postman’s command-line companion
The Postman CLI is a secure command-line companion for Postman. It’s signed and supported by Postman, like the Postman app. The Postman CLI supports the following features:
- Sign in and sign out of Postman from the command line.
- Validate, synchronize, and push local collections and environments to Postman workspaces in the cloud.
- Run a collection with its collection ID or path, and send the run results to the Postman cloud by default.
- Run a monitor in the Postman cloud with its monitor ID.
- Start a runner in your internal network to monitor APIs with private endpoints.
- Generate a local collection run report with built-in reporters.
- Check API definitions against configured API governance and API security rules.
The Postman CLI requires a valid Postman API key. For more information, see Generate and use Postman API keys.
Comparing the Postman CLI and Newman
The table below shows a high-level comparison of the Postman CLI and Newman.
Decide which command-line companion to use
You can use the Postman CLI or Newman to run and test collections from the command line. One may be a better fit, 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 the 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.
Learn how to install the Postman CLI.
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 monitor run- Uses one call to fetch a monitor by ID, one call to start a monitor run, and multiple calls that poll Postman for the run’s completion.postman spec lint- Uses one call to fetch the API governance rules and one call to send a report back to Postman.postman api lint- Uses one call to fetch the API governance and security rules and one call to send a report back to Postman.
Learn more about Postman CLI command options.