Workspace commands
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 prepare
This 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.
Usage
Options
Path to the collections directory.
Path to the environments directory.
Configuration
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.
Examples
Learn more at Native Git workflows.
postman workspace push
This 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.
Usage
Options
Path to the collections directory.
Path to the environments directory.
Skip the prepare step before pushing.
Skip all confirmation prompts.
Workflow
- Validate - Checks if the collections, environments, and specifications exist globally and in the target workspace.
- Prepare (unless
--no-prepare) - Runs prepare automatically if invalid or missing IDs are detected. - Sync - Creates, updates, or deletes entities to match your local state.
- Update Local Files - After successful creation, updates local files with server-returned IDs.
Configuration
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.
Examples
Push with automatic prepare and interactive prompts
Push without the prepare step
Automatic push without prompts (useful for CI/CD)
Learn more at Native Git workflows.