This topic covers workspace management commands for the Postman CLI.
The Postman CLI includes workspace commands to validate, synchronize, and push local collections, environments, and specifications to Postman workspaces in the cloud. Add the commands to your CI/CD script to automate these tasks during the deployment process. Learn more about adding workspace commands to your CI/CD pipeline.
postman workspace prepareThis command validates and prepares local collections and environments for pushing to a Postman workspace. It checks for valid UUIDs, regenerates IDs if needed, and ensures all items and responses have proper IDs.
Path to the collections directory.
Path to the environments directory.
The command expects a .postman/resources.yaml file in your working directory.
Collection and environment paths can be relative (resolved from .postman/) or absolute. Only valid JSON files are processed. Invalid paths like empty strings and non-JSON files are automatically filtered with warnings.
Learn more at Native Git workflows.
postman workspace pushThis command pushes local collection, environment, and specification changes to your Postman workspace. It synchronizes your local files with the workspace in the Postman cloud, performing create, update, and delete operations as needed.
To use this command, sign in to Postman with the postman login command.
Path to the collections directory.
Path to the environments directory.
Skip the prepare step before pushing.
Skip all confirmation prompts.
--no-prepare) — Runs prepare automatically if invalid or missing IDs are detected.The command expects a .postman/resources.yaml file in your working directory. If the resources.yaml file contains collection, environment, or specification paths, those specific files are used instead of directory scanning.
The .postman/workflows.yaml file stores the links and their settings for collections generated from specifications and specifications generated from a collection. When you run the postman workspace push command, it pushes the link, the link’s settings, and any changes to them to the cloud.
The postman workspace push command doesn’t sync changes between a specification and its linked collection. To apply changes from a specification to its collection or a collection to its specification, manually update the collection or specification.
The system creates the workflows.yaml file when:
If the file already exists and you perform one of these actions in Local View, the system adds a new sync entry in the workflows.yaml file.
Learn more at Native Git workflows.