Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
gh(1)Aug(2020)							gh(1)Aug(2020)

Auto generated by spf13/cobra

NAME
       gh-api -	Make an	authenticated GitHub API request

SYNOPSIS
       gh api  [flags]

DESCRIPTION
       Makes  an  authenticated	 HTTP request to the GitHub API	and prints the
       response.

       The endpoint argument should either be a	path of	a GitHub API  v3  end-
       point, or "graphql" to access the GitHub	API v4.

       Placeholder  values  ":owner" and ":repo" in the	endpoint argument will
       get replaced with values	from the repository of the current directory.

       The default HTTP	request	method is "GET"	normally and "POST" if any pa-
       rameters	were added. Override the method	with '--method'.

       Pass  one  or  more  '--raw-field'  values in "key=value" format	to add
       JSON-encoded string parameters to the POST body.

       The '--field' flag behaves like '--raw-field' with magic	 type  conver-
       sion based on the format	of the value:

	      o	literal	 values	 "true",  "false", "null", and integer numbers
		get converted to appropriate JSON types;

	      o	placeholder values ":owner" and	 ":repo"  get  populated  with
		values from the	repository of the current directory;

	      o	if  the	value starts with "@", the rest	of the value is	inter-
		preted as a filename to	read the value from. Pass "-" to  read
		from standard input.

       Raw request body	may be passed from the outside via a file specified by
       '--input'.  Pass	"-" to read from standard input. In this mode, parame-
       ters specified via

       In  '--paginate'	 mode,	all  pages of results will sequentially	be re-
       quested until there are no more pages of	results. For GraphQL requests,
       this  requires  that the	original query accepts an '$endCursor: String'
       variable	and that it fetches the

OPTIONS
       -F, --field=[]	   Add a parameter of inferred type

       -H, --header=[]	    Add	an additional HTTP request header

       -i, --include[=false]	  Include HTTP response	headers	in the output

       --input=""      The file	to use as body for the HTTP request

       -X, --method="GET"      The HTTP	method for the request

       --paginate[=false]      Make additional	HTTP  requests	to  fetch  all
       pages of	results

       -f, --raw-field=[]      Add a string parameter

       --silent[=false]	     Do	not print the response body

OPTIONS	INHERITED FROM PARENT COMMANDS
       --help[=false]	   Show	help for command

EXAMPLE
	      $	gh api repos/:owner/:repo/releases

	      $	gh api graphql -F owner=':owner' -F name=':repo' -f query='
		query($name: String!, $owner: String!) {
		  repository(owner: $owner, name: $name) {
		    releases(last: 3) {
		      nodes { tagName }
		    }
		  }
		}

	      $	gh api graphql --paginate -f query='
		query($endCursor: String) {
		  viewer {
		    repositories(first:	100, after: $endCursor)	{
		      nodes { nameWithOwner }
		      pageInfo {
			hasNextPage
			endCursor
		      }
		    }
		  }
		}

SEE ALSO
       gh(1)

HISTORY
       31-Aug-2020 Auto	generated by spf13/cobra

								gh(1)Aug(2020)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPTIONS INHERITED FROM PARENT COMMANDS | EXAMPLE | SEE ALSO | HISTORY

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=gh-api&sektion=1&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help