AI-Powered GitHub Repository Analyzer - Analyze any GitHub repository with AI-generated insights
Project description
CodeSonor ๐
AI-Powered GitHub Repository Analyzer - Analyze any GitHub repository with AI-generated insights, language statistics, and comprehensive code summaries.
๐ Installation
pip install codesonor
๐ Prerequisites
You'll need two API keys:
-
Google Gemini API Key (Required)
- Get it free at Google AI Studio
-
GitHub Personal Access Token (Required)
- Create at GitHub Settings โ Developer Settings โ Personal Access Tokens
- Needs
public_reposcope
โ๏ธ Configuration
Set your API keys as environment variables:
Windows (PowerShell)
$env:GEMINI_API_KEY = "your_gemini_api_key_here"
$env:GITHUB_TOKEN = "your_github_token_here"
Linux/MacOS
export GEMINI_API_KEY="your_gemini_api_key_here"
export GITHUB_TOKEN="your_github_token_here"
Or create a .env file in your working directory:
GEMINI_API_KEY=your_gemini_api_key_here
GITHUB_TOKEN=your_github_token_here
๐ Usage
Full Analysis with AI
codesonor analyze https://github.com/owner/repo
Quick Summary (No AI)
codesonor summary https://github.com/owner/repo
Advanced Options
# Skip AI analysis (faster)
codesonor analyze https://github.com/owner/repo --no-ai
# Limit number of files analyzed
codesonor analyze https://github.com/owner/repo --max-files 200
# Export results as JSON
codesonor analyze https://github.com/owner/repo --json-output results.json
๐ Example Output
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ CodeSonor Analysis: awesome-project โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Repository Information
โโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Field โ Value โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ Owner โ awesome-owner โ
โ Repository โ awesome-project โ
โ Stars โ 1,234 โ
โ Forks โ 567 โ
โ Language โ Python โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Language Distribution
โโโโโโโโโโโโโโณโโโโโโโโโโโณโโโโโโโโโ
โ Language โ Files โ % โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ Python โ 45 โ 78.5% โ
โ JavaScript โ 8 โ 14.0% โ
โ CSS โ 4 โ 7.0% โ
โ HTML โ 1 โ 0.5% โ
โโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโ
๐ค AI-Generated Summary
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
This repository implements a modern web application
framework with clean architecture and comprehensive
testing. Key features include...
๐ฏ Features
- ๐ค AI Analysis: Get intelligent insights about repository purpose, architecture, and key features
- ๐ Language Stats: Detailed breakdown of programming languages used
- ๐ Smart Filtering: Automatically skips common directories (node_modules, dist, build)
- โก Performance: File limits and optimizations for fast analysis
- ๐จ Beautiful Output: Rich terminal formatting with colors and tables
- ๐พ Export Options: Save results as JSON for further processing
๐ ๏ธ Development
Install with development dependencies:
pip install codesonor[dev]
Run tests:
pytest
๐ฆ Web App Version
CodeSonor also comes with a Flask web application. To use it:
# Install with web dependencies
pip install codesonor[web]
# Clone the repository for web app files
git clone https://github.com/farhanmir/CodeSonor.git
cd CodeSonor
# Run the web server
python app.py
Visit http://localhost:5000 in your browser.
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ค Author
Farhan Mir
- GitHub: @farhanmir
๐ Acknowledgments
- Powered by Google Gemini AI
- Built with Python, Click, and Rich
- GitHub REST API v3
Note: This tool analyzes public repositories. Ensure you have appropriate permissions before analyzing private repositories.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codesonor-0.1.0.tar.gz.
File metadata
- Download URL: codesonor-0.1.0.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24dedd51c6cce72a5aeaa57388bb970d9c8f282fabcfe21ef85077bebddf4d3b
|
|
| MD5 |
f13d286315f726174ecc355676f7a9c5
|
|
| BLAKE2b-256 |
a19fc0cddef68a9e1a26b15fc81da658f6649ae895a849759badd43805af7f03
|
File details
Details for the file codesonor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: codesonor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71e9fb52e38e3c60f9b42cdddd62841330bb75c6a3a9d9fbad76553c8ad6fccc
|
|
| MD5 |
5c88efc145d9702e5717a35d4c1d6c06
|
|
| BLAKE2b-256 |
70cfac00434dabb1207d1834c99b1480ae50641e6e117a71a1ed18a4a6d26b19
|