A ruby gem to give you the power of Google Search in your command line.
The CLI displays results from the Google Web Search API, allows you to page through the results, and choose a page to view, all without leaving the command line.
gem install google # Requires Ruby 1.9
google --help will list all the available commands. They are also listed here.
The google gem is a simple tool to search Gooogle with via a CLI. Usage: google [options] "my search query string here" where [options] are: --page, -p <i>: Start by showing the <i>th result page. (Default: 1) --size, -s <i>: Show <i> results on each SERP. Must be between 1 and 8. (Default: 4) --result, -r <i>: Skip the SERP and show the <i>th result. --lucky, -l: I'm feeling lucky! Skip the SERP and show the first result. (Alias to --result 1) --no-readability, -e: Filter the results through readability to get rid of extra content. (Default: true) --no-markdown, -m: Change the results from raw HTML to markdown. (Default: true) --version, -v: Print the version and exit. --help, -h: Show this information and exit.
google -l 'how to install nvidia drivers debian squeeze' | less
google 'site:randsinrepose.com NADD'
google '"Kerrick Long" -inurl:kerrick -inurl:kerricklong'
You have access to all the search operators you've come to know and love in Google Search.
If using the
--result flags, you can pipe the results into any other unix command.
Results pages are formatted to look like a Google SERP, including colors, domains, descriptions, and bold search matches. (Shoutout to formatador!)
You can pipe a result into another unix command! At the prompt, type the number of the result, followed by a pipe as normal. Note that utilities such as
more that need to control the display don't work.
Enter N or P for pagination, E or Q to quit, or a number to see that result. > 3 | espeak -a 200 -v en-us
This library has only been tested against Ruby 1.9.3. Other versions might be supported, but they haven't been tested.
This gem is Powered by Google.
Copyright (c) 2012 Kerrick Long. See LICENSE for details.