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 execute.
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.
Workflow
- Run UI tests — Executes the UI test command you specify with
postman app initcommand. - Capture traffic — Observes the network requests and responses generated during the run.
- 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.