Send text to GitHub Gist from terminal

cool_penguin_smallGitHub Gist is a place to store all your code snippets and notes for easy showcasing or sharing. The service has many official and unofficial clients to post of fetch text. We found a new shell script based client that allows sending text right from the terminal.

The gist script (gist.sh) allows you to post test as a registered user or anonymously. You can send text files or text. When you run the command it returns you the URL of the new gist created.

Options

-f Specify a filename of an existing file to send as a gist.
-n Specify the name of a gist you'd like to create (must be used in conjunction with -c)
-c Specify the text of the gist you'd like to create (must be used in conjunction with -n)
-u Specify the user (default is anonymous)
-p Specify the creation of a private (aka "secret") gist. The default is public

Examples

Create a gist from a file with a username:

$ gist.sh -u exampleuser -f test.txt

Create an anonymous gist with a name from a text string:

$ gist.sh -n test -c "This is a test\nPlease ignore"
//Note that newlines need the \n character.

To get the utility, download the repository. Extract and use the gist.sh script. It uses curl to send your text to the Gist service.

Webpage: gist.sh

Similar software

2 thoughts on “Send text to GitHub Gist from terminal”

Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s