Bootstrap FreeKB - Cloudsmith - Delete a file in a repository using the cloudsmith CLI
Cloudsmith - Delete a file in a repository using the cloudsmith CLI

Updated:   |  Cloudsmith articles

In order to delete a file in a repository in Cloudsmith, you will first need the slug of the file. In this example, there are 3 files in my-org/my-repo.

~]$ cloudsmith list packages my-org/my-repo --api-key <your Cloudsmith API key> --output-format json | jq .data[] | jq .files[] | jq --raw-output .filename,.slug_perm
file1.txt
Cb2FBYTYaUd1
file3.txt
N8279KITzfQz
file3.txt
QDGlRng7cyoU

 

The slug of file1.txt is Cb2FBYTYaUd1 thus the following command could be used to delete file1.txt in the Cloudsmith repo.

~]$ cloudsmith delete my-org/my-repo/Cb2FBYTYaUd1
 --api-key <your Cloudsmith API key>

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter aa73fc in the box below so that we can be sure you are a human.