NAME

Synopsis

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

Installation

If you have ruby installed:

gem install gist

If you're using Bundler:

source :rubygems
gem 'gist'

Command

To upload the contents of a.rb just:

gist a.rb

Upload multiple files:

gist a b c
gist *.rb

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

gist -f test.rb <a.rb

Alternatively, you can just paste from the clipboard:

gist -P

Use -p to make the gist private:

gist -p a.rb

Use -d to add a description:

gist -d "Random rbx bug" a.rb

You can update existing gists with -u:

gist lib/gist.rb bin/gist -u 42f2c239d2eb57299408

If you'd like to copy the resulting URL to your clipboard, use -c.

gist -c <a.rb

If you'd like to copy the resulting embeddable URL to your clipboard, use --copy-js.

gist --copy-js <a.rb

And you can just ask gist to open a browser window directly with -o.

gist -o <a.rb

See gist --help for more detail.

Login

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).