hub-api(1) hub manual hub-api(1) (NAME) hub-api - GitHub API (SYNOPSIS) hub api [-it] [-X METHOD] [-H HEADER] [--cache TTL] ENDPOINT [-F FIELD|--input FILE] (OPTIONS) -X, --method METHOD HTTP (: "GET"). --field --raw-field --input "POST" . -XGET (query string) GET JSON POST . -F, --field KEY=VALUE . VALUE --raw-field . VALUE "@" . "@-" . VALUE "true" "false" "null" JSON . VALUE (hash) JSON . (payload) --input . -XGET JSON . ENDPOINT "graphql" "query" "variables" . : -f, --raw-field KEY=VALUE --field "@" "true" "false" "null" . --input FILE . "-" . . -H, --header KEY:VALUE HTTP. -i, --include HTTP . -t, --flat JSON - . --paginate . GET "Link" . GraphQL pageInfo . JSON . (rate limit) HTTP 403 . --obey-ratelimit . --color[=WHEN] stdout . WHEN "always" ( --color) "never" "auto" () . --cache TTL () GET TTL . "graphql" ENDPOINT POST . --cache (mutations) GraphQL . --obey-ratelimit (rate limit) . ( ). ENDPOINT (endpoint) GitHub API HTTP (: "/"). : . GraphQL "graphql" ENDPOINT -F query=QUERY . "{owner}" "{repo}" ENDPOINT "query" GraphQL . (EXAMPLES) # JSON $ hub api user # $ hub api --flat users/octocat/repos # issue $ hub api repos/{owner}/{repo}/issues/23/comments --raw-field 'body=Nice job!' # GraphQL $ hub api graphql -F query=@path/to/myquery.graphql # GraphQL $ hub api --paginate graphql -f query=' query($endCursor: String) { repositoryOwner(login: "USER") { repositories(first: 100, after: $endCursor) { nodes { nameWithOwner } pageInfo { hasNextPage endCursor } } } } ' (SEE ALSO) hub(1) hub version 2.14.2 12 Jul 2024 hub-api(1)