gh-api
authenticated HTTP requests to GitHub REST and GraphQL APIs
TLDR
Make GET request
$ gh api [/repos/owner/repo]
Make POST request$ gh api -X POST [/repos/owner/repo/issues] -f title="[title]"
With JSON body$ gh api [/endpoint] --input [data.json]
Use GraphQL$ gh api graphql -f query='[query]'
Paginate results$ gh api [/endpoint] --paginate
Output specific field$ gh api [/repos/owner/repo] --jq '.[field]'
SYNOPSIS
gh api [options] endpoint
DESCRIPTION
gh api makes authenticated HTTP requests to the GitHub API. Supports both REST and GraphQL APIs with automatic authentication.
PARAMETERS
-X, --method method
HTTP method.-f, --field key=value
Add string field.-F, --raw-field key=value
Add raw field.--input file
Read body from file.--jq query
Filter JSON output.--paginate
Paginate results.-H, --header header
Add HTTP header.-t, --template template
Format output with template.
