AI Repo Analyzer.
AI Repo Analyzer is a high-performance command-line tool written in Rust that automates architectural discovery for complex, unfamiliar codebases. By synthesizing local Git repository history, recursive syntax tree inspections, language distributions, and security policies with Google Gemini AI models via the Rig framework, the tool translates millions of lines of code into structured technical reports and architectural context.
- Role
- Tools & AI Systems Engineer
- Domain
- Developer tooling · Static analysis · AST & Git intelligence · Automated technical reporting
System at a glance
What the system does
Deep Git commit & contributor forensics
Multi-language code metrics & complexity
Framework & project type detection
Rig-powered automated technical reporting
Architecture flow
From intent to verified state.
- 01
The CLI parses GitHub URLs, validates auth tokens, and queries the GitHub REST API for high-level repository metadata.
- 02
The local Git subsystem clones or updates the repository via git2 to analyze branch topologies and commit histories.
- 03
Specialized analyzer modules parse file trees, count lines of code, classify tech stacks, and audit security configurations.
- 04
The AI integration layer structures extracted metrics into concise prompts passed to Google Gemini via the Rig framework.
- 05
The analyzer formats combined static and AI insights into terminal summaries and exports structured JSON or YAML reports.
01 / Static code analysis
Multi-dimensional code metrics and structure parsing
Extracting ground-truth architectural indicators directly from project file systems.
Recursive filesystem traversal
Leverages walkdir to stream file structures, filtering ignore patterns and analyzing size distributions across large codebases.
Language and metric extraction
Accurately computes lines of code (LOC), file counts, and language percentages across multi-language enterprise repositories.
Project type & stack identification
Inspects package manifests (package.json, Cargo.toml, requirements.txt) to classify project types (CLI, web app, library, backend).
02 / Git forensics
Commit velocity, churn, and contributor dynamics
Deriving development health and maintenance patterns from local commit graphs.
Local git2 engine
Directly traverses commit graphs, merge bases, and diffs to evaluate code churn and development velocity without external tool dependencies.
Contributor collaboration models
Identifies top contributors, commit cadences, and collaboration hotspots over the repository's lifetime.
Release & issue telemetry
Pulls and correlates GitHub releases, tags, open issues, and pull request activity to assess overall project maturity and health.
03 / AI reasoning
Rig agent framework and Gemini model orchestration
Grounding large language model generation in verified codebase metrics.
Rig framework integration
Implements typed agent workflows using Rust's rig-core to orchestrate interactions with Google Gemini generative models.
Grounded architectural synthesis
Injects verified code metrics, configuration facts, and dependency graphs into model prompts to prevent hallucinations.
Automated technical documentation
Generates comprehensive technical overviews covering system architecture, key modules, and technical debt risk factors.
04 / Data export & I/O
Structured data pipeline and CLI ergonomic design
Engineering for scriptability, CI/CD pipelines, and high-volume analysis.
Concurrent asynchronous pipeline
Leverages Tokio for non-blocking GitHub API queries while offloading compute-heavy Git operations to worker threads.
Flexible structured export
Supports both human-readable terminal output and machine-consumable JSON/YAML schemas via Serde for integration into CI/CD pipelines.
Resilient rate-limit handling
Implements exponential backoff and authenticated token support to navigate GitHub REST API rate limits reliably.