Application commands
Application Inventory is available on Postman Solo, Team, and Enterprise plans. For more information, see the pricing page.
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. The postman app commands require the repository to be linked to a Postman workspace (Git-connected).
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 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.
Usage
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 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.
Usage
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
- Run UI tests — Runs the UI test command you specify with the
postman app initcommand. If you provide the--network-logoption, Postman analyzes the specified capture artifacts instead of relying on automatic artifact discovery. - Capture traffic — Observes the network requests and responses generated during the run, or loads them from the specified network log artifacts.
- Match requests — Maps captured calls to requests in the configured collections using method, path, query, and optional body hints.
- Validate responses — Runs
pm.testassertions on matched responses. - Report results — Reports assertion failures, unmatched calls, and coverage gaps. 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.