Code Monkey home page Code Monkey logo

cerebro's Introduction

Cerebro

Cerebro Search through github forks of a repo for search terms! Great for maintainers that want to know what downstream forks are doing.

Installation

Install it with:

$ gem install cerebro

Details

Cerebro currently works by using the Github API to identify all the forks of the repo if interest. It then will clone all the repos down into a specifically named repo under the $HOME/.cerebro directory. It will then use grep searching to determine if your search term is present in each/which of the forks.

Usage

  • Cloning down of the repos will be shallow by default. If you want deep clones, use cerebro search --deep.

####Searching:

  • To clean up all repos that Cerebro has cloned onto your local file system:
$ GITHUB_TOKEN=<github_api_token> cerebro search <repo_owner> <repo_name> <search_term>

For example, if I'm looking to determine how many forks of the Cloud Foundry python buildpack have been forked to add or use graphviz, I might run:

GITHUB_TOKEN=<github_token> cerebro search cloudfoundry python-buildpack graphviz
Found 85 forks of cloudfoundry/python-buildpack
All forks will be stored in /Users/user/.cerebro/python-buildpack-forks
Cloning or updating all local fork repos...
<...>
Searching through these forks now...

----------------Search Results---------------------
Found graphviz in kdunn-pivotal-python-buildpack
Found graphviz in ssssam-python-buildpack

Found "graphviz" in 2 forks out of total 85 forks of cloudfoundry/python-buildpack

Clones of forked repos are located in /Users/user/.cerebro/python-buildpack-forks

####Cleaning Up:

  • To clean up all repos that Cerebro has cloned onto your local file system:
$ cerebro clean --all
  • To clean up only the repos that are forks for a specific repo:
$ cerebro clean <repo-name>

Dependencies

  • This gem relies on git for cloning down forks of repos.
  • This gem currently relies on $HOME being set on your machine for figuring out where to store cloned repos.
  • This gem's searching for forks relies on the user providing a valid Github API token via GITHUB_TOKEN env vars. This token is not persisted or stored at all.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/RochesterinNYC/cerebro or in https://cloudfoundry.slack.com/messages/buildpacks/.

Later Work

  • Make dirnames specific to owner and repo name instead of just repo name
  • Command for cleaning up stored repos
  • Specify where to store cloned repos
  • Option for auto-clean up afterwards
  • Better UX for specifying github auth
  • Remove dependency on octokit
  • Threading for parallel cloning
  • Search caching?

License

The gem is available as open source under the terms of the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.