Skip to main content

Synopsis

Deletes an artifact and all its versions, or deletes a specific version if the --version flag is provided.
hc artifact delete <artifact-name> [flags]

Arguments

artifact-name
string
required
Name of the artifact to delete

Options

--registry
string
required
Registry identifier containing the artifact
--version
string
Specific version to delete. If not provided, deletes all versions.

Behavior

Delete All Versions

When --version is not specified:
  • Deletes the entire artifact entry
  • Removes all versions of the artifact
  • Cannot be undone

Delete Specific Version

When --version is specified:
  • Deletes only the specified version
  • Other versions remain intact
  • Artifact entry persists if other versions exist

Examples

hc artifact delete nginx --registry docker-registry --version 1.21.0

Output Messages

Successful Version Deletion

Deleted artifact version nginx/1.21.0; msg:SUCCESS

Successful Complete Deletion

Deleted artifact nginx and all its versions; msg:SUCCESS

Error Example

failed to delete artifact nginx: artifact not found

Safety Considerations

Deletion is permanent and cannot be undone. Always verify the artifact name and version before executing delete commands.
If you delete all versions individually, the artifact metadata entry may still exist but will contain no versions.

Use Cases

hc artifact delete my-app --registry docker-registry --version 1.0.0-deprecated
Remove a specific deprecated or vulnerable version while keeping other versions.
hc artifact delete test-package --registry npm-registry
Remove an entire test artifact including all versions.
hc artifact delete snapshot-build --registry maven-registry --version 1.0.0-SNAPSHOT
Delete a snapshot version that’s no longer needed.

Verification

After deletion, verify the artifact is removed:
# Verify version deletion
hc artifact get my-artifact --registry my-registry

# Verify complete deletion
hc artifact list --registry my-registry

See Also

Build docs developers (and LLMs) love