Skip to content

PankajKumardev/GitGenius

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitGenius

AI-powered Git history analysis tool - Zero configuration needed!

npm version License: MIT

GitGenius transforms your Git repository into an intelligent knowledge base using AI. Analyze commit history, search semantically, generate changelogs, and create comprehensive reports with AI-powered insights.

No database setup required - uses local SQLite
Simple setup - just enter your Gemini API key when prompted

✨ What's New in v1.1.0

  • πŸ“ Changelog Generator - Auto-generate release notes with AI categorization
  • πŸ” Filter Commits - Browse by author, date range (7/30/90 days or custom)
  • πŸš€ Incremental Analysis - Only analyzes new commits, skips already processed
  • πŸ“Š Progress Tracking - Real-time progress updates during analysis
  • πŸ€– AI-powered Search - Ask any question in natural language
  • 🎨 Improved HTML Export - Beautiful reports with better styling

Features

  • AI-Powered Analysis - Automatically categorize and summarize commits using Google Gemini
  • Semantic Search - Ask questions in natural language, get AI-powered answers with relevant commits
  • Changelog Generation - Auto-generate professional release notes grouped by category
  • Interactive Filtering - Browse commits by author, date range, or view all
  • Beautiful Reports - Export detailed analysis in JSON, Markdown, CSV, or HTML
  • Interactive CLI - User-friendly menu-driven interface with arrow key navigation
  • Repository Statistics - Comprehensive metrics and insights about your codebase
  • Incremental Processing - Only analyze new commits, skip already processed ones
  • Fast & Efficient - Parallel processing with intelligent caching

πŸ› οΈ Tech Stack

GitGenius is built with modern technologies for optimal performance and developer experience:

Category Technologies
Language TypeScript
AI/LLM Google Gemini 2.5 Flash, LangChain.js
Database SQLite + Prisma ORM
CLI Framework oclif
Git Operations simple-git
UI/UX Inquirer.js, chalk, ora, gradient-string
Validation Zod

Installation

npm install -g gitgenius

Prerequisites

Quick Start

1. Run GitGenius

cd your-git-repo
gitgenius

On first run, you'll be prompted to enter your Gemini API key. It will be saved securely for future use.

2. Initialize your repository

Select Setup from the menu to analyze your Git repository.

3. Analyze commits

Select Analyze to process commits with AI and generate insights.

4. Search and explore

Use Search to ask questions about your codebase in natural language.

5. Generate changelog

Select Changelog to auto-generate release notes with AI categorization.

6. Filter commits

Use Filter to browse commits by author or date range.

7. Export reports

Select Export to generate detailed reports in your preferred format.

🎯 Usage

Interactive CLI

Simply run gitgenius in any Git repository:

gitgenius

Navigate using arrow keys through the menu:

  • Setup - Initialize this Git repository
  • Analyze - Process commits with AI (only new commits)
  • Search - Ask AI about your commits (natural language)
  • Changelog - Generate release notes ✨ NEW
  • Filter - Browse commits by author/date ✨ NEW
  • Stats - View repository statistics
  • Export - Generate detailed report
  • Help - Documentation and guides
  • Exit - Quit GitGenius

Command-Line Interface (Alternative)

# Initialize repository
gitgenius init

# Analyze commits
gitgenius analyze

# Search for specific changes
gitgenius search "authentication implementation"

πŸ” AI-Powered Search

Ask questions in natural language and get intelligent answers:

? Ask anything about your commits: Which commit has the most code changes?

━━━ AI Answer ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The commit with hash a0f104b has the most code changes with +15,234 additions
and -2,341 deletions. This was the initial project setup commit that established
the core architecture...

━━━ Related Commits ━━━━━━━━━━━━━━━━━━━━━━━━━

1. a0f104b
   "feat: Initialize GitWise project with core functionalities"
   Author: pankaj kumar | Date: 2025-11-21
   Changes: +15234 -2341

πŸ“ Changelog Generation

Automatically generate professional release notes:

━━━ Changelog Generator ━━━━━━━━━━━━━━━━━━━━

? Version name (e.g., v1.0.0): v1.1.0

# Changelog

## v1.1.0

### ✨ Features
- Changelog generator with AI categorization (`abc1234`) - Author
- Filter commits by author and date (`def5678`) - Author

### πŸ› Bug Fixes
- Fixed HTML export visibility (`ghi9012`) - Author

### ♻️ Refactoring
- Improved CLI structure (`jkl3456`) - Author

? Save changelog to file? Yes
βœ… Saved to CHANGELOG-v1.1.0.md

πŸ“Š Export Formats

GitGenius supports multiple export formats:

JSON

Machine-readable format with complete metadata and statistics.

Markdown

Professional documentation with executive summary, metrics tables, and AI insights.

CSV

Spreadsheet-compatible format for commit data analysis.

HTML

Beautiful web report with interactive styling and comprehensive details.

🎯 Key Features

  • Zero Configuration - No database setup required, uses local SQLite
  • Simple API Key Setup - Enter once, saved securely
  • AI-Powered Analysis - Automatic commit categorization with Google Gemini
  • Natural Language Search - Ask questions, get AI answers with commit references
  • Changelog Generation - Auto-generate release notes grouped by category
  • Interactive Filtering - Browse commits by author, date, or view all
  • Incremental Processing - Only new commits are analyzed
  • Multiple Export Formats - JSON, Markdown, CSV, HTML
  • Beautiful CLI - Interactive menu with arrow key navigation
  • Comprehensive Reports - Detailed analysis with statistics and insights

πŸ—„οΈ Data Storage

GitGenius stores all data locally in a SQLite database (gitgenius.db in your project directory). No external database required!

πŸ”‘ Getting Your Gemini API Key

  1. Visit Google AI Studio
  2. Create a new API key (it's free!)
  3. Run gitgenius and enter the key when prompted

That's it! Your key will be saved securely for future use.

πŸ“– How It Works

  1. Initialization: GitGenius scans your Git repository and stores commit history in local SQLite
  2. Chunking: Commits are grouped into manageable chunks for efficient processing
  3. AI Analysis: Google Gemini analyzes each chunk, extracting insights and categories
  4. Incremental Updates: On subsequent runs, only new commits are analyzed
  5. Search: AI-powered semantic search finds relevant commits and generates answers
  6. Changelog: AI categorizes commits and generates professional release notes

Under the Hood

LangChain Integration

GitGenius uses LangChain.js for LLM orchestration:

  • Prompt Templates - Structured prompts for consistent AI responses
  • Output Parsers - JSON parsing with schema validation
  • LLM Chains - Composable chains for analysis and search workflows
// Example: How GitGenius uses LangChain
import { ChatGoogleGenerativeAI } from '@langchain/google-genai';
import { PromptTemplate } from '@langchain/core/prompts';
import { JsonOutputParser } from '@langchain/core/output_parsers';

const prompt = PromptTemplate.fromTemplate(analysisTemplate);
const chain = prompt.pipe(llm).pipe(new JsonOutputParser());
const result = await chain.invoke({ chunk_text: commitData });

Embedding Support

Built-in support for text embeddings using Google's text-embedding-004 model for future semantic search enhancements.

βš™οΈ Configuration

No configuration files needed! GitGenius works out of the box.

Optional: You can set these environment variables to customize behavior:

  • GEMINI_MODEL - AI model to use (default: gemini-2.5-flash)
  • CHUNK_SIZE - Commits per analysis chunk (default: 50)
  • MAX_CONCURRENT_JOBS - Parallel processing limit (default: 5)

🀝 Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

πŸ“„ License

MIT Β© Pankaj Kumar

πŸ”— Links

πŸ™ Acknowledgments

Built with:


Made with ❀️ by Pankaj Kumar

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published