CLI: Deploy and Delete Environments by Branch Name

zuplo deploy and zuplo delete now both take a --branch flag, so a CI job can create a preview environment under a branch name and clean it up later with the same name. Existing commands, flags, and output work exactly as before.

  • Deploy as a branch: zuplo deploy --branch my-feature deploys the environment as my-feature instead of the current Git branch. If you also pass --environment, the --branch value wins.
  • Delete by branch: zuplo delete --branch my-feature deletes the environment deployed from that branch. Pass either --url or --branch, not both.
Terminalbash
npx zuplo deploy --branch pr-142
# later, when the pull request closes
npx zuplo delete --branch pr-142 --wait

--environment on zuplo deploy keeps working and is now marked deprecated in the help text in favor of --branch. An exported ZUPLO_BRANCH environment variable doesn’t choose the environment for either command: zuplo deploy ignores it, and zuplo delete deletes by branch only when you type the --branch flag.

See the zuplo deploy and zuplo delete references for every option.