Dependency commands
This topic covers dependency commands for the Postman CLI.
Workspace dependencies let you reuse a collection, environment, or mock from another workspace in your local project.
postman dependency add
Adds a collection, environment, or mock from another workspace as a dependency of your local project, so you can reuse it. The command copies the element into your project’s postman/.dependencies/ directory and records it in your .postman/resources.yaml file.
Usage
<type>
The type of element to add as a dependency: collection, environment, or mock.
<nameOrId>
The name or ID of the element to add.
Options
-w, --workspace <id>
The ID of the workspace the dependency comes from. Defaults to the current workspace.
-y, --yes
Skips all confirmation prompts.
--json
Prints the result as JSON for machine-readable output.