A collection of custom git commands that extend Git's functionality with AI-powered tools and automation.
-
Clone the repository:
git clone <repository-url> cd custom-git
-
Run the setup script:
./scripts/setup.sh
-
Start using the commands:
git mcommit # Simple AI commit message generation git gcommit # Advanced diff clustering (⚠️ UNSTABLE) git gcommit 0.3 # Custom similarity threshold
A simple and reliable tool that generates commit messages for your staged changes using AI.
Features:
- Generates commit messages for staged changes using OpenAI Chat API
- Simple, focused workflow - works only with already staged changes
- Reliable fallback to basic commit if AI fails
- Lightweight and fast
Usage:
git add . # Stage your changes first
git mcommit # Generate AI commit message and commit
Workflow:
- Stage your changes manually (
git add
) - Run
git mcommit
to generate AI commit message - Creates a single commit with AI-generated message
An advanced commit workflow tool that stages changes, analyzes them using AI, and creates multiple commits automatically.
⚠️ WARNING: This command is currently unstable and experimental. Use with caution in production repositories. Consider usinggit mcommit
for reliable AI-powered commits.
Features:
- Automatically stages all changes (
git add .
) - Analyzes staged changes using tree-sitter semantic parsing
- Clusters similar changes using AI embeddings and hierarchical clustering
- Generates commit messages using OpenAI Chat API
- Creates multiple commits automatically based on change clusters
- Fallback to simple commit if AI APIs fail
Usage:
git gcommit # Stage all changes and create smart commits (default threshold 0.5)
git gcommit 0.3 # Use custom similarity threshold (0.0-1.0)
Workflow:
- Stages all changes in working directory
- Extracts and clusters code changes by similarity
- Generates descriptive commit messages for each cluster
- Creates multiple commits automatically
Requirements:
- OpenAI API key (set in
.env
file:OPENAI_API_KEY=your_key_here
) - CMake, OpenSSL
custom-git/
├── commands/ # Individual command implementations
│ ├── mcommit/ # Simple AI commit message generator
│ │ ├── src/ # C++ source files
│ │ ├── build/ # Build artifacts (generated)
│ │ ├── CMakeLists.txt
│ │ └── git-mcommit
│ └── gcommit/ # Advanced commit clustering (unstable)
│ ├── src/ # C++ source files
│ ├── build/ # Build artifacts (generated)
│ ├── CMakeLists.txt
│ └── git-gcommit
├── shared/ # Shared libraries (AI APIs, utilities)
├── scripts/ # Setup and build scripts
│ ├── setup.sh # Full installation script
│ └── build_all.sh # Build all commands (dev)
└── README.md
# Build all commands without installing
./scripts/build_all.sh
# Test commands locally
cd commands/mcommit
echo "test changes" | ./build/git_mcommit.o
cd ../gcommit
git diff HEAD^^^..HEAD | ./build/git_gcommit.o 0.5
-
Create a new directory under
commands/
:mkdir commands/mycommand cd commands/mycommand
-
Add your implementation files and
CMakeLists.txt
-
Create a
git-mycommand
script that calls your executable -
Run
./scripts/setup.sh
to build and install all commands
export OPENAI_API_KEY=your_openai_api_key_here