A pair of gems to create and expand URLs

Now that Google has released an API for its URL shortening service, command line geeks have a couple of options to create short URLs without opening a browser.


Developed by Josh Nesbitt at Stac, google_url_shortener is a handy command line utility to create and expand URLs.

Install via Rubygems

gem install google_url_shortener

… and configure your API key

googl install supercalifragilisticexpialidocious

Now you can shorten URLS with

$ googl shorten                                         

The built-in help shows the full usage:

~ » googl --help                                                                 
Google URL Shortener


  googl install myapikey
  googl {shorten,s}
  googl {expand,e}
  googl expand -a

  --analytics, -a:   Show analytics when expanding a URL
    --version, -v:   Print version and exit
       --help, -h:   Show this message

Be sure and check out the Stac blog post for tips on setting up copy-to-the-clipboard Bash aliases and such.

Get Shortly

If, like us here at The Changelog, your needs for URL shortening go beyond, you might check out Shortly from Bagwan Pankaj. In addition to, Shortly also supports,, and

If someone wanted to beat me to it and fork the project to add ShortSwitch support for our domain, you just might get some ink on this here blog…

[google_url_shortener on GitHub] [shortly on GitHub]


Sign in or join to comment

0:00 / 0:00