GH-CACHE-LIST(1) GitHub CLI manual GH-CACHE-LIST(1)

# [NAME](#NAME)

gh-cache-list - List GitHub Actions caches

# [SYNOPSIS](#SYNOPSIS)

**gh cache list \[flags]**

# [OPTIONS](#OPTIONS)

[**-q**, **--jq** **&lt;expression&gt;**](#q)

Filter JSON output using a jq expression

[**--json** **&lt;fields&gt;**](#json)

Output JSON with the specified fields

[**-k**, **--key** **&lt;string&gt;**](#k)

Filter by cache key prefix

[**-L**, **--limit** **&lt;int&gt; (default 30)**](#L)

Maximum number of caches to fetch

[**-O**, **--order** **&lt;string&gt; (default "desc")**](#O)

Order of caches returned: {asc|desc}

[**-r**, **--ref** **&lt;string&gt;**](#r)

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

[**-S**, **--sort** **&lt;string&gt; (default "last\_accessed\_at")**](#S)

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

[**-t**, **--template** **&lt;string&gt;**](#t)

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

# [OPTIONS INHERITED FROM PARENT COMMANDS](#OPTIONS_INHERITED_FROM_PARENT_COMMANDS)

[**-R**, **--repo** **&lt;\[HOST/\]OWNER/REPO&gt;**](#R)

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

# [ALIASES](#ALIASES)

gh cache ls

# [JSON FIELDS](#JSON_FIELDS)

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

# [EXIT CODES](#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](#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](#SEE_ALSO)

[**gh-cache(1)**](/man/os/gh/gh-cache.1)

Oct 2026

---

Document: gh-cache-list(1) from gh 2.102.0-r2 (Chainguard OS)
Source: https://github.com/cli/cli
