package version delete

<!-- prettier-ignore-start -->

Delete a package version.

Description for package version delete

Specify the ID or alias of the package version you want to delete. In second-generation managed packaging, only beta package versions can be deleted. Before deleting a package version, review the considerations outlined in https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp_package_deletion.htm.

Aliases for package version delete

force:package:version:delete

Flags

Flag Name (Long) Flag Name (Short) Description
<code>‑‑api‑version</code> N/A Type: Value<br><br>Override the api version used for api requests made by this command
<code>‑‑flags‑dir</code> N/A Type: Value<br><br>Import flag values from a directory.
<code>‑‑json</code> N/A Type: Boolean<br><br>Format output as json.
<code>‑‑no‑prompt</code> <code>‑n</code> Type: Boolean<br><br>Don’t prompt before deleting the package version.
<code>‑‑package</code> <code>‑p</code> Type: Value<br>Required<br><br>ID (starts with 04t) or alias of the package version to delete.
<code>‑‑target‑dev‑hub</code> <code>‑v</code> Type: Value<br>Required<br><br>Username or alias of the Dev Hub org. Not required if the target-dev-hub configuration variable is already set.

Examples for package version delete

Delete a package version with the specified alias using your default Dev Hub org:

sf package version delete --package "Your Package Alias"

Delete a package version with the specified ID using the Dev Hub org with username "devhub@example.com":

sf package version delete --package 04t... --target-org devhub@example.com
<!-- prettier-ignore-end -->