A tool for analyzing GitHub repositories using LLMs.
- Analyze multiple GitHub repositories at once
- Use custom prompts for different types of analyses
- Generate detailed project analysis reports in Markdown or JSON
- Configurable model selection and parameters
- Interactive progress tracking
- Automatic retries for API failures
- Built with LangChain and Google Gemini
The original command-line interface for analyzing repositories.
The new RESTful API server with user accounts, background processing, and IPFS integration:
- User authentication and management
- Repository analysis via API endpoints
- Report storage in PostgreSQL and IPFS
- Async processing with background workers
Learn more about the API Server
# Clone the repository
git clone <repository-url>
cd ai-project-analyzer
# Install dependencies (using uv)
uv pip install -e .
# Install dependencies
uv pip install -e .
# Start the Redis server (required for background processing)
docker run -d -p 6379:6379 --name redis-server redis
# Start PostgreSQL (required for database)
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_USER=postgres -e POSTGRES_DB=analyzer_db --name postgres-server postgres
# Start the API server and worker
./start.sh
# API will be available at http://localhost:8000
# API documentation at http://localhost:8000/docs
The API server consists of these components:
- API Server: Handles HTTP requests and responses using FastAPI
- Worker Process: Processes repository analysis tasks in the background
- Redis Server: Used for the background job queue
- PostgreSQL Database: Stores users, analysis tasks, and reports
You can start these components individually:
# Start only the API server
./start.sh --api-only
# Start only the worker process
./start.sh --worker-only
Copy the .env.template
file to .env
and fill in your API key:
cp .env.template .env
# Edit .env with your preferred text editor
Required configuration:
# LLM settings
GOOGLE_API_KEY=your_gemini_api_key_here
# For API server
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/analyzer_db
REDIS_URL=redis://localhost:6379/0
JWT_SECRET=your_secret_key_here
Optional configuration:
# API server settings
API_HOST=0.0.0.0
API_PORT=8000
DEBUG=False
# Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
LOG_LEVEL=INFO
# Default model to use
DEFAULT_MODEL=gemini-2.5-pro-preview-03-25
# Temperature setting (0.0-1.0)
TEMPERATURE=0.2
# GitHub settings
GITHUB_TOKEN=your_github_token_here
These environment variables can also be set directly in your shell environment.
# Basic usage
uv run main.py --github-urls github.com/celo-org/celo-composer
# Analyze multiple repositories
uv run main.py --github-urls github.com/celo-org/celo-composer,github.com/celo-org/celo-monorepo
# Use a custom prompt
uv run main.py --github-urls github.com/celo-org/celo-composer --prompt prompts/celo.txt
# Select a different model
uv run main.py --github-urls github.com/celo-org/celo-composer --model gemini-1.5-pro
# Adjust generation temperature (0.0-1.0)
uv run main.py --github-urls github.com/celo-org/celo-composer --temperature 0.7
# Output in JSON format
uv run main.py --github-urls github.com/celo-org/celo-composer --json
# Set logging level
uv run main.py --github-urls github.com/celo-org/celo-composer --log-level DEBUG
# Specify output directory
uv run main.py --github-urls github.com/celo-org/celo-composer --output ./my-reports
gemini-2.5-pro-preview-03-25
: Advanced model with enhanced capabilities and performance
You can create custom prompts in the prompts/
directory. See the existing files for examples.
The tool comes with:
prompts/default.txt
: General project analysis promptprompts/celo.txt
: Specialized prompt for Celo ecosystem projectsprompts/report-template.txt
: Template for structuring analysis reports
All analyses include scores for these standard criteria:
-
Security (0-100)
- Authentication & authorization
- Data validation
- Vulnerability prevention
-
Functionality & Correctness (0-100)
- Core functionality implementation
- Error handling
- Edge case management
-
Readability & Understandability (0-100)
- Code style consistency
- Documentation quality
- Naming conventions
-
Dependencies & Setup (0-100)
- Dependencies management
- Installation process
- Configuration approach
-
Evidence of Technical Usage (0-100)
- Technology-specific implementation
- Adherence to best practices
- Integration quality
To create your own custom prompt:
- Create a new text file in the
prompts/
directory - Include scoring criteria following the standard template
- Add specific sections relevant to your technology
- Run the tool with
--prompt prompts/your-prompt.txt
For technology-specific prompts, be sure to include a detailed "Evidence of Usage" section that explains what indicators the LLM should look for to verify the technology is being used correctly.
- Markdown (default): Human-readable reports with structured sections
- JSON: Machine-readable structured data (use the
--json
flag) - Summary Report: Automatically generated when analyzing multiple repositories
Reports are organized in a timestamp-based directory structure:
reports/
└── MM-DD-YYYY-HHMM/
├── celo-org-celo-composer-analysis.md
├── celo-org-celo-monorepo-analysis.md
└── summary-report.md
When analyzing multiple repositories, a summary report is automatically generated with:
- Comparison table of all repository scores
- Average scores across all analyzed repositories
- Links to individual reports
MIT