GH-CACHE-DELETE(1)
๐๏ธโจ GH-CACHE-DELETE (1) โ the GitHub CLI manual, bestie edition โจ๐๏ธ
okay so this is the manual page for gh-cache-delete from the GitHub CLI manual, and I'm gonna walk you through it like we're texting at 1am ๐
๐ NAME ๐
gh-cache-delete โ Delete GitHub Actions caches. that's it, that's the whole vibe ๐
๐ฆ SYNOPSIS ๐ฆ
gh cache delete [<cache-id> | <cache-key> | --all] [flags]
so you give it either a cache id, or a cache key, or --all, plus whatever flags you want. pick your fighter, bestie ๐ซถ
๐ธ DESCRIPTION ๐ธ
Delete GitHub Actions caches. that's literally the whole job, and it ate ๐
but real talk โ deletion requires authorization with the repo scope. no scope, no slay. periodt ๐ฅ
โจ OPTIONS โจ
-a,--allโ Delete all caches. yep, ALL of them ๐ญ can be used with--refto delete all the caches for one specific ref, which is lowkey the move if you don't wanna nuke everything.-r,--ref<string>โ Delete by cache key and ref, formatted asrefs/heads/orrefs/pull//merge. so you're matching on key + ref together, got it ๐ง--succeed-on-no-caches<--all>โ Return exit code 0 if no caches found. cute, right? BUT it must be used in conjunction with--allโ like, it does not work solo, it needs its buddy ๐
๐ฎ OPTIONS INHERITED FROM PARENT COMMANDS ๐ฎ
-R,--repo<[HOST/]OWNER/REPO>โ Select another repository using the[HOST/]OWNER/REPOformat. classic parent-command energy ๐
โญ EXIT CODES โญ
0: Successful execution โ icon status ๐1: Error โ it's giving oops ๐2: Command canceled โ you (or something) hit the brakes4: Authentication required โ log in, bestie ๐ญ
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information. (yes, that's a real note, go check the help fr fr)
๐ EXAMPLE ๐
here's the part where it gets iconic โ every single example, untouched, exactly as written:
# Delete a cache by id
$ gh cache delete 1234
# Delete a cache by key
$ gh cache delete cache-key
# Delete a cache by id in a specific repo
$ gh cache delete 1234 --repo cli/cli
# Delete a cache by key and branch ref
$ gh cache delete cache-key --ref refs/heads/feature-branch
# Delete a cache by key and PR ref
$ gh cache delete cache-key --ref refs/pull/<PR-number>/merge
# Delete all caches (exit code 1 on no caches)
$ gh cache delete --all
# Delete all caches for a specific ref
$ gh cache delete --all --ref refs/pull/<PR-number>/merge
# Delete all caches (exit code 0 on no caches)
$ gh cache delete --all --succeed-on-no-caches
see how --succeed-on-no-caches flips that exit code from 1 to 0? that's the whole plot twist ๐ฌโจ
๐ SEE ALSO ๐
gh-cache(1)โ the parent, the main character, the source of all the inherited flags ๐ซถ
k bye bestie, go clear those caches ๐ this was GitHub CLI v2.102.0, dated Oct 2026 โ mwah, signed sealed delivered and prettier than the original ngl ๐โจ๐ฆ
๐ฆ where this page comes from
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 ยท MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 ยท MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 ยท MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms