Skip to content

Insight is a Python-based CLI tool that analyzes codebases and generates detailed reports. It provides both static analysis and AI-powered explanations (via Gemini API or local models).

License

Notifications You must be signed in to change notification settings

XplnHUB/Insight-Py

Insight — Code Analysis CLI

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.

Download Stats

PyPI Downloads PyPI Downloads PyPI Downloads

Features

  • Analyze 30+ programming, web, and configuration file types.

  • Generate a report/ folder containing:

    • One detailed .md file per source file
    • A summary.md overview of the entire codebase
  • 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

Installation

Clone the repository:

git clone https://github.com/XplnHUB/Insight-Py.git
cd Insight-Py

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

Setup

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"     # Windows

Usage

Analyze the current directory:

insight .

Limit the number of files analyzed (for testing):

insight . --limit 5

Change the output directory:

insight . -o my_reports

Reports are saved in the specified folder, with one Markdown file per source file plus a summary.md..

Supported File Types

  • 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

Roadmap

  • Add .insightignore support to skip files/folders
  • Export reports in HTML and PDF formats
  • Support for local AI engines (Ollama, LM Studio)
  • Interactive web dashboard for reports

📖 Full Documentation

For detailed instructions, see INSTRUCTION.md.

License

This project is licensed under the MIT License.

About

Insight is a Python-based CLI tool that analyzes codebases and generates detailed reports. It provides both static analysis and AI-powered explanations (via Gemini API or local models).

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 6

Languages