GH-GIST-CREATE(1)
π gh-gist-create(1) β the GitHub CLI manual, bestie edition π
okay so this is a page from the GitHub CLI manual and it's all about gh gist create, which is genuinely one of the most underrated little commands out here. let's get into it π
β¨ NAME β¨
gh-gist-create β Create a new gist β¨
π¦ SYNOPSIS π¦
gh gist create [<filename>... | <pattern>... | -] [flags]
like. look at that. filenames OR patterns OR a literal dash, plus flags. she contains multitudes π
πΈ DESCRIPTION πΈ
Create a new GitHub gist with whatever contents you feel like, honestly. main character energy.
Gists can be created from one or multiple files. alternatively β and this is the fun part β you can pass - as a filename to read from standard input. yes, that's a thing, and yes, it slaps π«Ά
By default, gists are secret; use --public to make publicly listed ones. no cap, secret is the default, so if you wanted the world to see it you gotta say so.
π OPTIONS π
-d,--desc <string>β a description for this gist βοΈ-f,--filename <string>β provide a filename to be used when reading from standard input (aka the-situation β this is how you name the thing)-p,--publicβ list the gist publicly (default"secret") π-w,--webβ open the web browser with the created gist π
π§ ALIASES π§
gh gist new
same vibe, different name. iykyk π
π₯ EXIT CODES π₯
0β Successful execution π slay1β Error π2β Command canceled π4β Authentication required π
NOTE: specific commands may have additional exit codes. refer to the command's help for more information, bestie β the vibes vary per command fr fr.
β EXAMPLE β
okay these are the moment, honestly:
# Publish file 'hello.py' as a public gist
$ gh gist create --public hello.py
# Create a gist with a description
$ gh gist create hello.py -d "my Hello-World program in Python"
# Create a gist containing several files
$ gh gist create hello.py world.py cool.txt
# Create a gist containing several files using patterns
$ gh gist create *.md *.txt artifact.*
# 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
the pattern one with *.md *.txt artifact.*?? ate. the pipe one?? iconic. use them. π
π SEE ALSO π
gh-gist(1)β the parent, the icon, the blueprint π
and that's the page!! this one's from GitHub CLI v2.102.0, dated Oct 2026 β go forth and gist, bestie, you're gonna do amazing πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- opensuse-leap 16.0: gh 2.102.0-bp160.1.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms