Inspectre is a modular and extensible repository analysis tool built in Go. It provides comprehensive insights into software projects through intelligent, multi-dimensional code analysis.
- π Multi-language repository analysis
- π§© Extensible plugin system
- π Comprehensive metrics generation
- π€ AI-powered code insights
- π’ Supports GitHub, GitLab, and Bitbucket
- π» CLI and extension-based analysis
# Clone the repository
git clone https://github.com/thushan/inspectre.git
cd inspectre
# Build the executable
go build -o inspectre main.go
# Make plugins executable
chmod +x plugins/*.sh plugins/*.py# Analyse a configured repository
./inspectre run repo1
# Analyse any Git repository by URL
./inspectre run https://github.com/username/repo.git
# Generate detailed insights
./inspectre insights repo1Inspectre uses configuration files stored in the configs directory:
{
"repositories": [
{
"name": "my-project",
"url": "https://github.com/user/repo1.git",
"type": "github",
"auth": {
"token": "${GITHUB_TOKEN}"
}
}
]
}{
"extensions": [
{
"name": "file_counter",
"type": "cli",
"path": "plugins/file-counter.sh",
"description": "Counts files by type",
"enabled": true,
"config": {
"exclude_dirs": ".git,node_modules,vendor"
}
}
]
}Here are some basic commands and operations, for indepth documentation, see usage.
# Run repository analyser
inspectre run <repo-url>
# Generate insights
inspectre insights <repo-url>
# List tasks
inspectre ps
# View task logs
inspectre logs <task-id># List plugins
inspectre plugin list
# Enable a plugin
inspectre plugin enable <plugin-name>
# Disable a plugin
inspectre plugin disable <plugin-name>Inspectre supports three extension types:
-
CLI Tools: Simple executable scripts
- Lightweight analysis
- Easy to create
- Minimal dependencies
-
Python Scripts: Complex analysis with library support
- Full Python ecosystem
- Rich metric generation
- Advanced processing capabilities
-
Go Plugins: Native performance plugins
- Compile-time type safety
- Direct Go interface
- Zero-overhead abstractions
Example Python extension:
#!/usr/bin/env python3
import os
import sys
import json
from datetime import datetime
repo_path = sys.argv[1]
metrics = [{
"name": "file_count",
"value": len(os.listdir(repo_path)),
"timestamp": datetime.utcnow().isoformat() + "Z"
}]
print(json.dumps(metrics))Inspectre uses a sophisticated, event-driven architecture:
- Dynamic worker pool
- Concurrent analysis
- Extensible plugin framework
- Advanced error handling
For a more detailed overview, see Technical Overview
- Adaptive worker pool
- Concurrent analysis
- Intelligent resource management
- Configurable parallelism
- Enhanced LLM integration
- More analysis techniques
- Advanced security scanning
- Distributed analysis support
- Machine learning insights
Contributions are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For issues and feature requests, please use GitHub Issues.
MIT License
Developed by Thushan Fernando and contributors.