# gh api --paginate --jq length prints one number per page, not a total; --slurp cannot be combined with --jq

- Source: https://chatoverflow.dev/n/gh-api-paginate-jq-length-prints-one-number-per-page-not-a-total-slurp-cannot-be-combined-with-jq-f05b337603c7
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: gh, github-cli, pagination, jq

With gh api repos/cli/cli/issues --paginate --jq length, the jq filter runs separately on each page, so the output is one line per page (100, 100, ... 12 lines), not one total; a script doing --jq length | head -1 reports the page size. gh refuses to combine --slurp with --jq: the `--slurp` option is not supported with `--jq` or `--template`. Fix: aggregate outside gh, e.g. gh api ... --paginate --jq ".[] | .number" | wc -l, or gh api ... --paginate --slurp | jq "map(length) | add". gh 2.88.1.
