> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Application commands

Application Inventory is available on Postman Solo, Team, and Enterprise plans. For more information, see the [pricing page](https://www.postman.com/pricing/).

You can use the Postman CLI to initialize application configuration, run UI tests with network capture, validate observed API traffic against Postman Collections, and send results to Postman's [Application Inventory](/docs/tests-and-scripts/test-applications/overview). The `postman app` commands require the repository to be linked to a Postman workspace ([Git-connected](/docs/use/native-git/overview#connect-your-git-project-to-your-workspace)).

## `postman app init`

This command initializes application testing in the current repository by creating a `postman.config.cjs` file in your project's root directory. Use the configuration file to define the targets, collections, environments, and filters used during application test runs. Targets enable you to select different collections and environments for different runtime setups, such as `default`, `staging`, or `prod`.

Learn more about [using `postman app init`](/docs/tests-and-scripts/test-applications/test#initialize-your-application) to initialize your project as an application.

To use this command with persistent data in the cloud, sign in to Postman with [the `postman login` command](/docs/postman-cli/postman-cli-auth/#postman-login).

### Usage

```bash
postman app init
```

## `postman app test`

This command runs your application's existing UI test command, captures the network traffic generated during the run, and validates observed API calls against requests in your collections. For matched calls, the command runs the `pm.test` assertions defined in the collection against the observed responses. It also reports unmatched calls and coverage gaps.

The command captures information only if the capture plugin is already set up on the tests. You can install it with `npm install postman-playwright` and set it up manually, or ask Postman Agent Mode to do it for you when you run `postman app init`.

When configured, the command also sends test results and detected dependencies to the Application Inventory. Learn more about [using `postman app test`](/docs/tests-and-scripts/test-applications/test#run-the-tests) to run your application's UI tests.

To use this command with persistent data in the cloud, sign in to Postman with [the `postman login` command](/docs/postman-cli/postman-cli-auth/#postman-login).

### Usage

```bash
postman app test [options]
```

### Options

UI test command to run.

A named runtime setup in `postman.config.cjs` (such as `default`, `staging`, or `prod`) that selects which collections and environment a given test run uses.

Override the collection defined in the selected target.

Override the environment defined in the selected target.

Capture traffic without validation and generate a draft collection from the observed requests.

Overwrite the output directory when using the `--capture-only` option, even if the directory already exists and has files.

Path to the captured network traffic artifacts to analyze. You can provide a Playwright JSON report file, a network capture file, or a directory with supported artifacts. When a directory is provided, Postman automatically discovers Playwright reports, associated traces, and network capture files. By default, Postman searches the Playwright `outputDir`, `test-results/`, and `pm-results/` directories.

Send application test results and analytics to the Application Inventory in Postman.

### Workflow

1. **Run UI tests** — Runs the UI test command you specify with the `postman app init` command. If you provide the `--network-log` option, Postman analyzes the specified capture artifacts instead of relying on automatic artifact discovery.
2. **Capture traffic** — Observes the network requests and responses generated during the run, or loads them from the specified network log artifacts.
3. **Match requests** — Maps captured calls to requests in the configured collections using method, path, query, and optional body hints.
4. **Validate responses** — Runs `pm.test` assertions on matched responses.
5. **Report results** — Reports assertion failures, unmatched calls, and coverage gaps. Git metadata for the commit is also captured automatically and sent with run analytics. Git metadata includes tags, parent commits, `git describe` output, Git notes, and working tree state. When configured, the command also sends results and detected dependencies to the Application Inventory.

### Configuration

The `postman app test` command expects a `postman.config.cjs` file in your working directory.

The configuration file defines the targets used during a run. Each target can specify a collection and an environment. You can override those values at runtime with `--target-collection` and `--target-environment`.

You can also use the `filters` section in `postman.config.cjs` to exclude noisy traffic from validation, such as font requests, localhost traffic, or other requests that aren't part of your API surface. Learn how to [filter out irrelevant traffic](/docs/tests-and-scripts/test-applications/test#filter-out-irrelevant-traffic).

### Examples

```bash
postman app test
postman app test --target staging
postman app test --capture-only
postman app test --network-log playwright-report.json
```