A web interface for ripgrep (rg) that allows you to search for data (like phone numbers) with automatic variation generation and context display.
- Multi-Flow Search: Search for multiple terms simultaneously (e.g., a name AND a phone number).
- Flexible Path: Configure the search directory or file directly from the UI.
- PII Search: Specialized handling for phone numbers (auto-generates variations like
123-456-7890,(123) 456-7890, etc.). - Context Awareness: Configurable context lines around matches.
- Smart Folding: Folds long lines (>1000 chars) while keeping the matched content visible.
- Command Preview: See the exact
rgcommand being executed.
- Python: 3.10 or higher.
- ripgrep: The
rgcommand line tool must be installed and available in your system's PATH.- MacOS:
brew install ripgrep - Ubuntu/Debian:
sudo apt-get install ripgrep - Windows:
choco install ripgrep
- MacOS:
-
Clone the repository or navigate to the project directory.
-
Install the required Python dependencies:
pip install fastapi uvicorn jinja2 requests
Or if you are using
uvor another package manager, install frompyproject.toml.
You can search any file or directory. To test quickly:
- Create a file named
data.txtin the project root. - Add some text content you want to search through.
- Use
.(current directory) ordata.txtin the "search path" input.
-
Start the FastAPI server:
uvicorn main:app --reload
The
--reloadflag is useful for development as it restarts the server on code changes. -
Open your web browser and navigate to:
http://127.0.0.1:8000 -
The Hood (Search Path): Enter
.to search the current directory or a specific file path. -
Freestyle (Query): Enter your search term. Click "+ Add Another Flow" to search for multiple items at once.
-
Mic Check: Click search. The executed command will appear immediately, followed by results grouped by file.
GET /: Serves the main search interface.POST /search: JSON API to perform searches.- Body:
{ "queries": [ {"query": "1234567890", "type": "phone"}, {"query": "john", "type": "name"} ], "search_path": ".", "context": 5, "fold": true }
- Body:
POST /search/preview: Returns thergcommand string that would be executed for a given request without running it.