A Python tool that uses repomix to analyze GitHub repositories and Google's Gemini AI to identify bugs, vulnerabilities, and code quality issues.
- Python 3.8+
- Node.js and npm (required for repomix)
- Python packages:
pip install google-generativeai python-dotenv - Google API Key for Gemini API access
-
Create a
.envfile in the same directory as the script:GOOGLE_API_KEY=your_google_api_key_here -
Ensure Node.js and npm are installed and accessible from your PATH.
-
Default mode - analyze the default repository:
python repo_analyzer.py -
Analyze a different repository:
- Open
repo_analyzer.py - Edit the
DEFAULT_GITHUB_REPO_URLconstant (around line 30) - Run the script
# Example: Change repository URL DEFAULT_GITHUB_REPO_URL = "https://github.com/username/repository"
- Open
The script automatically generates two files:
{repo_name}_repomix_dump.txt- Contains the repository code extracted by repomix{repo_name}_gemini_analysis.txt- Contains Gemini's analysis of the codebase
Other configurable options in the script:
GEMINI_MODEL_NAME- The Gemini model to use for analysisSAVE_REPOMIX_OUTPUT- Whether to save the repomix output (true/false)SAVE_GEMINI_ANALYSIS- Whether to save the Gemini analysis (true/false)DEFAULT_REPOMIX_OUTPUT_FILENAME- Template for the repomix output filenameDEFAULT_GEMINI_ANALYSIS_FILENAME- Template for the Gemini analysis filename