Insight is a Python-based command-line tool that analyzes codebases and generates detailed reports.
It combines static code analysis with AI-powered explanations using the Gemini API or local models.
-
Analyze 30+ programming, web, and configuration file types.
-
Generate a
report/folder containing:- One detailed
.mdfile per source file - A
summary.mdoverview of the entire codebase
- One detailed
-
Collect static metrics:
- Total lines of code
- Functions, classes, imports
- Number of comments
-
AI-powered insights:
- File explanations in plain language
- Probability score (1–10) for AI/LLM-generated code
Clone the repository:
git clone https://github.com/XplnHUB/Insight-Py.git
cd Insight-PyCreate a virtual environment and install dependencies:
python3 -m venv venv
source venv/bin/activate # Mac/Linux
venv\Scripts\activate # Windows
pip install -r requirements.txt
pip install -e .If using Gemini API, set your API key:
export GEMINI_API_KEY="your_api_key_here" # Mac/Linux
setx GEMINI_API_KEY "your_api_key_here" # WindowsAnalyze the current directory:
insight .Limit the number of files analyzed (for testing):
insight . --limit 5Change the output directory:
insight . -o my_reportsReports are saved in the specified folder, with one Markdown file per source file plus a summary.md..
- Programming:
.py,.js,.ts,.java,.cpp,.c,.cs,.go,.php,.rb,.rs,.swift,.kt,.scala,.dart,.m,.mm,.lua,.pl,.sh,.bat - Web:
.html,.htm,.css,.scss,.less,.ejs,.erb,.mustache - Config:
.json,.yaml,.yml,.toml,.ini,.cfg,.xml - Docs:
.md,.rst - Build/DevOps:
.gradle,.pom,.makefile,.cmake,.dockerfile - Database:
.sql
- Add
.insightignoresupport to skip files/folders - Export reports in HTML and PDF formats
- Support for local AI engines (Ollama, LM Studio)
- Interactive web dashboard for reports
For detailed instructions, see INSTRUCTION.md.
This project is licensed under the MIT License.