# CodeSonor ๐
**AI-Powered GitHub Repository Analyzer** - Analyze any GitHub repository with AI-generated insights, language statistics, and comprehensive code summaries.
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
## ๐ Installation
```bash
pip install codesonor
```
## ๐ Prerequisites
### API Keys
1. **Google Gemini API Key** (Required for AI analysis)
- Get it FREE at [Google AI Studio](https://aistudio.google.com/app/apikey)
- Click "Create API key"
2. **GitHub Personal Access Token** (Optional, but recommended to avoid rate limits)
- Create at [GitHub Settings โ Tokens](https://github.com/settings/tokens)
- Click "Generate new token (classic)"
- Select scope: `public_repo`
## โ๏ธ Configuration
### One-Time Setup (Recommended)
```bash
codesonor setup
```
This interactive wizard will:
- โ
Save your API keys securely in `~/.codesonor/config.json`
- โ
Work across all your projects
- โ
Never ask for keys again!
### Check Your Configuration
```bash
codesonor config
```
### Alternative Methods
**Environment Variables** (if you prefer):
```bash
# 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):
```bash
codesonor analyze URL --gemini-key YOUR_KEY --github-token YOUR_TOKEN
```
## ๐ Usage
### Full Analysis with AI
```bash
codesonor analyze https://github.com/owner/repo
```
### Quick Summary (No AI)
```bash
codesonor summary https://github.com/owner/repo
```
### Advanced Options
```bash
# 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:
```bash
pip install codesonor[dev]
```
Run tests:
```bash
pytest
```
## ๐ฆ Web App Version
CodeSonor also comes with a Flask web application. To use it:
```bash
# 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](https://github.com/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.
Raw data
{
"_id": null,
"home_page": null,
"name": "codesonor",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "github, repository, analyzer, ai, code-analysis, gemini, cli",
"author": null,
"author_email": "Farhan Mir <your.email@example.com>",
"download_url": "https://files.pythonhosted.org/packages/31/4c/08b64512cd212cc46e4cd323a52e2114a29ec4d3b576b8940528bbc8f135/codesonor-0.2.0.tar.gz",
"platform": null,
"description": "# CodeSonor \ud83d\udd0d\r\n\r\n**AI-Powered GitHub Repository Analyzer** - Analyze any GitHub repository with AI-generated insights, language statistics, and comprehensive code summaries.\r\n\r\n[](https://www.python.org/downloads/)\r\n[](https://opensource.org/licenses/MIT)\r\n\r\n## \ud83d\ude80 Installation\r\n\r\n```bash\r\npip install codesonor\r\n```\r\n\r\n## \ud83d\udccb Prerequisites\r\n\r\n### API Keys\r\n\r\n1. **Google Gemini API Key** (Required for AI analysis)\r\n - Get it FREE at [Google AI Studio](https://aistudio.google.com/app/apikey)\r\n - Click \"Create API key\"\r\n \r\n2. **GitHub Personal Access Token** (Optional, but recommended to avoid rate limits)\r\n - Create at [GitHub Settings \u2192 Tokens](https://github.com/settings/tokens)\r\n - Click \"Generate new token (classic)\"\r\n - Select scope: `public_repo`\r\n\r\n## \u2699\ufe0f Configuration\r\n\r\n### One-Time Setup (Recommended)\r\n```bash\r\ncodesonor setup\r\n```\r\nThis interactive wizard will:\r\n- \u2705 Save your API keys securely in `~/.codesonor/config.json`\r\n- \u2705 Work across all your projects\r\n- \u2705 Never ask for keys again!\r\n\r\n### Check Your Configuration\r\n```bash\r\ncodesonor config\r\n```\r\n\r\n### Alternative Methods\r\n\r\n**Environment Variables** (if you prefer):\r\n```bash\r\n# Windows (PowerShell)\r\n$env:GEMINI_API_KEY = \"your_key\"\r\n$env:GITHUB_TOKEN = \"your_token\"\r\n\r\n# Linux/Mac\r\nexport GEMINI_API_KEY=\"your_key\"\r\nexport GITHUB_TOKEN=\"your_token\"\r\n```\r\n\r\n**Per-Command** (override saved config):\r\n```bash\r\ncodesonor analyze URL --gemini-key YOUR_KEY --github-token YOUR_TOKEN\r\n```\r\n\r\n## \ud83d\udcd6 Usage\r\n\r\n### Full Analysis with AI\r\n```bash\r\ncodesonor analyze https://github.com/owner/repo\r\n```\r\n\r\n### Quick Summary (No AI)\r\n```bash\r\ncodesonor summary https://github.com/owner/repo\r\n```\r\n\r\n### Advanced Options\r\n```bash\r\n# Skip AI analysis (faster)\r\ncodesonor analyze https://github.com/owner/repo --no-ai\r\n\r\n# Limit number of files analyzed\r\ncodesonor analyze https://github.com/owner/repo --max-files 200\r\n\r\n# Export results as JSON\r\ncodesonor analyze https://github.com/owner/repo --json-output results.json\r\n```\r\n\r\n## \ud83d\udcca Example Output\r\n\r\n```\r\n\u256d\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256e\r\n\u2502 CodeSonor Analysis: awesome-project \u2502\r\n\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256f\r\n\r\nRepository Information\r\n\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\r\n\u2503 Field \u2503 Value \u2503\r\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\r\n\u2502 Owner \u2502 awesome-owner \u2502\r\n\u2502 Repository \u2502 awesome-project \u2502\r\n\u2502 Stars \u2502 1,234 \u2502\r\n\u2502 Forks \u2502 567 \u2502\r\n\u2502 Language \u2502 Python \u2502\r\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\r\n\r\nLanguage Distribution\r\n\u250f\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2533\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2513\r\n\u2503 Language \u2503 Files \u2503 % \u2503\r\n\u2521\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2547\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2529\r\n\u2502 Python \u2502 45 \u2502 78.5% \u2502\r\n\u2502 JavaScript \u2502 8 \u2502 14.0% \u2502\r\n\u2502 CSS \u2502 4 \u2502 7.0% \u2502\r\n\u2502 HTML \u2502 1 \u2502 0.5% \u2502\r\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\r\n\r\n\ud83e\udd16 AI-Generated Summary\r\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\r\nThis repository implements a modern web application\r\nframework with clean architecture and comprehensive\r\ntesting. Key features include...\r\n```\r\n\r\n## \ud83c\udfaf Features\r\n\r\n- **\ud83e\udd16 AI Analysis**: Get intelligent insights about repository purpose, architecture, and key features\r\n- **\ud83d\udcca Language Stats**: Detailed breakdown of programming languages used\r\n- **\ud83d\udcc1 Smart Filtering**: Automatically skips common directories (node_modules, dist, build)\r\n- **\u26a1 Performance**: File limits and optimizations for fast analysis\r\n- **\ud83c\udfa8 Beautiful Output**: Rich terminal formatting with colors and tables\r\n- **\ud83d\udcbe Export Options**: Save results as JSON for further processing\r\n\r\n## \ud83d\udee0\ufe0f Development\r\n\r\nInstall with development dependencies:\r\n```bash\r\npip install codesonor[dev]\r\n```\r\n\r\nRun tests:\r\n```bash\r\npytest\r\n```\r\n\r\n## \ud83d\udce6 Web App Version\r\n\r\nCodeSonor also comes with a Flask web application. To use it:\r\n\r\n```bash\r\n# Install with web dependencies\r\npip install codesonor[web]\r\n\r\n# Clone the repository for web app files\r\ngit clone https://github.com/farhanmir/CodeSonor.git\r\ncd CodeSonor\r\n\r\n# Run the web server\r\npython app.py\r\n```\r\n\r\nVisit `http://localhost:5000` in your browser.\r\n\r\n## \ud83e\udd1d Contributing\r\n\r\nContributions are welcome! Please feel free to submit a Pull Request.\r\n\r\n## \ud83d\udcc4 License\r\n\r\nThis project is licensed under the MIT License - see the LICENSE file for details.\r\n\r\n## \ud83d\udc64 Author\r\n\r\n**Farhan Mir**\r\n\r\n- GitHub: [@farhanmir](https://github.com/farhanmir)\r\n\r\n## \ud83d\ude4f Acknowledgments\r\n\r\n- Powered by Google Gemini AI\r\n- Built with Python, Click, and Rich\r\n- GitHub REST API v3\r\n\r\n---\r\n\r\n**Note**: This tool analyzes public repositories. Ensure you have appropriate permissions before analyzing private repositories.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "AI-Powered GitHub Repository Analyzer - Analyze any GitHub repository with AI-generated insights",
"version": "0.2.0",
"project_urls": {
"Bug Tracker": "https://github.com/farhanmir/CodeSonor/issues",
"Homepage": "https://github.com/farhanmir/CodeSonor",
"Repository": "https://github.com/farhanmir/CodeSonor"
},
"split_keywords": [
"github",
" repository",
" analyzer",
" ai",
" code-analysis",
" gemini",
" cli"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "93e1d19446197d5da0ce1fcc7e2813faf17ae6bd785d41658815aa1e6f058a13",
"md5": "b1fdfe086fad243b3c3ae60b8e563005",
"sha256": "f9516fdd84d98cc61b5a80b5555b6402a6f842c65df5a90b166af2eff7d3187e"
},
"downloads": -1,
"filename": "codesonor-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b1fdfe086fad243b3c3ae60b8e563005",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 15719,
"upload_time": "2025-10-07T01:06:50",
"upload_time_iso_8601": "2025-10-07T01:06:50.153657Z",
"url": "https://files.pythonhosted.org/packages/93/e1/d19446197d5da0ce1fcc7e2813faf17ae6bd785d41658815aa1e6f058a13/codesonor-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "314c08b64512cd212cc46e4cd323a52e2114a29ec4d3b576b8940528bbc8f135",
"md5": "9d4ac4b99f0a5d615a4f344689c05661",
"sha256": "66fef6cad5eaf21554cbd079903b8f19169a141867dac5684e12692e33e5a2fa"
},
"downloads": -1,
"filename": "codesonor-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "9d4ac4b99f0a5d615a4f344689c05661",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 19776,
"upload_time": "2025-10-07T01:06:51",
"upload_time_iso_8601": "2025-10-07T01:06:51.365009Z",
"url": "https://files.pythonhosted.org/packages/31/4c/08b64512cd212cc46e4cd323a52e2114a29ec4d3b576b8940528bbc8f135/codesonor-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-07 01:06:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "farhanmir",
"github_project": "CodeSonor",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "Flask",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "Flask-CORS",
"specs": [
[
"==",
"4.0.0"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.31.0"
]
]
},
{
"name": "google-generativeai",
"specs": [
[
"==",
"0.3.2"
]
]
},
{
"name": "python-dotenv",
"specs": [
[
"==",
"1.0.0"
]
]
}
],
"lcname": "codesonor"
}