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 a jq expression. 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> (default 30) β€” Maximum number of caches to fetch. Default is 30, 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 as refs/heads/ or refs/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/REPO format. 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 canceled
  • 4 β€” 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