1. gist(1)
  2. Gist manual
  3. gist(1)


gist - upload code to https://gist.github.com


The gist gem provides a gist command that you can use from your terminal to upload content to https://gist.github.com/.


If you have ruby installed:

gem install gist

If you're using Bundler:

source :rubygems gem 'gist'



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

gist --login
Obtaining OAuth2 access_token from github.
GitHub username: ConradIrwin
GitHub password:
Success! https://github.com/settings/applications

This token is stored in ~/.gist and used for all future gisting. If you need to you can revoke it from https://github.com/settings/applications, or just delete the file.


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

Gist.gist("Look.at(:my => 'awesome').code")

If you need more advanced features you can also pass:

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

GitHub enterprise


If clipboard or browser integration don't work on your platform, please file a bug or (more ideally) a pull request.

If you need to use an HTTP proxy to access the internet, export the HTTP_PROXY or http_proxy environment variable and gist will use it.


Thanks to @defunkt and @indirect for writing and maintaining versions 1 through 3. Thanks to @rking and @ConradIrwin for maintaining version 4.

Licensed under the MIT license. Bug-reports, and pull requests are welcome.

  1. May 2013
  2. gist(1)