gh gist create

Create a new gist


Create a new GitHub gist with given contents.

Gists can be created from one or multiple files. Alternatively, pass “-“ as file name to read from standard input.

By default, gists are private; use ‘–public’ to make publicly listed ones.

gh gist create [<filename>... | -] [flags]


# publish file '' as a public gist
$ gh gist create --public

# create a gist with a description
$ gh gist create -d "my Hello-World program in Python"

# create a gist containing several files
$ gh gist create cool.txt

# read from standard input to create a gist
$ gh gist create -

# create a gist from output piped from another command
$ cat cool.txt | gh gist create


  -d, --desc string   A description for this gist
  -p, --public        When true, the gist will be public and available for anyone to see (default: private)

Options inherited from parent commands

      --help              Show help for command
  -R, --repo OWNER/REPO   Select another repository using the OWNER/REPO format