gh-gist-create - Man Page

Create a new gist


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


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 secret; use --public to make publicly listed ones.


-d, --desc <string>

A description for this gist

-f, --filename <string>

Provide a filename to be used when reading from standard input

-p, ā€‰--public

List the gist publicly (default "secret")

-w, ā€‰--web

Open the web browser with created gist


# 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

See Also


Referenced By


Mar 2024 GitHub CLI manual