Skip to content

Download github repos (public) and use DeepSeek as a code agent (through API) to explain or add code to your codebase.

Notifications You must be signed in to change notification settings

git-pulkit3010/github-codebase-agent

Repository files navigation

GitHub Codebase Explorer

A CLI tool that helps you explore and understand GitHub repositories using AI-powered code analysis.

Features

  • Clone and analyze GitHub repositories
  • Extract and chunk code files for efficient processing
  • Interactive Q&A interface with AI-powered responses
  • Supports multiple programming languages
  • Colorful terminal output with rich formatting

Supported Languages

  • Python (.py)
  • JavaScript (.js)
  • TypeScript (.ts)
  • Java (.java)
  • Go (.go)
  • C++ (.cpp)
  • C (.c)
  • Ruby (.rb)

Installation

  1. Clone this repository:
    git clone https://github.com/yourusername/github-codebase-agent.git
    cd github-codebase-agent
    
    

2 Install the required dependencies:

pip install -r requirements.txt

3 Create a config.py file (see Configuration section below)

                                   Configuration

Create a config.py file in the root directory with your API credentials:

DEEPSEEK_API_KEY = "your_api_key_here" DEEPSEEK_ENDPOINT = "https://api.deepseek.com/v1/chat/completions"

Important: Never commit this file to version control. Add it to your .gitignore:

config.py

                                       Usage

Run the tool with a GitHub repository URL:

python main.py --repo https://github.com/username/repository.git

Once the repository is cloned and processed, you can ask questions about the codebase in the interactive prompt.

Example questions:

• "Explain the main architecture of this project" • "How does the authentication system work?" • "Show me all the API endpoints"

Type exit or quit to end the session.

                                    Requirements

• Python 3.7+ • Git installed on your system • A DeepSeek API key

                                    Dependencies

• requests - For API communication • rich - For beautiful terminal output • argparse - For command-line argument parsing

Install all dependencies with:

pip install -r requirements.txt

                                 Project Structure

github-codebase-agent/ ├── cli.py # Command-line interface ├── file_reader.py # File reading and chunking logic ├── github_handler.py # Repository cloning ├── main.py # Main entry point ├── summarizer.py # AI interaction logic ├── utils.py # Utility functions and pretty printing └── config.py # API configuration (not included in repo)

                                    Contributing

Contributions are welcome! Please open an issue or pull request for any improvements.

                                      License

MIT License

This README includes:

  1. Clear project description
  2. Installation instructions
  3. Configuration requirements (with security warning)
  4. Usage examples
  5. Project structure overview
  6. Contribution guidelines
  7. License information

You might want to customize:

  • The repository URL in the Installation section
  • The license information if you're using something other than MIT
  • Any additional features or supported languages
  • More specific usage examples relevant to your typical use case

About

Download github repos (public) and use DeepSeek as a code agent (through API) to explain or add code to your codebase.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages