GOOGLER(1)

✨ googler(1) β€” User Commands, but make it iconic ✨

okay so bestie, buckle UP, because googler is about to become your new main character πŸ’…


🌸 NAME 🌸

googler β€” Google from the command-line. yes really. the whole entire Google, in your terminal, no browser window required πŸ¦‹


🌈 SYNOPSIS 🌈

googler [OPTIONS] [KEYWORD [KEYWORD ...]]

πŸ’– DESCRIPTION πŸ’–

googler is a command-line tool that lets you search Google β€” web, news, videos and site search β€” straight from the terminal. Google site search works too, obvs. For every result, googler shows you the title, the URL and the text context. Results come in pages, and you can flip to the next or previous page with keyboard shortcuts. Results are indexed, so you can just yeet a result URL into a browser by typing its index number. There's no config file, because aliases do the same job for this utility β€” and it supports sequential searches in a single instance, so you never have to leave. periodt.

⭐ Features ⭐

  • Google Search, Google Site Search, Google News
  • Fast and clean (no ads, stray URLs or clutter), custom color
  • Navigate result pages from omniprompt, open URLs in browser
  • Effortless keyword-based site search with googler @t add-on
  • Search and option completion scripts for Bash, Zsh and Fish
  • Fetch n results in a go, start at the n-th result
  • Disable automatic spelling correction and search exact keywords
  • Specify duration, country/domain (default: worldwide/.com), language
  • Google keywords (e.g. filetype:mime, site:somesite.com) support
  • Open the first result directly in browser (as in I'm Feeling Lucky)
  • Non-stop searches: fire new searches at omniprompt without exiting
  • HTTPS proxy, User Agent, TLS 1.2 (default) support
  • Comprehensive documentation, man page with handy usage examples
  • Minimal dependencies

like... minimal dependencies?? she's low maintenance AND high value. we love that for us 🫢


✨ OPTIONS ✨

  • -h, --help β€” Show help text and exit. the "just tell me what to do" button πŸŽ€
  • -s, --start=N β€” Start at the Nth result. skip to your moment.
  • -n, --count=N β€” Show N results (default 10).
  • -N, --news β€” Show results from news section. for when you need the tea, freshly brewed β˜•
  • -c, --tld=TLD β€” Country-specific search with top-level domain .TLD, e.g., in for India.
  • -l, --lang=LANG β€” Search for the language LANG, e.g., fi for Finnish.
  • -g, --geoloc=CC β€” Country-specific geolocation search with country code CC, e.g. 'in' for India. Country codes are the same as top-level domains.
  • -x, --exact β€” Disable automatic spelling correction. Search exact keywords. she said what she said πŸ’…
  • -C, --nocolor β€” Disable color output.
  • --colors=COLORS β€” Set output colors. Refer to the COLORS section below for details.
  • -j, --first, --lucky β€” Open the first result in a web browser; implies --noprompt. Feeling Lucky? πŸ‘‘
  • -t, --time=dN β€” Time limit search [h5 (5 hrs), d5 (5 days), w5 (5 weeks), m5 (5 months), y5 (5 years)].
  • -w, --site=SITE β€” Search a site using Google.
  • -e, --exclude=EXCLUDE β€” Exclude site from results. not on my feed, thank you πŸ™ˆ
  • --unfilter β€” Do not omit similar results. give me ALL of them, no gatekeeping.
  • -p, --proxy=PROXY β€” Tunnel traffic through an HTTP proxy. PROXY is of the form [http://][user:password@]proxyhost[:port]. The proxy server must support HTTP CONNECT tunneling and must not block port 443 for the relevant Google hosts. If a proxy is not explicitly given, the https_proxy environment variable (if available) is used instead.
  • --noua β€” Disable user agent. Results are fetched faster. speed. ⚑
  • --notweak β€” Disable TCP optimizations. Negotiate Transport Layer Security protocol instead of forcing TLS 1.2 (on Python 3.4 and above). Should be used only in case of connection issues.
bestie listen β€” only reach for this one if you're actually having connection issues. it's not a vibe-boost, it's a troubleshooting move.
  • --json β€” Output in JSON format; implies --noprompt.
  • --url-handler=UTIL β€” Custom script or command-line utility to open urls with.
  • --show-browser-logs β€” Do not suppress browser output when opening result in browser; that is, connect stdout and stderr of the browser to googler's stdout and stderr instead of /dev/null. By default, browser output is suppressed (due to certain graphical browsers spewing messages to console) unless the BROWSER environment variable is a known text-based browser: elinks, links, lynx, w3m or www-browser.
  • --np, --noprompt β€” Perform search and exit; do not prompt for further interactions. in and out, no small talk πŸ’€
  • -u, --upgrade β€” Perform in-place self-upgrade. By default, the latest stable version is used. However, the latest git master is used instead if --include-git is also supplied. This mechanism is not available on Windows (including Cygwin), and if you installed googler with a package manager, this mechanism may have been disabled by your packager at packaging or install time.
  • --include-git β€” See --upgrade.
  • -v, --version β€” Show version number and exit.
  • -d, --debug β€” Enable debugging.

πŸŽ€ OMNIPROMPT KEYS πŸŽ€

this is the part where googler looks at you and goes "so… what do we do now?" and you get to type stuff ✨

  • n, p β€” Fetch the next or previous set of search results.
  • index β€” Open the result corresponding to index in browser.
  • f β€” Jump to the first page.
  • o [index|range|a ...] β€” Open space-separated result indices, numeric ranges (sitelinks unsupported in ranges) or all indices, if 'a' is specified, in the browser. Open the current search in the browser, if no arguments.
  • O [index|range|a ...] β€” Works similar to key 'o', but tries to ignore text-based browsers (even if BROWSER is set) and open links in a GUI browser.
  • g keywords β€” Initiate a new Google search for keywords with original options. This key should be used to search omniprompt keys (including itself) and indices.
  • c index β€” Copy url to clipboard.
  • u β€” Toggle url expansion.
  • q, ^D, double Enter β€” Exit googler.
  • ? β€” Show omniprompt help.
  • * β€” Any other string initiates a new search with original options.

πŸ¦‹ GOOGLER @T πŸ¦‹

googler @t is a convenient add-on to Google Site Search with unique keywords. While googler has an integrated option to search a site, it could be simplified further with aliases. The file googler_at (https://github.com/jarun/googler/blob/master/auto-completion/googler_at/googler_at) contains a list of website search aliases. To source it, run:

source googler_at

or

. googler_at

With googler @t, the following command searches Wikipedia for hexspeak:

@w hexspeak

Other googler options can be combined. The shell can be configured to be source the file at start-up for further convenience.

All the aliases start with the @ symbol (hence the name googler @t) and there is minimum chance they will conflict with any shell commands. Users can add new aliases to the file.

like the naming?? @ + t = @t. it's giving genius, it's giving pun, it's giving iconic 🧚


πŸ’œ COLORS πŸ’œ

googler lets you customize the color scheme via a six-letter string, reminiscent of BSD LSCOLORS. The six letters represent the colors of

  • indices
  • titles
  • URLs
  • metadata/publishing info (Google News only)
  • abstracts
  • prompts

respectively β€” in that exact order, bestie, don't shuffle them. The six-letter string is passed in either as the argument to the --colors option, or as the value of the environment variable GOOGLER_COLORS.

We offer the following colors/styles:

  • a β€” black
  • b β€” red
  • c β€” green
  • d β€” yellow
  • e β€” blue
  • f β€” magenta
  • g β€” cyan
  • h β€” white
  • i β€” bright black
  • j β€” bright red
  • k β€” bright green
  • l β€” bright yellow
  • m β€” bright blue
  • n β€” bright magenta
  • o β€” bright cyan
  • p β€” bright white
  • A-H β€” bold version of the lowercase-letter color
  • I-P β€” bold version of the lowercase-letter bright color
  • x β€” normal
  • X β€” bold
  • y β€” reverse video
  • Y β€” bold reverse video

The default colors string is GKlgxy, which stands for

  • bold bright cyan indices
  • bold bright green titles
  • bright yellow URLs
  • cyan metadata/publishing info
  • normal abstracts
  • reverse video prompts

Note that

  • Bright colors (implemented as \x1b[90m - \x1b[97m) may not be available in all color-capable terminal emulators;
  • Some terminal emulators draw bold text in bright colors instead;
  • Some terminal emulators only distinguish between bold and bright colors via a default-off switch.

Please consult the manual of your terminal emulator as well as https://en.wikipedia.org/wiki/ANSI_escape_code for details.

ngl terminal colors are lowkey a whole personality trait per emulator. check your own manual before you come for googler's palette πŸ’€

🌟 ENVIRONMENT 🌟

  • BROWSER β€” Overrides the default browser. Ref: http://docs.python.org/library/webbrowser.html
  • GOOGLER_COLORS β€” Refer to the COLORS section.
  • DISABLE_PROMPT_COLOR β€” Force a plain omniprompt if you are facing issues with colors at the prompt.
  • https_proxy β€” Refer to the --proxy option.
  • DISABLE_URL_EXPANSION β€” Show the domain names in search results instead of the expanded URL.

✨ EXAMPLES ✨

okay bestie, here are the vibes in action β€” copy-paste these and you're literally a googler god/goddess πŸ’…

  1. Google hello world:
googler hello world
  1. Fetch 15 results updated within the last 14 months, starting from the 3rd result for the keywords jungle book in site imdb.com:
googler -n 15 -s 3 -t m14 -w imdb.com jungle book
  1. Read recent news on gadgets:
googler -N gadgets
  1. Fetch results on IPL cricket from Google India server in English:
googler -c in -l en IPL cricket
  1. Search quoted text:
googler it\'s a \"beautiful world\" in spring
  1. Search for a specific file type:
googler instrumental filetype:mp3
  1. Disable automatic spelling correction, e.g. fetch results for googler instead of google:
googler -x googler
  1. I'm feeling lucky search:
googler -j leather jackets
  1. Website specific search:
googler -w amazon.com -w ebay.com digital camera

Site specific search continues at omniprompt. ✨

  1. Alias to find definitions of words:
alias define='googler -n 2 define'
  1. Look up n, p, o, O, q, g keywords or a result index at the omniprompt: as the omniprompt recognizes these keys or index strings as commands, you need to prefix them with g, e.g.,
g n
g g keywords
g 1
  1. Input and output redirection:
googler -C hello world < input > output
Note that -C is required to avoid printing control characters (for colored output). don't skip it bestie 😭
  1. Pipe output:
googler -C hello world | tee output
  1. Use a custom color scheme, e.g., one warm color scheme designed for Solarized Dark:
googler --colors bjdxxy google
GOOGLER_COLORS=bjdxxy googler google
  1. Tunnel traffic through an HTTPS proxy, e.g., a local Privoxy instance listening on port 8118:
googler --proxy localhost:8118 google
By default the environment variable https_proxy is used, if defined.
  1. Quote multiple search keywords to auto-complete (using completion script):
googler 'hello w<TAB>

πŸ’– AUTHORS πŸ’–

These iconic humans made the magic happen:

  • Henri Hakkinen
  • Arun Prakash Jana <engineerarun@gmail.com>
  • Zhiming Wang <zmwangx@gmail.com>

🏠 HOME 🏠

the mothership: https://github.com/jarun/googler


🐞 REPORTING BUGS 🐞

found a bug? spill the tea here: https://github.com/jarun/googler/issues


πŸ“œ LICENSE πŸ“œ

Copyright Β© 2008 Henri Hakkinen Copyright Β© 2015-2021 Arun Prakash Jana <engineerarun@gmail.com>

License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.


okay bestie that's the whole entire page πŸ’– this was GOOGLER(1), version 4.3.2, dated 21 Jan 2021 β€” now go forth and Google like the main character you are βœ¨πŸ‘‘