> This page is for Postman Docs, version Latest (v12) (default).
> For other versions, use one of these documentation indexes:
> - Latest (v12) (default): https://learning.postman.com/latest-v-12/llms.txt
> - v11: https://learning.postman.com/v11/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt.

# Newman CLI Overview

> Newman is Postman's command-line collection runner. The Postman CLI does more, with the latest Postman capabilities.

> **Info**
>
> Newman is Postman's command-line collection runner. The [Postman CLI](/docs/postman-cli/postman-cli-overview/) does more, with the latest capabilities: the collection v3 format, [Native Git](/docs/use/native-git/overview) workflows, mock servers, monitors, API governance, and coding agents. To get started, run `npm install -g postman-cli`, then run [`postman init`](/docs/postman-cli/postman-cli-init). To convert your existing Newman commands, see [Migrate scripts from Newman to the Postman CLI](/docs/reference/newman-cli/migrate-to-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](https://github.com/postmanlabs/newman).

## Install Newman

Newman requires [Node.js](https://nodejs.org/en/download/package-manager/) v16 or later. To install Newman globally, run the following command:

```bash
npm install -g newman
```

## Run a collection with Newman

To run a collection with Newman, [export the collection](/docs/getting-started/importing-and-exporting/exporting-data/#export-collections) as a JSON file. If the collection uses environment variables, [export the environment](/docs/getting-started/importing-and-exporting/exporting-data/#export-environments) too. Then run the collection with the following command:

```bash
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](/docs/tests-and-scripts/write-scripts/packages/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](https://hub.docker.com/r/postman/newman/).

## 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.

> **Warning**
>
> 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](/docs/reference/newman-cli/migrate-to-postman-cli) and [Use the Postman CLI with AI agents and CI/CD](/docs/postman-cli/postman-cli-agents-and-ci/).