Cloudsmith - Delete a file in a repository using the cloudsmith CLI
by
Jeremy Canfield |
Updated: November 21 2025
| 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 