demo.mp4
GeminiRepoChat is a powerful tool that allows users to interact with GitHub repositories using a chat interface powered by Google's Gemini AI. This application enables developers, code reviewers, and curious minds to explore repository contents, analyze code, and ask questions about specific files, all within an intuitive Streamlit-based interface.
- Repository Exploration: Fetch and browse contents of any public GitHub repository.
- File Selection: Choose specific files from the repository to analyze or ask questions about.
- AI-Powered Chat: Interact with the Gemini AI model to ask questions about selected files.
- Code Analysis: Get instant insights into code metrics, complexity, and potential code smells.
- Syntax Highlighting: View code with proper syntax highlighting for better readability.
- Caching: Efficient caching of repository contents to reduce API calls and improve performance.
Before you begin, ensure you have met the following requirements:
- Python 3.7+
- A GitHub account (for generating a personal access token)
- A Google Cloud account (for accessing the Gemini AI API)
-
Clone the repository:
git clone https://github.com/yourusername/GeminiRepoChat.git cd GeminiRepoChat
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Create a
.env
file in the project root directory with the following contents:GITHUB_TOKEN=your_github_personal_access_token GOOGLE_API_KEY=your_google_api_key
-
Replace
your_github_personal_access_token
with a GitHub personal access token. You can generate one here. -
Replace
your_google_api_key
with your Google API key for accessing the Gemini AI model. You can obtain one from the Google Cloud Console.
-
Start the Streamlit app:
streamlit run app.py
-
Open your web browser and navigate to the URL provided by Streamlit (usually
http://localhost:8501
). -
Enter a GitHub repository URL in the sidebar.
-
Click "Fetch Repository" to load the repository contents.
-
Select a file from the dropdown menu to analyze or ask questions about.
-
Use the chat interface to ask questions about the selected file or the repository in general.