GoogleCL Brings Google Services To The Command Line

GoogleCL Brings Google Services To The Command Line

Linux/Mac/Windows: Google’s services are pretty easily accessible in their individual web apps and native clients, but scripting types have been left behind. Now, though, Google has released a utility called GoogleCL that allows you to access them from the command line.

Having Google’s services at your fingertips in the Terminal may not sound super cool, but if you want to incorporate, say, fetching Google Calendar events, Google contacts, Google Docs or Picasa photos into your scripts, it’s really handy (and long overdue). GoogleCL is a python program that can access and perform a number of actions in Blogger, Calendar, Contacts, Docs, Picasa and YouTube.

Ubuntu users can download a .deb package and install it right away, though Mac and Windows installation is a bit trickier. If you’re the type that will be using GoogleCL, though, it’s probably nothing you aren’t used to. Note that before you begin, you’ll need Python 2.5 or 2.6 installed, and Windows users will also need Cygwin.

Download both the gdata python client library and GoogleCL. Unzip the tarballs or zip files and note the location of the folders (for the below example, I’ve left mine in ~/Downloads). Then, open up a Terminal window and type the following commands, entering your password when prompted:

cd “~/Downloads/gdata-2.0.10/”
sudo python install
cd “~/Downloads/googlecl-0.9.5/”
sudo python install

When you’re done, GoogleCl will be installed on your computer. The first time you use it for a service, it will prompt you for your Google username. Type it in and hit enter, after which it will give you a URL that you can copy and paste into your browser to grant GoogleCL access to your account. Once you’ve done so, go back to the Terminal and hit enter to complete the link. You’ll have to go through this process for each Google service, but only the first time you use them.

You now have access to a number of different tasks in the aforementioned Google services that you can run in the Terminal or in shell scripts. You can post videos to YouTube, edit Google Docs on your desktop and add contacts to Gmail. For more information, check out Google’s example scripts, as well as GoogleCL’s manual page. Hit the link to read more and check out their page on Google Code, and share your favourite applications of these newfound commands in the comments!

GoogleCL [via Open Source at Google]


Log in to comment on this story!