Zuplo CLI: Delete
- Applies to
- Gatewayruntime for API, AI, and MCP gateways
- Hosting
- Managed EdgeManaged DedicatedSelf-HostedDiffers
1 difference by hosting option
To delete a deployment on your own cluster, pass your cluster's management API endpoint with --self-hosted-endpoint. See Self-Hosted requirements.
Common use cases
The following examples assume that you are passing in your --api-key either as
an argument or through the ZUPLO_API_KEY environment variable.
Deleting an environment by branch
Pass the same branch name that you gave to
zuplo deploy --branch. The CLI finds the environment that the
branch deployed in the project and deletes it, so you don't have to capture the
environment URL.
Code
If no environment exists for the branch, the command reports that none was found and exits without an error. This makes it safe to run in a cleanup step that can fire more than once.
Deleting an environment by URL
Code
Choosing between --url and --branch
Pass exactly one of --url or --branch. The command fails if you pass both,
and fails if you pass neither.
The CLI reads --branch only when you type it on the command line. An exported
ZUPLO_BRANCH environment variable is ignored by zuplo delete, so a variable
that a CI job exports for other commands can't choose the environment you
delete. zuplo deploy ignores ZUPLO_BRANCH the same way.
Deleting a pull request preview in CI
When a pull request closes, delete the environment that the pull request deployed, using the same branch name that the deploy step used.
Code
Examples
Delete a deployed environment by its URL
Delete the environment deployed from the my-feature branch
Delete an environment and wait until the deletion is complete
Options
--url
The URL of the Zuplo API to delete
string--branch
The branch name of the environment to delete (the value passed to `zuplo deploy --branch`)
string--project
The project name
string--account
The account name
string--self-hosted-endpoint
The endpoint of your self-hosted service to deploy to
string--wait
Should the CLI wait until the Zuplo API is deleted
booleanGlobal options
The following global options are available for all commands: