gh pr list

built-in
54.8% Savings
2 Commands
23 Tokens saved
3 Tests

Install

tokf install 8d4961e6817c1971647ed9b2592d95b35f525d8364549f94e2300da9cc27203a
Safety checks passed

Filter definition

command = "gh pr list"
run = "gh pr list --json number,title,state,headRefName {args}"
passthrough_args = ["--web", "-w"]

[json]

[[json.extract]]
path = "$[*]"
as = "prs"

[[json.extract.fields]]
field = "number"
as = "number"

[[json.extract.fields]]
field = "title"
as = "title"

[[json.extract.fields]]
field = "state"
as = "state"

[[json.extract.fields]]
field = "headRefName"
as = "branch"

[on_success]
output = "{prs | each: \"#{number}  {title}  {state}  {branch}\" | join: \"\\n\"}"

[on_failure]
tail = 10

Examples

empty PR list shows no PRs ~0 tokens → ~0 tokens
Raw output
[]
Filtered output
 
auth error shows tail ~39 tokens → ~39 tokens
Raw output
To get started with GitHub CLI, please run:  gh auth login
Alternatively, populate the GH_TOKEN environment variable with a GitHub API authentication token.
Filtered output
To get started with GitHub CLI, please run:  gh auth login
Alternatively, populate the GH_TOKEN environment variable with a GitHub API authentication token.
PR list extracts JSON fields ~71 tokens → ~39 tokens (45% saved)
Raw output
[{"headRefName":"feat/squash-merge","number":69,"state":"OPEN","title":"refactor: replace filter tests"},{"headRefName":"feat/pnpm","number":67,"state":"OPEN","title":"feat: add pnpm support"},{"headRefName":"feat/verify","number":61,"state":"MERGED","title":"feat: add verify command"}]
Filtered output
#69  refactor: replace filter tests  OPEN  feat/squash-merge
#67  feat: add pnpm support  OPEN  feat/pnpm
#61  feat: add verify command  MERGED  feat/verify
Warning: Community filters are third-party code. Review the filter definition above before installing it in production environments.
Browse all filters