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 πŸŽ‰ slay
  • 1 β€” 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