Skip to main content

CodeSonor CLI 🔍

AI-Powered GitHub Repository Analyzer with Multi-LLM Support

Python Version License: MIT

Analyze any GitHub repository with AI-powered insights. Choose from 8 different AI providers!

🚀 Installation

Basic (includes Gemini)

pip install codesonor

With Specific Provider

pip install codesonor[openai]      # OpenAI GPT
pip install codesonor[anthropic]   # Anthropic Claude
pip install codesonor[mistral]     # Mistral AI
pip install codesonor[groq]        # Groq (fastest)
pip install codesonor[all-llm]     # All providers

🤖 Supported AI Providers

Provider Free Tier Speed Get API Key
Gemini ⭐ ✅ Yes Fast Get Key
OpenAI ❌ Paid Medium Get Key
Claude ❌ Paid Fast Get Key
Mistral ❌ Paid Fast Get Key
Groq ⚡ ✅ Yes Ultra-fast Get Key
OpenRouter 🌐 💳 Pay-per-use Fast Get Key
xAI Grok ❌ Paid Fast Get Key
Ollama 🆓 ✅ FREE Medium Download

⭐ Default | ⚡ Fastest | 🌐 100+ models | 🆓 Local & FREE

⚙️ Configuration

codesonor setup

This interactive wizard will:

  • ✅ Let you choose your AI provider
  • ✅ Guide you to get the API key
  • ✅ Save everything to ~/.codesonor/config.json
  • ✅ Never ask again!

Check Your Configuration

codesonor config

Alternative Methods

Environment Variables (if you prefer):

# Windows (PowerShell)
$env:GEMINI_API_KEY = "your_key"
$env:GITHUB_TOKEN = "your_token"

# Linux/Mac
export GEMINI_API_KEY="your_key"
export GITHUB_TOKEN="your_token"

Per-Command (override saved config):

codesonor analyze URL --gemini-key YOUR_KEY --github-token YOUR_TOKEN

📖 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

🙏 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.

Metadata

Release files for codesonor 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for codesonor 0.5.0
File Size Uploaded Provenance Actions
codesonor-0.5.0.tar.gz 83.6 kB Without provenance Details for codesonor-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for codesonor 0.5.0
File Interpreter ABI Platform Actions
codesonor-0.5.0-py3-none-any.whl Python 3 none any Details for codesonor-0.5.0-py3-none-any.whl

Total release size: 169.0 kB

Release files / codesonor-0.5.0.tar.gz

Download URL codesonor-0.5.0.tar.gz
Size 83.6 kB
Tags Source
SHA-256 checksum
How to use checksums
72234926e187089639b53a9d1bbe2ddb1ad0194ab0f19438ff33e00f30b8726e
BLAKE2b-256 checksum
How to use checksums
2aee8aa7c5ad7cbedcc57a2093d440e7f01f93a2f2f76505bb49c7dbbf4ddfe0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / codesonor-0.5.0-py3-none-any.whl

Download URL codesonor-0.5.0-py3-none-any.whl
Size 85.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fd1af9a1d79bde6c766d1f757059b7e952103863ea842edc35754d35db53244
BLAKE2b-256 checksum
How to use checksums
7c2e247177195f1f8c5304285ffd4d34a400b2fa6de98a8d51076cf4fb2ce977
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Security for codesonor 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page