Top Related Projects
Lightning fast code searching made easy
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
A code-searching tool similar to ack, but faster.
:cherry_blossom: A command-line fuzzy finder
A simple, fast and user-friendly alternative to 'find'
rga: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc.
Quick Overview
Hound is a fast code search tool that helps developers quickly find and navigate through code in large repositories. It supports multiple languages and integrates with various version control systems, making it an efficient solution for teams working on complex codebases.
Pros
- Fast and efficient code search across multiple repositories
- Supports a wide range of programming languages
- Easy integration with popular version control systems like Git
- Provides a web-based interface for convenient access
Cons
- Requires setup and maintenance of a separate search infrastructure
- May have a learning curve for new users unfamiliar with advanced search syntax
- Resource-intensive for very large codebases or organizations with numerous repositories
- Limited customization options compared to some other code search tools
Getting Started
To get started with Hound, follow these steps:
-
Clone the repository:
git clone https://github.com/hound-search/hound.git
-
Install dependencies:
cd hound go get -v
-
Build the project:
go build
-
Create a configuration file
config.json
in the project root:{ "dbpath" : "data", "repos" : { "MyRepo" : { "url" : "https://github.com/username/repo.git" } } }
-
Run Hound:
./hound
-
Access the web interface at
http://localhost:6080
For more detailed instructions and advanced configuration options, refer to the project's documentation on GitHub.
Competitor Comparisons
Lightning fast code searching made easy
Pros of Hound
- More active development with recent commits and releases
- Larger community with more stars, forks, and contributors
- Better documentation and examples for setup and usage
Cons of Hound
- Higher system requirements and more complex setup
- Steeper learning curve for configuration and customization
- May be overkill for smaller projects or simpler search needs
Code Comparison
Hound configuration example:
{
"max-concurrent-indexers" : 2,
"dbpath" : "data",
"repos" : {
"MyRepo" : {
"url" : "https://github.com/example/repo.git"
}
}
}
Hound> configuration example:
repos:
- name: MyRepo
url: https://github.com/example/repo.git
branch: main
file_patterns:
- "*.go"
- "*.js"
Both projects aim to provide code search functionality, but Hound offers more advanced features and scalability for larger codebases. Hound> is simpler and more lightweight, making it easier to set up and use for smaller projects or teams. The choice between the two depends on the specific needs of the project, team size, and desired search capabilities.
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
Pros of ripgrep
- Significantly faster performance, especially for large codebases
- Respects .gitignore rules by default, improving search relevance
- Supports searching compressed files without explicit decompression
Cons of ripgrep
- Lacks a web interface for easy sharing and collaboration
- Does not provide real-time indexing for continuously updated repositories
- Limited to local searches, without built-in support for distributed setups
Code Comparison
ripgrep:
use grep_regex::RegexMatcher;
use grep_searcher::Searcher;
use ignore::WalkBuilder;
let matcher = RegexMatcher::new(r"pattern").unwrap();
let walker = WalkBuilder::new("path/to/search").build();
Searcher::new().search_path(&matcher, walker, |matched_lines| {
// Process matched lines
Ok(true)
}).unwrap();
Hound:
searcher := searcher.New()
matches, err := searcher.Search(&search.SearchOptions{
Filename: "path/to/search",
Pattern: "pattern",
})
if err != nil {
// Handle error
}
// Process matches
The code snippets demonstrate the core search functionality in each project. ripgrep uses Rust with a more low-level approach, while Hound employs Go with a higher-level abstraction for searching.
A code-searching tool similar to ack, but faster.
Pros of The Silver Searcher
- Faster performance for local file searches
- Lightweight and easy to install on various systems
- Supports a wide range of file types and ignores binary files by default
Cons of The Silver Searcher
- Limited to local file searches
- Requires installation on each machine where it's used
- May not be as suitable for large-scale, distributed code searches
Code Comparison
The Silver Searcher:
ag "search_pattern" /path/to/search
Hound:
curl "http://localhost:6080/api/v1/search?repos=*&q=search_pattern"
Key Differences
- Hound is designed for web-based, multi-repository searches, while The Silver Searcher focuses on local file system searches
- Hound provides a web interface and API, making it more suitable for integration into larger systems
- The Silver Searcher is typically faster for individual machine searches, but Hound excels in searching across multiple repositories simultaneously
Use Cases
- The Silver Searcher: Ideal for developers working on local projects or performing quick searches on their machines
- Hound: Better suited for teams working on multiple repositories or organizations needing a centralized code search solution
:cherry_blossom: A command-line fuzzy finder
Pros of fzf
- Lightweight and fast, with minimal dependencies
- Versatile, can be used for file searching, command history, and more
- Highly customizable with extensive configuration options
Cons of fzf
- Primarily a command-line tool, lacking a web interface
- Requires more setup and configuration for advanced use cases
Code Comparison
fzf:
find * -type f | fzf > selected
Hound:
searcher := searcher.NewSearcher(idx, &searcher.SearcherOptions{})
results, err := searcher.Search(query, opts)
Key Differences
- fzf is a general-purpose fuzzy finder, while Hound is specifically designed for code search
- Hound provides a web interface and is better suited for team collaboration
- fzf excels in local file system searches, while Hound is optimized for searching large codebases
Use Cases
- fzf: Command-line productivity, local file navigation, and filtering
- Hound: Code search across multiple repositories, integration with CI/CD pipelines
Community and Ecosystem
- fzf has a larger user base and more third-party integrations
- Hound is more focused on enterprise and team-oriented features
A simple, fast and user-friendly alternative to 'find'
Pros of fd
- Written in Rust, offering better performance and memory safety
- Simpler syntax and more user-friendly command-line options
- Colorized output and smart case sensitivity by default
Cons of fd
- Limited to file and directory search, not content search
- Lacks advanced regex support found in Hound
- No web interface for collaborative searching
Code Comparison
fd:
fd pattern
fd -e txt
fd -x echo
Hound:
houndd
hound search "pattern"
hound search -i "case insensitive"
Summary
fd is a modern, fast, and user-friendly alternative to the traditional find
command, focusing on simplicity and performance. It excels in quickly locating files and directories but lacks content searching capabilities.
Hound, on the other hand, is a powerful code search tool that allows for searching file contents across large codebases. It provides a web interface and supports regular expressions, making it more suitable for collaborative development environments and complex search patterns.
While fd is ideal for quick file system searches, Hound is better suited for in-depth code analysis and content searching across multiple repositories.
rga: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc.
Pros of ripgrep-all
- Supports searching within various file types (PDFs, E-books, Office documents, etc.)
- Faster search performance due to using ripgrep as its core
- Can be used as a command-line tool, offering more flexibility
Cons of ripgrep-all
- Lacks a web interface, which Hound provides for easier team collaboration
- Doesn't offer real-time indexing or automatic repository updates
- May require more setup and configuration for large-scale use
Code Comparison
Hound (config.json):
{
"max-concurrent-indexers": 2,
"dbpath": "data",
"repos": {
"MyRepo": {
"url": "https://github.com/example/repo.git"
}
}
}
ripgrep-all (command-line usage):
rga --rga-adapters=+pdfpages "search pattern" /path/to/files
While Hound is configured using a JSON file and provides a web interface, ripgrep-all is primarily used through the command line, offering more direct control over search parameters and file type adapters.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Hound
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. Here it is in action:
Quick Start Guide
Building hound
git clone https://github.com/hound-search/hound.git
cd hound
make
The resulting binaries (hound
, houndd
) can be found in the .build/bin/ directory.
- Create a config.json file and use it to list your repositories. Check out our example-config.json to see how to set up various types of repositories. For example, we can configure Hound to search its own source code using the config found in default-config.json:
{
"dbpath" : "db",
"repos" : {
"Hound" : {
"url" : "https://github.com/hound-search/hound.git",
"vcs-config" : {
"ref" : "main"
}
}
}
}
A complete list of available config options can be found here.
- Run the Hound server with
houndd
in the same directory as yourconfig.json
. You should see output similar to:
2015/03/13 09:07:42 Searcher started for statsd
2015/03/13 09:07:42 Searcher started for Hound
2015/03/13 09:07:42 All indexes built!
2015/03/13 09:07:42 running server at http://localhost:6080
- By default, hound hosts a web ui at http://localhost:6080 . Open it in your browser, and start searching.
Using Docker (1.14+)
-
Install docker if you don't have it. We need at least
Docker >= 1.14
. -
Create a config.json file and use it to list your repositories. Check out our example-config.json to see how to set up various types of repositories. For example, we can configure Hound to search its own source code using the config found in default-config.json.
Run with image from github
docker run -d -p 6080:6080 --name hound -v $(pwd):/data ghcr.io/hound-search/hound:latest
You should be able to navigate to http://localhost:6080/ as usual.
Build image and container yourself
- Clone repository
git clone https://github.com/hound-search/hound.git
cd hound
- Build the image
docker build . --tag=hound
- Create the container
docker create -p 6080:6080 --name hound -v $(pwd):/data hound
- Starting and stopping the container
docker start hound
docker stop hound
Running in Production
There are no special flags to run Hound in production. You can use the --addr=:6880
flag to control the port to which the server binds.
Currently, Hound does not support TLS as most users simply run Hound behind either Apache or nginx. However, we are open to contributions to add TLS support.
Why Another Code Search Tool?
We've used many similar tools in the past, and most of them are either too slow, too hard to configure, or require too much software to be installed. Which brings us to...
Requirements
- Go 1.16+
Yup, that's it. You can proxy requests to the Go service through Apache/nginx/etc., but that's not required.
Support
Currently Hound is only tested on MacOS and CentOS, but it should work on any *nix system. Hound on Windows is not supported but we've heard it compiles and runs just fine (although it helps to exclude your data folder from Windows Search Indexer).
Hound supports the following version control systems:
- Git - This is the default
- Mercurial - use
"vcs" : "hg"
in the config - SVN - use
"vcs" : "svn"
in the config - Bazaar - use
"vcs" : "bzr"
in the config - Local - use
"vcs" : "local"
in the config
See config-example.json for examples of how to use each VCS.
Private Repositories
There are a couple of ways to get Hound to index private repositories:
- Use the
local
pseudo-vcs driver. This allows you to index a local directory. You can set"watch-changes" : true
to calculate a recursive hash of all the files in the directory and automatically re-index. - Use the
file://
protocol. This allows you to index a local clone of a repository. The downside here is that the polling to keep the repo up to date will not work. (This also doesn't work on local folders that are not of a supported repository type.) If you're using Docker, you must mount a volume to your repository (e.g.,-v $(pwd)/src:/src
) and use the relative path to the repo in your configuration. - Use SSH style URLs in the config:
"url" : "git@github.com:foo/bar.git"
. As long as you have your SSH keys set up on the box where Hound is running this will work.
Keeping Repos Updated
By default Hound polls the URL in the config for updates every 30 seconds. You can override this value by setting the ms-between-poll
key on a per repo basis in the config. If you are indexing a large number of repositories, you may also be interested in tweaking the max-concurrent-indexers
property. You can see how these work in the example config.
Editor Integration
Currently the following editors have plugins that support Hound:
Hacking on Hound
Editing & Building
Requirements:
- make
- npm (Usuall npm comes bundled with Node.js. If that's not the case on the system you're using, you can get it here)
git clone https://github.com/hound-search/hound.git
cd hound
make
The hound executables will be available in .build/bin
.
Testing
There are an increasing number of tests in each of the packages in Hound. Please make sure these pass before uploading your Pull Request. You can run the tests with the following command. To run the entire test suite, use:
make test
If you want to just run the JavaScript test suite, use:
npm test
Any Go files that end in _test.go
are assumed to be test files. Similarly, any JavaScript files that ends in .test.js
are automatically run by Jest, our test runner. Tests should live next to the files that they cover.
Check out Jest's docs for more details on writing Jest tests,
and check out Go's testing docs for more details on testing Go code.
You need to install Node.js >= 12
and install jest
by npm install jest
to run the JS tests.
Working on the web UI
Hound includes a web UI that is composed of several files (html, css, javascript, etc.). To compile UI changes use:
make ui
To make development easier, there is a flag that will read the files from the file system (allowing the much-loved edit/refresh cycle).
First you should ensure you have all the dependencies installed that you need by running:
make dev
Then run the hound server with the --dev option:
.build/bin/houndd --dev
Get in Touch
Created at Etsy by:
Hound is maintained by:
Top Related Projects
Lightning fast code searching made easy
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
A code-searching tool similar to ack, but faster.
:cherry_blossom: A command-line fuzzy finder
A simple, fast and user-friendly alternative to 'find'
rga: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot