Skip to content
A Ruby script that allows posting of gists from the command-line of local files.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

gistrb - A command-line utility to post files directly as Gists on

FOSSA Status


This is a utility to easily post local source files you have on GitHub Gists. It supports uploading multi-file Gists, authenticated Gists, anonymous Gists, and declaring the Gists as private or public. You can also attach descriptions to the Gist you post.


gistrb [opts] source_file source_file2 ...

gistrb also supports input from STDIN. If gistrb is invoked with no files and nothing piped in, then it will wait on the terminal for input from STDIN until it reads an EOF character. An EOF character can be inserted on the terminal using Ctrl+D.

Any files in the Gist from STDIN will be labelled as "STDIN".

$ cat foo.txt | gistrb [opts] source_file # Reads foo.txt from piped STDIN and source_file as a file.
$ gistrb [opts] # Waits until it reads Ctrl+D and processes that data as STDIN


Option Description
-u | --user Post the Gist as currently signed in user
-s | --sign-in Sign into the utility using your GitHub account
--sign-out Sign out of the utility
-p | --public Post the Gist as public (it posts as private by default)
-d [DESC] | --description [DESC] Use [DESC] as the description for the Gist
-c | --clipboard Automatically put the created Gist URL into your clipboard (beta)
-n | --netrc Utilize .netrc file for storing/retrieving authorization token


Using RubyGems, simply run this command: gem install gistrb


If on Linux, you need to have xclip installed for clipboard support

To install this on Ubuntu-based distributions, run the following command.

sudo apt-get install xclip


MIT License

Copyright © 2018 Cameron Roe

FOSSA Status

You can’t perform that action at this time.