MCPcopy Index your code
hub / github.com/PatNeedham/google-it

github.com/PatNeedham/google-it @v1.6.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.6.4 ↗ · + Follow
52 symbols 125 edges 18 files 0 documented · 0% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

google-it Build Status npm version Codecov Coverage Maintainability

A simple library to convert Google search results to JSON output, with an interactive display option coming in the near future.

Install

$ npm install --save -g google-it

Example Usage

$ google-it --query="Latvian unicorn"

GIF of google-it

Prevent display in the terminal, and save results to a JSON file:

$ google-it --query="PWAs with react-router and redux" -o results.json -n

GIF of google-it w/o display, results saved to file

$ google-it --query="open whisper systems" -O 5

GIF of opening-in-browser

$ google-it --query="mechanical turk" --only-urls

Screenshot of only-urls option

Command Line Arguments

  • [x] query - the query that should be sent to the Google search
  • [x] output - name of the JSON file to save results to
  • [x] no-display - prevent results from appearing in the terminal output. Should only be used with --output (-o) command when saving results to a file
  • [ ] save - name of the html file if you want to save the actual response from the html request (useful for debugging purposes)
  • [x] limit - number of search results to be returned
  • [x] only-urls - only display the URLs, instead of the titles and snippets
  • [ ] verbose - console.log useful statements to show what's currently taking place
  • [ ] interactive - once results are returned, show them in an interactive prompt where user can scroll through them
  • [ ] bold-matching-text - only takes effect when interactive (-i) flag is set as well, will bold test in results that matched the query
  • [x] includeSites - option to limit results to comma-separated list of sites
  • [x] excludeSites - option to exclude results that appear in comma-separated list of sites
  • [x] open - opens the first X number of results in the browser after finishing query
  • [x] disableConsole - intended to be used with programmatic use, so that the color-coded search results are not displayed in the terminal (via console.log) when not wanted.

Programmatic Use in NodeJS environment

  • [x] something like:
const  googleIt = require('google-it')

googleIt({'query': 'covfefe irony'}).then(results => {
  // access to results object here
}).catch(e => {
  // any possible errors that might have occurred (like no Internet connection)
})

// with request options
const options = {
  'proxy': 'http://localhost:8118'
};
googleIt({options, 'query': 'covfefe irony'}).then(results => {
  // access to results object here
}).catch(e => {
  // any possible errors that might have occurred (like no Internet connection)
})

Core symbols most depended-on inside this repo

logIt
called by 9
lib/utils.js
getSnippet
called by 7
lib/googleIt.js
logIt
called by 7
src/utils.js
validateCLIArguments
called by 6
lib/validateCLIArguments.js
getResponse
called by 5
lib/googleIt.js
display
called by 4
lib/googleIt.js
saveToFile
called by 4
lib/utils.js
_defineProperty
called by 4
lib/validateCLIArguments.js

Shape

Function 52

Languages

TypeScript100%

Modules by API surface

lib/googleIt.js12 symbols
src/utils.js10 symbols
lib/utils.js10 symbols
src/googleIt.js9 symbols
lib/validateCLIArguments.js4 symbols
src/validateCLIArguments.js3 symbols
src/parseCommandLineArgs.js1 symbols
lib/parseCommandLineArgs.js1 symbols
lib/main.js1 symbols
__tests__/googleIt.spec.js1 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add google-it \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact