GH-CACHE-LIST(1)
π gh-cache-list β bestie, let's list some GitHub Actions caches β¨
Okay so real talk: this is a page from the GitHub CLI manual, and it's all about gh-cache-list, the command that shows you every cache hangin' out in your repo's Actions storage. It's giving inventory day, it's giving "where did all my gigabytes go", and honestly? Iconic. π
β¨ NAME β¨
gh-cache-list β List GitHub Actions caches π¦
πΈ SYNOPSIS πΈ
gh cache list [flags]
That's it. That's the whole vibe. You run it, it lists caches. Slay. π
π DESCRIPTION π
Not me about to explain this like it's the most exciting thing ever (because it kinda is): gh cache list pulls up the GitHub Actions caches for a repository, and you get to filter, sort, order, and format them however you want. Every flag below is a little permission slip to be picky. Periodt. π
β OPTIONS β
-q,--jq <expression>β Filter the JSON output using ajqexpression. It's giving "I only want the good fields" energy. β¨--json <fields>β Output JSON with the specified fields. You pick 'em, you get 'em.-k,--key <string>β Filter by cache key prefix. So like, a starting-slice of the key, basically. π-L,--limit <int>(default30) β Maximum number of caches to fetch. Default is30, so nobody's doomscrolling forever.-O,--order <string>(default"desc") β Order of caches returned, and your choices are{asc|desc}. That's ascending or descending, bestie.-r,--ref <string>β Filter by ref, formatted asrefs/heads/orrefs/pull//merge. Branch business or PR business, your call. πΏ-S,--sort <string>(default"last_accessed_at") β Sort fetched caches. Options are{created_at|last_accessed_at|size_in_bytes}. Yes, you can sort by how chunky they are. π-t,--template <string>β Format JSON output using a Go template; see "gh help formatting". Fancy formatting girlies rise up. π
π«Ά OPTIONS INHERITED FROM PARENT COMMANDS π«Ά
-R,--repo <[HOST/]OWNER/REPO>β Select another repository using the[HOST/]OWNER/REPOformat. Point at a different repo like it's nothing. π
π ALIASES π
gh cache ls
Yep β gh cache ls works too. Short, sweet, lowkey the same command. π
π JSON FIELDS π
These are the fields you can ask for with --json:
createdAt, id, key, lastAccessedAt, ref, sizeInBytes, version
Copy that list exactly, bestie, it's important. π§
π EXIT CODES π
0β Successful execution π1β Error π2β Command canceled4β Authentication required π
NOTE: Specific commands may have additional exit codes. Refer to the command's help for more information.
π₯ EXAMPLE π₯
Okay these examples are the main character energy of the whole page. Read them. Love them. Copy them. π
# List caches for current repository
$ gh cache list
# List caches for specific repository
$ gh cache list --repo cli/cli
# List caches sorted by least recently accessed
$ gh cache list --sort last_accessed_at --order asc
# List caches that have keys matching a prefix (or that match exactly)
$ gh cache list --key key-prefix
# List caches for a specific branch, replace <branch-name> with the actual branch name
$ gh cache list --ref refs/heads/<branch-name>
# List caches for a specific pull request, replace <pr-number> with the actual pull request number
$ gh cache list --ref refs/pull/<pr-number>/merge
No cap, that last one with refs/pull/<pr-number>/merge is so good for snooping on a PR's caches. π¦
π SEE ALSO π
gh-cache(1)β the parent command, go say hi π
Okay that's the whole page, bestie, you're officially a cache-listing expert. π
Sign-off, cutely: this little masterpiece came from the GitHub CLI manual, version v2.102.0, dated Oct 2026. Go forth and list responsibly. π
β¨π«Ά
π¦ 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