Easy way to create GitHub Gists through the command line. Simply give it the files to upload and gst will return the URL to the new gist.


-e ID

Edit previously created gist specified with ID


Set gist description


Delete FILE from gist being edited


Set file name when reading from stdin

-g URL

Change the GitHub API URL (default: https://api.github.com/gists)


Make gist private


Make gist public (default)


Change the GitHub account the gist will be posted under. A password can given as well with a separating colon, a prompt is provided if not.


Post gist anonymously (default)


Print help and exit


Print version info and exit


Create a new gist of file.txt:

$ gst file.txt

There is also support for multiple files in a single gist:

$ gst README.md Makefile prog.c

Specify the gist’s description:

$ gst -d 'a cool shell script' script.sh

The gist’s URL can be piped to other programs, for example to your clipboard to be pasted elsewhere:

$ gst file.txt | xsel -bi

You can also create a new gist from stdin. The file name needs to be supplied however:

$ cmd-which-errors | gst -f log.txt

The new gist can be posted under a GitHub user, a prompt will ask for your password:

$ gst -u your-name good-proj.rs
GitHub password:

To skip the prompt your password can be supplied after a colon with the username:

$ gst -u your-name:password plugin/func.vim doc/func.txt

New gists can be private when created under a user:

$ gst -p -u name personal.info

You can also edit a previously created gist under your account, such as adding a new file or updating the description:

$ gst -e <id> -u name -d "new description" additional-file.txt

It is even possible to delete files, although it should be noted the gist still exists even if you delete all the files within it due to the limitations of the API:

$ gst -e <id> -u name -D old.py


The only dependency needed to build gst is cURL. gst be compiled with a simple make and sudo make install will install the executable and man page.


gst can be customized by editing the custom config.h and (re)compiling the source code. This keeps it fast, secure and simple. All customization can be done through the command line interface however, so basic aliases could also be utilized to change default options.


Ed van Bruggen ed@edryd.org

See Also

See project page at https://edryd.org/projects/gst.html

View source code at https://git.edryd.org/gst


zlib License