AI-powered GitHub repository analyzer with multi-LLM support - Choose from 8 different AI providers!
Analyze any GitHub repository with AI-powered insights. Get language statistics, code summaries, and repository metrics in seconds.
pip install codesonor
codesonor setup # Interactive configuration wizard
codesonor analyze https://github.com/pallets/flask- 🤖 Multi-LLM Support - Choose from Gemini, OpenAI, Claude, Mistral, or Groq
- 🔧 Interactive Setup - One-time configuration wizard saves your preferences
- 📊 Language Analysis - Distribution breakdown across 20+ programming languages
- 🧠 AI Code Summaries - AI-generated insights for key files
- 📈 Repository Stats - Stars, forks, contributors, file counts
- ⚡ Fast Analysis - Smart filtering and caching
- 🎨 Beautiful Output - Rich terminal formatting with tables and colors
- 💾 Export Options - JSON output for integration
| Provider | Free Tier | Speed | Quality | Best For |
|---|---|---|---|---|
| Gemini ⭐ | ✅ Yes | Fast | Good | Beginners |
| OpenAI | ❌ Paid | Medium | Excellent | Production |
| Claude | ❌ Paid | Fast | Excellent | Long code |
| Mistral | ❌ Paid | Fast | Good | Europe |
| Groq ⚡ | ✅ Yes | Ultra-fast | Good | Speed |
| OpenRouter 🌐 | 💳 Pay-per-use | Fast | Excellent | 100+ models |
| xAI Grok | ❌ Paid | Fast | Excellent | Latest tech |
| Ollama 🆓 | ✅ FREE | Medium | Good | Privacy/Local |
⭐ Default provider | ⚡ Fastest inference | 🌐 Access to 100+ models | 🆓 Runs locally, no API key needed
pip install codesonorpip install codesonor[openai] # For OpenAI GPT
pip install codesonor[anthropic] # For Claude
pip install codesonor[mistral] # For Mistral
pip install codesonor[groq] # For Groq
# Note: OpenRouter, xAI, and Ollama use OpenAI-compatible APIs (included by default)
pip install codesonor[all-llm] # All providerscodesonor setupThis wizard will:
- Let you choose your preferred AI provider
- Guide you to get the API key
- Optionally select a specific model
- Save everything to
~/.codesonor/config.json
Edit ~/.codesonor/config.json:
{
"github_token": "ghp_your_token_here",
"llm_provider": "openai",
"llm_api_key": "sk-your-key",
"llm_model": "gpt-4"
}# GitHub token (optional but recommended)
export GITHUB_TOKEN="ghp_your_token"
# LLM provider API keys (choose one or more)
export GEMINI_API_KEY="your_key"
export OPENAI_API_KEY="sk-your_key"
export ANTHROPIC_API_KEY="sk-ant-your_key"
export MISTRAL_API_KEY="your_key"
export GROQ_API_KEY="gsk_your_key"
export OPENROUTER_API_KEY="sk-or-your_key"
export XAI_API_KEY="xai-your_key"
# Ollama runs locally, no API key needed!codesonor analyze https://github.com/torvalds/linux# OpenAI GPT-4
codesonor analyze URL --llm-provider openai --llm-model gpt-4
# Anthropic Claude
codesonor analyze URL --llm-provider anthropic
# Groq (fastest)
codesonor analyze URL --llm-provider groq# Skip AI analysis (stats only, faster)
codesonor analyze URL --no-ai
# Limit files analyzed
codesonor analyze URL --max-files 100
# Export as JSON
codesonor analyze URL --json-output results.json
# Quick summary without AI
codesonor summary https://github.com/django/djangocodesonor configOutput:
📋 CodeSonor Configuration
┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Setting ┃ Status ┃ Source ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ GitHub Token │ ✅ Configured │ config │
│ LLM Provider │ Openai │ config │
│ LLM Model │ │ gpt-4 │
│ LLM API Key │ ✅ Configured │ config │
└───────────────┴───────────────┴────────────┘
╭─────────────────────────────────────────────────╮
│ Repository: flask by pallets │
╰─────────────────────────────────────────────────╯
Stars: ⭐ 70,501 Forks: 🔱 16,551
Primary Language: Python
Total Files: 218
Language Distribution:
┏━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Language ┃ Percentage ┃ Bar ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Python │ 95.80% │ ███████████████████████ │
│ HTML │ 1.74% │ █ │
│ YAML │ 1.15% │ █ │
└───────────┴────────────┴─────────────────────────┘
🤖 AI-Powered Code Analysis
File 1: src/flask/app.py
Flask application core implementation. Defines the Flask class which
serves as the central object for WSGI applications...
- Google Gemini (Free): https://aistudio.google.com/app/apikey
- OpenAI: https://platform.openai.com/api-keys
- Anthropic Claude: https://console.anthropic.com/settings/keys
- Mistral AI: https://console.mistral.ai/api-keys/
- Groq (Free): https://console.groq.com/keys
- OpenRouter: https://openrouter.ai/keys
- xAI Grok: https://console.x.ai
- Ollama: https://ollama.ai/download (FREE, runs locally!)
- GitHub Token: https://github.com/settings/tokens (optional, prevents rate limits)
- Python 3.9+
- Click - CLI framework
- Rich - Terminal formatting
- Requests - HTTP library
- Multiple LLM SDKs - OpenAI, Anthropic, Groq, Mistral, Google Generative AI
- Multi-LLM Guide - Detailed guide on using different AI providers
- CLI Documentation - Complete CLI reference
- Contributing - How to contribute
- Quick Start - Get started in 5 minutes
Contributions are welcome! Please check out our Contributing Guide.
MIT License - see LICENSE file for details.
If you find CodeSonor useful, please consider giving it a star! ⭐
- Issues: GitHub Issues
- PyPI: PyPI Project
- � OpenRouter Support - Access to 100+ AI models with a single API key
- 🤖 xAI Grok - Latest AI from xAI
- 🆓 Ollama Integration - Run AI models locally for FREE (no API key needed!)
- 🧹 Code Quality - Enhanced metadata and package information
- � 8 LLM Providers - More choice than ever before!
See V0.4.1_UPDATE.md for complete details.
Made by Farhan Mir