SeaGOAT is an advanced codebase analysis and search tool designed for Git repositories. It creates vector embeddings of your code, enabling fast, context-aware, and semantic code search. SeaGOAT provides both a server and a command-line interface (CLI) for querying your codebase, making it easier to find functions, classes, or code snippets using natural language, keywords, or regular expressions.
- Codebase Analysis: Analyzes your Git repository and builds vector embeddings for efficient search.
- Semantic Search: Query your codebase using keywords, regex, or natural language descriptions.
- Context-Aware Results: Retrieve results with configurable lines of context above and below each match.
- Generative Enhancements: Optionally use generative models to enhance search results.
- Server-Client Architecture: Run a local server to analyze and serve queries; interact via CLI or HTTP API.
- Performance Testing: Includes Locust-based load testing scripts.
- Extensive Test Suite: Comprehensive tests for server, CLI, and core modules.
SeaGOAT uses Poetry for dependency management and virtual environments.
# Clone the repository
git clone <this-repo-url>
cd Seagoat
# Install dependencies
poetry install
# Activate the virtual environment
poetry shell
The server must be started in the root of your Git repository:
poetry run python -m seagoat.server start <path-to-your-git-repo>
You can use the CLI to query your codebase:
poetry run python -m seagoat.cli "your search query" <path-to-your-git-repo>
--max-results/-l
: Limit the number of results--context-above/-B
and--context-below/-A
: Lines of context--context/-C
: Context above and below--generative/-g
: Use generative model for enhanced results--reverse/-r
: Reverse result order
POST /lines/query
: Query lines in the codebasePOST /files/query
: Query filesGET /status
: Server status and analysis progress
Use Locust to simulate load:
poetry run locust -f locustfile.py --host=http://localhost:<port>
Run the test suite using pytest:
poetry run pytest
The tests/
directory contains comprehensive tests for server, CLI, configuration, and core logic.
See the docs/
folder for demo GIFs:
demo.gif
,demo-slideshow.gif
,describe_what_you_are_looking_for.gif
, etc.
SeaGOAT: Semantic code search for your Git repositories.