Gist It!

Gist It! is an application that allow you to create GitHub Gist from the terminal very easily.

How to use?

The application can be used in 2 different ways

  • Console input: Read the input and generate a fake file to submit. Ie, git diff | gistit
  • Files: Specify one or more files to be submitted, Ie, gistit file1.txt file2.c file3.js

Available parameters

All the parameters are optional, but helps you to customize your gist.

  • -v or --version - Show the application version and exit
  • -h or --help - Show the avaliable parameters and how to use
  • -d <STRING> or --description <STRING> - Set the GitHub Gist description
  • -priv - Set the gist to be private. It will not mark exclusive only for you, but to anyone with the link
  • -i <FILENAME> - Define the filename for console input. Setting the filename makes the GitHub highlight the text based on the extension. This parameter has no action when used with files.
  • <FILE> - Use the FILE on the gist. You can specify multiple files.

Examples

Creating from files

$ gistit ~/.bashrc ~/Documents/share.txt
Gist URL: https://gist.github.com/12345

Creating from some application output

$ ls | gistit
Gist URL: https://gist.github.com/12345

It is similar of:

$ ls > default.txt
$ gistit default.txt
Gist URL: https://gist.github.com/12345

Specify description and mark as private

ls | gistit -d "My computer files" -priv
Gist URL: https://gist.github.com/12345

Define a custom filename to the gist

git diff | gistit -i my_commit.diff
Gist URL: https://gist.github.com/12345

Creating gist with your GitHub account

You can configure your environment to create gist with your GitHub account.

If you do not have your token, create one clicking here.

Fork me on GitHub