---
name: "gh-cache-list"
section: "1"
platform: "linux"
package: "github-cli"
version: "2.102.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gh-cache-list"
---

# gh-cache-list(1)

List GitHub Actions caches

## NAME

gh-cache-list - List GitHub Actions caches

## SYNOPSIS

**gh cache list \[flags\]**

## OPTIONS

- **-q**, **--jq** **\<expression\>**

  Filter JSON output using a jq expression

- **--json** **\<fields\>**

  Output JSON with the specified fields

- **-k**, **--key** **\<string\>**

  Filter by cache key prefix

- **-L**, **--limit** **\<int\> (default 30)**

  Maximum number of caches to fetch

- **-O**, **--order** **\<string\> (default "desc")**

  Order of caches returned: {asc\|desc}

- **-r**, **--ref** **\<string\>**

  Filter by ref, formatted as refs/heads/ or refs/pull//merge

- **-S**, **--sort** **\<string\> (default "last\_accessed\_at")**

  Sort fetched caches: {created\_at\|last\_accessed\_at\|size\_in\_bytes}

- **-t**, **--template** **\<string\>**

  Format JSON output using a Go template; see "gh help formatting"

## OPTIONS INHERITED FROM PARENT COMMANDS

- **-R**, **--repo** **\<\[HOST/\]OWNER/REPO\>**

  Select another repository using the \[HOST/\]OWNER/REPO format

## ALIASES

gh cache ls

## JSON FIELDS

**createdAt**, **id**, **key**, **lastAccessedAt**, **ref**, **sizeInBytes**, **version**

## 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

```
# 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
```

## SEE ALSO

**[gh-cache(1)](/gh-cache/1.md)**
