An intelligent chatbot that scrapes GitHub repositories and answers questions about their content using AI. Simply provide a GitHub repository URL, and the bot will analyze the codebase, documentation, and repository structure to answer your questions.
- 🔍 Repository Scraping: Automatically scrapes GitHub repositories including README files, code structure, and metadata
- 🤖 AI-Powered Responses: Uses OpenAI's GPT-4o-mini to provide intelligent answers about the repository
- 💬 Interactive Chat: Real-time question and answer interface
- 📊 Comprehensive Analysis: Analyzes file structure, documentation, issues, pull requests, and more
- Node.js (v16 or higher)
- npm or yarn
- OpenAI API key
- Hyperbrowser API key
- Clone this repository:
git clone <your-repo-url>
cd github-chatbot- Install dependencies:
npm install- Set up environment variables:
Create a
.envfile in the root directory:
HYPERBROWSER_API_KEY=your_hyperbrowser_api_key
OPENAI_API_KEY=your_openai_api_keyGet your Hyperbrowser API key at hyperbrowser.ai
- Visit OpenAI's platform
- Sign up or log in to your account
- Navigate to API Keys section
- Create a new API key
- Compile the TypeScript code:
npx tsc- Run the chatbot:
node github-chatbot.js- Follow the prompts:
- Enter a GitHub repository URL when prompted
- Wait for the repository to be scraped and analyzed
- Start asking questions about the repository!
🔗 Enter GitHub repository URL: https://github.com/microsoft/vscode
🔎 Scraping GitHub repository: https://github.com/microsoft/vscode
🤖 Ready to chat about this repository!
💬 Ask a question (or type 'exit' to quit): What is this repository about?
🤖 This is the Visual Studio Code repository, a free and open-source code editor developed by Microsoft...
💬 Ask a question (or type 'exit' to quit): What programming languages are used?
🤖 The repository primarily uses TypeScript (78.2%), JavaScript (12.1%), CSS (4.8%)...
The chatbot can answer questions about:
- Repository purpose and description
- Programming languages used
- File structure and organization
- Recent commits and changes
- Issues and pull requests
- Documentation content
- Installation and setup instructions
- Code functionality and features
- Web Scraping: Uses Hyperbrowser SDK for intelligent GitHub scraping
- AI Processing: Leverages OpenAI's GPT-4o-mini for natural language processing
- Data Extraction: Focuses on markdown content, file structures, and repository metadata
- Interactive Interface: Built with readline-sync for seamless command-line interaction
- Requires valid API keys for both Hyperbrowser and OpenAI
- Scraping large repositories may take some time
- Responses are based on publicly available repository information
- Rate limits may apply based on your API plan
Scraping failed error:
- Ensure the GitHub URL is valid and publicly accessible
- Check your Hyperbrowser API key is correct
OpenAI errors:
- Verify your OpenAI API key is valid
- Ensure you have sufficient API credits
TypeScript compilation errors:
- Run
npm installto ensure all dependencies are installed - Check that you're using Node.js v16 or higher
Feel free to submit issues, feature requests, or pull requests to improve this chatbot!
This project is licensed under the ISC License.