DEV Community

Chris L
Chris L

Posted on

How to quickly search all your repos at once

Working with microservices can be a pain, especially when one change can require multiple places to update. You have to check various repositories for occurrences of the piece of code you need to change. What can you do in that situation?

  1. Open all your repos in your favourite editor at once
  2. Use GitHub's search
  3. Open each and every one of your repos and search manually
  4. Follow instructions below and start using Hound

What is Hound and how to set it up locally?

Hound is an extremely fast source code search engine. The core is based on this article (and code) from Russ Cox: Regular Expression Matching with a Trigram Index. Hound itself is a static React frontend that talks to a Go backend. The backend keeps an up-to-date index for each repository and answers searches through a minimal API.

And here's how it works!

preview

Here's what you do:

  1. Go to the folder you want to keep the configs for Hound, for me it was ~/code/hound
  2. Create a config.json file, that points to your local repositories, like this
  3. Run docker run -d -p 6080:6080 --name hound -v $(pwd):/data -v ~/code:/code etsy/hound. Please remember that if the folder you keep your repos at is named differently, you have to adjust it in the config.json and in the docker command, specifically -v ~/code:/code part!
  4. Go to localhost:6080 & enjoy your quick search!

Bonus: Hound has integrations with Sublime, Vim, Emacs & Visual Studio code so you don't have to leave your favorite editor!

Shout out to https://twitter.com/kmossco and https://twitter.com/balazs_kutil for showing me Hound 🙇

Don't forget to check out my other posts at here.
Love Ruby, new tech, and working remotely? Check out https://leadfeeder.com/jobs and don't forget to mention my name!

Top comments (0)