Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Jist just gists
tree: 6fbf0cb9d6

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

Jist is a gem that allows you to publish a gist from Ruby.


As with all ruby gems, you can install Jist (assuming you have ruby and rubygems) with:

$ gem install jist

If you want to use the library in your application, and you're using Bundler. Add the following to your Gemfile.

source :rubygems
gem 'jist'


The jist gem provides a jist command that you can use from your terminal to upload content to

It's easy to use. To upload the contents of a.rb just:

$ jist a.rb

By default it reads from STDIN, and you can set a filename with -f.

$ jist -f test.rb <a.rb

Use -p and -d to add finishing touches:

$ jist -p -d "Random rbx bug" a.rb

You can update existing gists with -u:

$ jist lib/jist.rb bin/jist -u 42f2c239d2eb57299408

See jist --help for more detail.


If you want to associate your gists with your github account, you need to login with jist. It doesn't store your username and password, it just uses them to get an OAuth2 token (with the "gist" permission).

jist --login
Obtaining OAuth2 access_token from github.
Github username: ConradIrwin
Github password:

This token is stored in ~/.jist and used for all future gisting. If you need to you can revoke it from, or just delete the file.

After you've done this, you can still upload gists anonymously with -a.

jist -a a.rb


You can also use Jist as a library from inside your ruby code:

Jist.gist(" => 'awesome').code")

If you need more advanced features you can also pass:

  • :access_token to authenticate using OAuth2 (default is `"~/.jist")).
  • :filename to change the syntax highlighting (default is a.rb).
  • :public if you want your gist to have a guessable url.
  • :description to add a description to your gist.
  • :update to update an existing gist (can be a URL or an id).
  • :anonymous to submit an anonymous gist (default is false).

NOTE: The access_token must have the "gist" scope.

If you want to upload multiple files in the same gist, you can:

Jist.multi_gist("a.rb" => "", "" => "")

If you'd rather use jist's builtin access_token, then you can force the user to obtain one by calling:


This will take them through the process of obtaining an OAuth2 token, and storing it in ~/.jist, where it can later be read by Jist.gist


I wrote this because the gist gem is out of action, and has been for many months.

It's licensed under the MIT license, and bug-reports, and pull requests are welcome.

Something went wrong with that request. Please try again.