Skip to navigation

Newman CLI Overview

View as Markdown

Newman is deprecated and no longer maintained. It can’t run collections in the v3 format that Postman v12 and later uses for Local View and Native Git workflows, and it only supports running collections. Use the Postman CLI instead. To convert your existing Newman commands, see Migrate scripts from Newman to the Postman CLI.

Newman is an open-source command-line tool for running Postman Collections in the v2.1 JSON format. This page covers the basics for existing Newman users. For the complete Newman reference, including all command options, reporters, file uploads, and using Newman as a Node.js library, see the Newman README on GitHub.

Install Newman

Newman requires Node.js v16 or later. To install Newman globally, run the following command:

npm install -g newman

Run a collection with Newman

To run a collection with Newman, export the collection as a JSON file. If the collection uses environment variables, export the environment too. Then run the collection with the following command:

newman run my-collection.json -e my-environment.json

Newman doesn’t support OAuth 2.0 authentication or scripts in your team’s Package Library.

Use Newman in CI

By default, Newman exits with a status code of 0 if the run completes without errors. Use the --bail option to stop the run and exit with a status code of 1 when a test fails, so your continuous integration (CI) tool can fail the build. To run Newman in a container, use the Newman Docker image.

Migrate to the Postman CLI

The Postman CLI runs collections in every format, including v3, and supports most of Newman’s options with the same syntax. It also works with monitors, mock servers, Native Git workflows, and other Postman features that Newman doesn’t support.

Newman won’t receive updates or fixes. Plan to replace Newman in your scripts and CI pipelines with the Postman CLI. To get started, see Migrate scripts from Newman to the Postman CLI and Use the Postman CLI with AI agents and CI/CD.