After reviewing guidance from the Postman Community on the Postman CLI, I decided to migrate my CI/CD pipelines from Newman to the Postman CLI. Here is a summary of the process and the results.
Install
Using a Package Manager
- npm (Node Package Manager):
If you have Node.js and npm installed, you can install the Postman CLI globally with:
bash
npm install -g postman-cli
This method makes the postman command available in your terminal.
- Homebrew (macOS):
Use Homebrew to install the Cask for the Postman CLI:
bash
brew install –cask postman-cli
Step 1: Running a Collection with the Postman CLI
I began by running my existing suite of Postman tests directly from the terminal using the Postman CLI.

To specify the environment, I used the -environment (or -e) flag in the CLI command.
The test results in the terminal matched the expected outcomes based on my previous Newman runs.
Step 2: Integrating Postman CLI into a CI/CD Pipeline
I have several Postman jobs running on a scheduled basis in Azure DevOps using a shared CI template, where I pass multiple collections and environments.
To migrate to the Postman CLI:
- I replaced the Newman installation steps with Postman CLI installation commands.
- I updated all newman run commands to postman collection run.
- I had to adjust permissions due to these changes, particularly around modified NPM steps—AI assistance helped clarify the required permissions.
Below is an example of the Git changes introduced as part of this update.

The pipeline results confirmed that execution using Postman CLI on the server produced the same results as running locally.


Benefits
One key advantage of this updated setup is automation.
Automated daily test runs help validate that dependent APIs across multiple environments are responding correctly. This provides far more consistent, proactive monitoring than running collections locally.
Suggestions for Improving the Postman CLI
One improvement I would like to see in the Postman CLI is support for passing multiple collections or environments in a single command, rather than executing each one individually.
For example, something like:
postman collection run {col1, col2, col3} -e {env1, env2, env4}
This would simplify pipeline configuration and reduce the amount of repetitive scripting required.
