Searching for Books in Command Line Interface (CLI)

announcement, blogentry, programming


Featured Image Credit -Photo by Redd Angelo on Unsplash

I'd like to show you a Node CLI (Command Line Interface), Google-Book-Shell I created from a throwaway code.

Here are the three things you can do with it.

  1. You can search for a book from Google Books.
  2. The searched book detail can be viewed.
  3. Open the book on Google Books or Amazon page in a browser.


I am a voracious reader being a somewhat bibliophile. Searching for books online was slow due to an overhead of browser too slow. At the time, I was learning how to create a Node CLI application as well as ES6 syntax. I just decided to write a program on a whim.

Google-Book-Shell in Action

OK, I've rambled on too much. Here is the CLI in action (It's a GIF but click to go to YouTube video).

Here is the basic workflow.

  • Search for a book with a search command.
  • View the detail of a book with a view command.
  • Optionally open the link in a browser (to Google Books or Amazon website) with an open command.

Here is the README, which covers how to install it and use it more thoroughly.

Notes on Open command

When you open an Amazon page, the CLI queries Amazon's Product Advertising API (PAA) via Azure Functions. I didn't want to expose my Amazon Product Key and Secret so I moved the PAA query functionality to Azure Functions (after failed attempt to use AWS Lambda...). Azure Functions sleeps after 5 minutes of inactivity so opening an Amazon page for the first time could take 10~30 seconds unfortunately for I have used a pay-per-use plan.

PAA requires a developer to sign up for Amazon Affiliate Program. Thus the Amazon link returned adds a finger print with my affiliate info. I've added a flag(--strip-amazon-affiliate or -s) in open command to strip it out in case you do not want that info in the link.


(Please don't be mean to me 😞 )

Parting Words

Google-Book-Shell will make your book searching easier. If you find any issues or suggestions, please leave a feedback on the GitHub new issues page.

I will write another entry on technical challenges I had as well as the architecture (and lack thereof).

WARNING: By the way, the source is very sloppy since it was built from a throwaway code while learning ES6 😊