Skip to content

gh

gh documentation

footman._stubs.gh.Gh

Bases: Tool

__call__

__call__(*args: str, **flags: Any) -> Result

Work seamlessly with GitHub from the command line.

api

api(
    endpoint: str,
    /,
    *args: str,
    cache: _Value = ...,
    field: _Value = ...,
    header: _Value = ...,
    hostname: _Value = ...,
    include: _Flag = ...,
    input: _Value = ...,
    jq: _Value = ...,
    method: _Value = ...,
    paginate: _Flag = ...,
    preview: _Value = ...,
    raw_field: _Value = ...,
    silent: _Flag = ...,
    slurp: _Flag = ...,
    template: _Value = ...,
    verbose: _Flag = ...,
    **flags: Any,
) -> Result

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

Parameters:

Name Type Description Default
cache _Value

Cache the response, e.g. "3600s", "60m", "1h".

...
field _Value

Add a typed parameter in key=value format (use "@" or "@-" to read value from file or stdin).

...
header _Value

Add a HTTP request header in key:value format.

...
hostname _Value

The GitHub hostname for the request. Defaults to github.com.

...
include _Flag

Include HTTP response status line and headers in the output.

...
input _Value

The file to use as body for the HTTP request (use "-" to read from standard input).

...
jq _Value

Query to select values from the response using jq syntax.

...
method _Value

The HTTP method for the request. Defaults to GET.

...
paginate _Flag

Make additional HTTP requests to fetch all pages of results.

...
preview _Value

Opt into GitHub API previews (names should omit '-preview').

...
raw_field _Value

Add a string parameter in key=value format.

...
silent _Flag

Do not print the response body.

...
slurp _Flag

Use with "--paginate" to return an array of all pages of either JSON arrays or objects.

...
template _Value

Format JSON output using a Go template; see "gh help formatting".

...
verbose _Flag

Include full HTTP request and response in the output.

...

flags

flags(**flags: Any) -> Gh

Bind tool-level global options before the subcommand.

tools.docker.flags(host=...) puts a tool's own options ahead of the verb, where they belong.