For many computer users, mentioning anything about the command line may evoke memories of early PCs with MS-DOS; for some others, it may just evoke a “Huh?”. But those of us who have been around for a while do remember using computers, even before MS-DOS, when the command line was the only game in town; and we still managed to do some useful work. Smart systems administrators, and particularly server administrators, know that the command line is still a very efficient way of accomplishing some jobs, especially since it lends itself so well to use in scripts.
So I was interested to see an announcement on the Google Open-Source blog about the introduction of the Google Command-Line Tool. This tool, written in the Python language, uses the Google Python Data APIs to provide command-line access to Google Web services (the examples, taken from Google’s documentation, are all based on Linux/UNIX command syntax):
Ever wanted to upload a folder full of photos to Picasa from a command prompt? We did, a lot, last summer. It made us want to say:
> google picasa create --title "My album" ~/Photos/vacation/*.jpg
So we wrote a program to do that, and a whole lot more.
The tool currently supports Google’s Blogger, Calendar, Contacts, Docs, Picasa, and YouTube services; other Google services are promised for future releases. More information is available from the GoogleCL project home page.
To give a simple example of how this tool might be useful, observe that the tool allows you to submit a post to Blogger with the command:
> google blogger post --blog "MyBlog" --tags "stuff,software" post.html
This probably is not the way you would submit an ordinary post, but it might be quite useful in the context of a system that could generate a post automatically from a template. A system for announcing software updates and releases might be built to post blog announcements in this way, for example. Particularly in the UNIX/Linux environment, the underlying philosophy of command tools is that they are designed so that they can be used together (with pipes, for example), which makes even a simple scripting language like that of the shell (such as sh, bash, or csh) very powerful.
So, if you have spent all, or almost all, of your computing life using a graphical user interface [GUI], the idea of having a command line tool may seem quaint; but it is quite consistent with Google’s focus on computing in the cloud, and with the concepts underlying the forthcoming Chrome OS.
The current version of the software is available for download from the project page in two forms: the source code, in a compressed
tar archive, and as a Debian (
.deb) package for Linux systems. Using the tool also requires the
gdata-python-client library. The project page also has examples of the tool’s use.