An intelligent tool that leverages AI to analyze GitHub repositories, automate build processes, and compare codebases. Built with Python, OpenAI GPT, and DSPy.
- Repository Analysis: Automatically download and analyze GitHub repositories
- AI-Powered Build Instructions: Extract build steps from README files using OpenAI GPT and DSPy
- Automated Building: Execute extracted build instructions automatically
- Repository Comparison: Compare two repositories to find missing files
- Comprehensive Logging: Detailed logging system for debugging and monitoring
- Python 3.8 or higher
- GitHub API Token (How to get one)
- OpenAI API Key (Get from OpenAI)
-
Clone the Repository:
git clone https://github.com/Jimmyu2foru18/github-analyzer.git cd github-analyzer -
Run the development setup script:
run_project_dev.bat
The script will:
- Create a virtual environment
- Install required dependencies
- Prompt for API keys if not set
- Start the analyzer
-
Environment Variables:
GITHUB_TOKEN: Your GitHub API tokenOPENAI_API_KEY: Your OpenAI API key
-
Configuration File (
config.yaml):
yaml MODEL_NAME: "gpt-4.0-mini" BASE_DIRECTORY: "github-repos" LOG_DIRECTORY: "logs" DSPY_SETTINGS: cache_dir: "cache/dspy" temperature: 0.1 max_tokens: 1000
- Start the analyzer:
bash python main.py
-
When prompted:
- Enter the URL of the repository you want to analyze
- Optionally enter a second repository URL for comparison
-
The tool will:
- Download the repository
- Extract build instructions from README
- Execute build steps automatically
- Compare repositories if a second URL was provided
- Generate detailed logs in the
logsdirectory
github-analyzer/
├── auto_builder.py # Build automation logic
├── config.py # Configuration management
├── constants.py # Project constants
├── decorators.py # Utility decorators
├── dspy_analyzer.py # DSPy analysis implementation
├── exceptions.py # Custom exceptions
├── github_service.py # GitHub API interactions
├── logger.py # Logging setup
├── main.py # Main entry point
└── requirements.txt # Project dependencies
The project includes comprehensive error handling:
- GitHub API errors
- Build process failures
- Configuration issues
- Network connectivity problems
Check the logs directory for detailed error information.
- OpenAI for GPT API
- DSPy for the analysis framework
- GitHub API for repository access