Environment commands
This topic covers environment commands for the Postman CLI.
Environments let you group sets of variables that you can reuse and switch between in Postman. You can use environment commands to validate your local environment files before you push them to a Postman workspace.
postman environment lint
This command checks that a local environment file is valid YAML and has the expected structure, field types, and required fields.
Usage
Path to a Postman environment file or directory to lint.
Options
Specifies the format of the lint results printed to the terminal. Accepted values are cli (human-readable output), table (a human-readable table), json, and csv. Results print to the terminal rather than saving to a file. To save the results, redirect the output to a file, for example --output json > results.json.
The command always lints everything and reports all issues. This option only sets the exit code, returning a failure code if any diagnostics are at this severity level or higher.
With error, the command returns a failure code only if errors are present. With warning, it returns a failure code whether warnings or errors are present. The failure code matters most in CI/CD, where it can stop the pipeline before invalid entities reach the cloud, or fail a pull request check.