Postman 10.x Tutorial (Latest) - Using the Postman CLI

preview_player
Показать описание
Postman CLI is a command line tool which is secured and supported by Postman.

Postman CLI can be used to:
- Run a collection using its ID or path
- Send run results to Postman
- Log in and Log out using the API Keys
- Check API definitions

Difference between Postman CLI and Newman:
- Postman CLI is maintained and supported by Postman but Newman is supported by community
- Postman CLI is distributed as a downloadable package but Newman is distributed on npm
- Postman CLI is not available as a library but Newman is available as a library
- Postman CLI supports login and log out but Newman doesn't support this feature

Command to install Postman CLI on Windows:

Command to install Postman CLI on Mac:

Command to install Postman CLI on Linux:

Postman CLI Commands:

postman -v : Returns the version of the Postman CLI
postman -h: Returns information about Postman CLI commands
postman login --with-api-key [api-key]: Authenticates the user and caches locally
postman logout: Logs out the user from Postman and deletes the API key
postman collection run [collection-id]

Example:
postman login --with-api-key {{postman-api-key-here}}
postman collection run [collection-id] -e [environment-id]
Рекомендации по теме