GitHub CLI Releases, Gists, and API/Create a private gist from stdin

Create a gist from standard input.

Section: Gists

Create a private gist from stdin

bash
bash
printf "hello\n" | gh gist create -f hello.txt
Explanation

Create a gist from standard input.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Gists
Create a gist
Create a public gist from a file.
OpenIn sheetbashsame section
List gists
List your gists.
OpenIn sheetbashsame section
View a gist
Show a gist.
OpenIn sheetbashsame section
Edit a gist description
Edit a gist.
OpenIn sheetbashsame section
Clone a gist
Clone a gist locally.
OpenIn sheetbashsame section
Rename a gist file
Rename a file within a gist.
OpenIn sheetbashsame section