The Beginner Guide to Use GoogleCL

At some point, the people at Google, who brought you the Linux-based Android platform and the Summer of Code, decided that they still were not geeky enough. To resolve that gut feeling, they have released GoogleCL, a command line utility for popular Google services. Now, even the most hardcore command line Linux purists have no reason to not try out some Google services.

Truthfully, GoogleCL provides a feature-rich command line tool set that will be useful to Linux geeks and regular users alike. With it, users can perform tasks quickly and efficiently.

GoogleCL is a cross-platform python application that includes tools for the following Google services: Picasa, Blogger, YouTube, Google Docs, Contacts, and Calendar.

You can download GoogleCL at the project’s Google Code page. There are two available package formats: deb (for debian, ubuntu, etc.) or tar.gz (for other non-Debian distros). On an Ubuntu machine, double-click on the file after it finishes downloading, and follow the on-screen instructions to install.

1. For the tar.gz file, extract the contents with:

tar zxvf googlecl-0.9.7.tar.gz

2. Next, change to the googlecl directory:

cd googlecl-0.9.7

3. Make sure you have python 2.5 or 2.6 and python gdata installed.

4. As root, run the following command:

python setup.py install

There are two ways to execute GoogleCL commands:

1. type “google” followed by the necessary arguments and options,

2. type “google” by itself to run the program and then enter commands from the google prompt.

To get general help with GoogleCL, type “google help”. To get help with a specific service, type “google help services”. For example, you can type “google help docs” for help with Google Docs.

GoogleCL help output

Run “google” once to allow GoogleCL to create the config file. There are a few options to configure to make GoogleCL work well for you. The configuration file will be located at ~/.googlecl/config. Make sure you specify the editors you want to use for the available file types.

To run a command, you should include the service, task, options, and arguments. The services will be picasa, docs, contacts, etc. The task will be terms like post, edit, delete, upload, etc. Options will use terms like title, query, name. Finally, arguments will include specific references to items like the names of documents or path to a video.

To create a blog post in Blogger, enter:

google blogger post --title 'Test CLI Blog Post' 'This is a test post for my new command line Blogger client'

(You can also instruct Blogger to access a file on your computer and upload the content).

To list your Google contacts, enter:

google contacts list name,email

To post a video file you have created to YouTube, type:

google youtube post --category Education My-First-Command-Line-Movie.avi

When you attempt to use the google command for a service for the first time, it will open your web browser and ask you to authenticate it. Click “grant access” and then press Enter back in the terminal window.

google-cli-docs-grant-access

GoogleCLI will even let you edit documents from your computer (In order to use it, you will need the latest version of python-gdata). For example, to edit a document called “Cool Ideas”, type the following:

google docs edit --title 'Cool Ideas' --editor nano

You can choose the editor of your choice for your actual editing or leave off the editor argument if you have already configured it in your “config” file.

GoogleCLI provides users who love the power of the command line with a very useful tool to perform basic or advanced tasks from any computer. Best of all, GoogleCLI is free and open source. Download it, contribute, and enjoy.