Insight — Code Analysis & Exploration CLI
Understand any codebase in minutes.
Insight pairs AST-grounded static code metrics with Google's Gemini AI to generate structured, human-readable architecture reports and file walkthroughs.
Quick Start • Documentation • Features • Supported File Types • Contributing
How It Works
flowchart LR
A["Target Codebase"] --> B["File Discovery & .insightignore"]
B --> C["AST & Static Metrics Engine"]
C --> D["Google Gemini Explainer"]
D --> E["report/ Folder"]
E --> F["Per-file .md Reports"]
E --> G["summary.md Overview"]
- Discovery: Scans your project directory while strictly respecting
.insightignoreand standard exclusions (node_modules,venv,.git). - Static Analysis: Extracts line counts, functions, classes, imports, and comment density.
- AI Explainer: Leverages Google's Gemini API to summarize file responsibilities, core workflows, and architectural roles.
- Structured Reports: Produces a clean Markdown report suite inside a dedicated
report/folder.
Key Features
- Broad Language Support: Detects and processes 35+ file types across systems, backends, frontends, and config files.
- Static Metrics Collection: Accurately tallies total lines, comments, functions, classes, and imported dependencies.
- AI-Powered File Walkthroughs: Explains intricate functions, algorithms, and business logic in plain, accessible language.
- Actionable Markdown Output: Generates clean, navigable
.mdreports ready to commit into documentation centers or wikis. - Lightweight CLI: Zero heavy background daemons or database setup required.
Quick Start
1. Install via pip
Install the published package directly from PyPI:
pip install insight-cli-sarang
2. Set Your API Key
Get a free API key from Google AI Studio and set it in your environment:
# macOS / Linux (Bash or Zsh):
export GOOGLE_API_KEY="your_api_key_here"
# Windows (PowerShell):
$env:GOOGLE_API_KEY="your_api_key_here"
# Windows (Command Prompt):
set GOOGLE_API_KEY=your_api_key_here
(Note: GEMINI_API_KEY is also supported as an alias).
3. Run Analysis
Analyze your current project directory:
insight .
# or
insight-cli .
View the generated reports:
ls report/
cat report/summary.md
CLI Reference & Examples
usage: insight [-h] [--version] [-o OUTPUT] [--limit LIMIT] path
| Argument | Description | Default |
|---|---|---|
path |
Path to the directory or source file to analyze | Required |
-o, --output |
Destination directory for generated markdown reports | report |
--limit |
Limit total number of files analyzed (ideal for testing) | None (all files) |
-v, --version |
Show the installed CLI version | |
-h, --help |
Display help message and options |
Common Examples
# Analyze a specific repository folder
insight /path/to/my-codebase
# Save reports to a custom folder
insight . -o ./docs/codebase_audit
# Test run on only the first 5 source files
insight . --limit 5
Supported File Types
Insight parses and categorizes files across major development domains:
| Domain | Supported Extensions |
|---|---|
| Programming | .py, .js, .ts, .tsx, .jsx, .java, .cpp, .c, .cs, .go, .rb, .php, .rs, .swift, .kt, .scala, .dart, .lua, .pl, .sh, .bat, .r, .m, .mm |
| Web & UI | .html, .htm, .css, .scss, .less, .vue, .svelte, .ejs, .erb, .mustache |
| Config & Data | .json, .yaml, .yml, .toml, .ini, .cfg, .xml, .proto, .graphql, .tf, .sql |
| Notebooks & Docs | .ipynb, .md, .rst |
| Build & DevOps | .gradle, .pom, .makefile, .cmake, .dockerfile |
Output Report Structure
When Insight completes, your output folder is organized as follows:
report/
├── summary.md # Global repository summary and file index
├── cli.py.md # Explanation & metrics for cli.py
├── analyzer.py.md # Explanation & metrics for analyzer.py
└── ...
Sample summary.md:
# Insight Codebase Summary
**Total files analyzed:** 14
**Total lines of code:** 2,480
## Files Included
- [cli.py](cli.py.md) (120 lines)
- [analyzer.py](analyzer.py.md) (245 lines)
Roadmap & Upcoming Features
- Offline / Static-Only Mode: Run without an API key using
--static(#30) - Tree-Sitter Multi-Language AST: Real function, class, and export extraction for JS/TS, Go, Rust, and Java (#32)
- Concurrent Processing: Async multi-threaded file analysis with rate limit backoff (#33)
- Local LLM Support: Offline AI summaries via Ollama and LM Studio (#31)
- Interactive HTML Dashboard: Standalone responsive single-page report (#34)
Documentation
For in-depth guides, visit:
- INSTRUCTION.md: Complete setup, API keys, environment persistence, and troubleshooting FAQs.
- CONTRIBUTING.md: Contributor guidelines, development environment setup, coding standards, and PR workflows.
- CODE_OF_CONDUCT.md: Community participation standards.
Contributing
Contributions are warmly welcomed! Please check out open issues or look for good first issue tags to get started.
git clone https://github.com/ferrix-lab/Insight-Py.git
cd Insight-Py
pip install -e ".[dev]"
pytest
License
This project is licensed under the MIT License — see the LICENSE file for details.
Metadata
Release files for insight-cli-sarang 0.2.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| insight_cli_sarang-0.2.6.tar.gz | 13.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| insight_cli_sarang-0.2.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.9 kB
Release files / insight_cli_sarang-0.2.6.tar.gz
| Download URL | insight_cli_sarang-0.2.6.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4619e5649d124b82d198b17555e803568dbb979b2fcb3cf1de3d478d70f02922
|
|
BLAKE2b-256 checksum How to use checksums |
e5d54549ba201dfbb4e081773c1c07f6dfa2532d478c85b31465412e8d924e8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.
Transparency logRelease files / insight_cli_sarang-0.2.6-py3-none-any.whl
| Download URL | insight_cli_sarang-0.2.6-py3-none-any.whl |
|---|---|
| Size | 11.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f00e0a4705587d038ba0f765be36a50abe4aa0fab9d900a54c39e1579f11a7fe
|
|
BLAKE2b-256 checksum How to use checksums |
19f7b6d3df8cddfbc95582440825f1ea20fab78ffe5b30da994c13ecafdad76c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.
Transparency logSecurity for insight-cli-sarang 0.2.6
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for insight_cli_sarang-0.2.6.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 7, 2026.
Transparency logA 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.