Skip to main content

Insight is a Python-based CLI tool that analyzes codebases and generates detailed reports.

Project description

Insight

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

Features

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

  • Generate a report/ folder with:

    • One detailed .md file per source file.
    • A summary.md overview of the entire codebase.
  • Collect static metrics:

    • Total lines
    • 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/ExplainHub/Insight-Py.git
cd insight

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 (useful for testing):

insight . --limit 5

Change output directory:

insight . -o my_reports

Reports will be saved in the specified folder, 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 specific 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 setup and usage instructions, please see the INSTRUCTION.md file.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

insight_cli_sarang-0.2.5.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

insight_cli_sarang-0.2.5-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file insight_cli_sarang-0.2.5.tar.gz.

File metadata

  • Download URL: insight_cli_sarang-0.2.5.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for insight_cli_sarang-0.2.5.tar.gz
Algorithm Hash digest
SHA256 3755d509d090d56306ac918ce3431a081dbcf123f137265004f7bd1f833a05dc
MD5 c130d53ef073240ccc8f77419e1730d0
BLAKE2b-256 0c51270a945438fa82456293b1639b68c6758624ecf48c0c076ca2a7b27a8c3d

See more details on using hashes here.

File details

Details for the file insight_cli_sarang-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for insight_cli_sarang-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d1a78578f6d705ea301607e72abee9d77431fc1b286af8139a5a7d7071c31844
MD5 89d5d0793498bec01d3705694c2c382d
BLAKE2b-256 0f66d40bae58ff6bcb07f8fee8b6fe871a00aedcd7489d9d00b6d9907e4af1fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page