previewctl delete
Usage
previewctl delete [name or id]Aliases: rm
Description
Deletes a preview environment by name or ID.
If no argument is given, PreviewCtl looks for preview environments in the current workspace. If exactly one exists, it is deleted automatically. If multiple exist, they are listed and you must specify one by name or ID.
This command:
- Looks up the environment by name, falling back to ID
- Stops and removes all Docker containers on the preview network
- Removes the Docker network
- Cleans up port mappings and environment records from the local database
Arguments
| Argument | Required | Description |
|---|---|---|
[name or id] | No | Name or ID of the preview environment to delete. If omitted, auto-selects from the current workspace. |
Examples
Delete by name:
previewctl delete my-project-mainDelete by ID:
previewctl delete abc123Auto-select from current workspace:
previewctl deleteUsing the alias:
previewctl rm my-project-mainOutput
stopped frontendstopped apistopped postgresstopped redisremoving network "my-project-main"...preview environment "my-project-main" deleted