{"id":17047,"library":"postman-cli","title":"Postman CLI","description":"The Postman CLI is the official command-line companion for the Postman API platform, enabling developers to automate API development, testing, and integration into CI/CD pipelines. It allows users to run Postman Collections, execute monitors, and enforce API governance rules directly from the terminal. The current stable version is 1.34.1, indicating active development with regular updates to support the evolving Postman ecosystem. Key differentiators include its tight integration with Postman's cloud platform, providing a seamless bridge between collaborative API design and automated execution, and its capability to enforce quality gates in CI/CD workflows. It is a lightweight tool designed for local debugging, scaling systems, and embedding API workflows into build systems, supporting macOS, Linux (x64 & ARM64), and Windows (x64) platforms.","status":"active","version":"1.34.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","postman","cli","api","testing","automation","rest","newman","api-testing"],"install":[{"cmd":"npm install postman-cli","lang":"bash","label":"npm"},{"cmd":"yarn add postman-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add postman-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Platform-specific binary required for CLI execution, downloaded as an optional dependency during installation.","package":"@postman/cli-<platform>-<arch>","optional":true}],"imports":[],"quickstart":{"code":"npm install -g postman-cli\n\n# Get help and verify installation\npostman --help\n\n# Sign in to Postman using an API key (replace with your actual API key or environment variable)\n# It's recommended to use environment variables for sensitive data.\npostman login --with-api-key \"${process.env.POSTMAN_API_KEY || 'pk_YOUR_API_KEY'}\"\n\n# Run a Postman collection (replace with your actual collection ID and environment ID)\npostman collection run \"<collection-id>\" -e \"<environment-id>\"\n\n# Check API governance and security rules for a specific API (replace with your actual API ID)\npostman api lint \"<api-id>\"","lang":"bash","description":"Installs the Postman CLI globally, demonstrates how to get help, log in using an API key, run a collection with an environment, and lint an API for governance rules."},"warnings":[{"fix":"Ensure these flags are not used during installation. If present, remove `optional=false` from your `.npmrc` file and retry installation.","tags":["installation","npm","optional-dependencies"],"message":"Installation failures can occur if `npm install` is run with `--no-optional` or `--omit=optional` flags, preventing the download of necessary platform-specific binaries.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use a supported Linux distribution (x64 & ARM64, excluding Alpine) or refer to the official documentation for alternative installation methods.","tags":["platform-support","linux","alpine"],"message":"Users on unsupported Linux distributions, specifically Alpine Linux, will encounter `libc` compatibility issues as the distributed CLI binaries are not compatible.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Verify network connectivity and ensure your npm registry configuration allows access to packages under the `@postman` scope.","tags":["network","npm","installation"],"message":"Network or npm registry access issues can prevent the download of `@postman/*` scoped optional packages, leading to incomplete installation and 'Binary not found' errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Utilize environment variables (e.g., `POSTMAN_API_KEY`) for authentication and sensitive data. In CI/CD, integrate with your platform's secret management.","tags":["security","api-keys","environment-variables","ci-cd"],"message":"When running collections that involve sensitive data (like API keys), ensure they are handled securely, preferably via environment variables or a secure CI/CD secret management system, rather than hardcoding them in scripts.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Reinstall the CLI globally using `npm install -g postman-cli`, ensuring no `--no-optional` or `--omit=optional` flags are used. Check your `.npmrc` file for `optional=false` and verify network access to `@postman/*` packages. Ensure your system's PATH includes the global npm binary directory.","cause":"The platform-specific Postman CLI executable was not successfully downloaded during installation or is inaccessible in the system's PATH.","error":"Binary not found"}],"ecosystem":"npm","meta_description":null}