This guide provides detailed instructions for installing AI-Aligned-Git on your system.
- Quick Install
- Requirements
- Installation Methods
- PATH Configuration
- Verifying Installation
- Troubleshooting
- Uninstalling
The easiest way to install AI-Aligned-Git is using our automated installer:
curl -fsSL https://raw.githubusercontent.com/ai-ecoverse/ai-aligned-git/main/install.sh | shOr with wget:
wget -qO- https://raw.githubusercontent.com/ai-ecoverse/ai-aligned-git/main/install.sh | shThe installer will:
- Check that git is installed
- Create
~/.local/binif it doesn't exist - Install the git wrapper to
~/.local/bin/git - Check if
~/.local/binis in your PATH - Verify the wrapper has precedence over system git
- Git: The system git must be installed before installing the wrapper
- Git 2.32+: Required for
--trailersupport (released June 2021, widely available) - Unix-like OS: macOS, Linux, or WSL on Windows
- Shell: Bash, Zsh, or Fish shell
- curl or wget: For the automated installer (or you can clone the repo)
The automated installer handles all configuration for you:
curl -fsSL https://raw.githubusercontent.com/ai-ecoverse/ai-aligned-git/main/install.sh | sh# Clone the repository
git clone https://github.com/ai-ecoverse/ai-aligned-git.git
cd ai-aligned-git
# Run the installer
./install.shIf you prefer to install manually:
# Clone the repository
git clone https://github.com/ai-ecoverse/ai-aligned-git.git
# Create ~/.local/bin directory
mkdir -p ~/.local/bin
# Copy and rename the wrapper
cp ai-aligned-git/executable_git ~/.local/bin/git
chmod +x ~/.local/bin/git
# Add ~/.local/bin to PATH (see PATH Configuration below)For the wrapper to work, ~/.local/bin must be in your PATH before the system git location.
The wrapper intercepts git commands by being found first in your PATH. Common system git locations include:
/usr/bin/git/usr/local/bin/git/opt/homebrew/bin/git(macOS with Homebrew)
Your PATH must have ~/.local/bin listed before these directories.
On macOS, there are two ways to configure PATH:
This method ensures all applications (including GUI apps like VS Code) use the wrapper:
- Create a Launch Agent plist file:
sudo tee /Library/LaunchDaemons/setpath.plist > /dev/null << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>setpath</string>
<key>ProgramArguments</key>
<array>
<string>/bin/launchctl</string>
<string>setenv</string>
<string>PATH</string>
<string>/Users/YOUR_USERNAME/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOF- Load the Launch Agent:
sudo launchctl load /Library/LaunchDaemons/setpath.plist- Restart your Mac or log out and back in
Add to your shell configuration file:
For Bash (~/.bashrc or ~/.bash_profile):
export PATH="$HOME/.local/bin:$PATH"For Zsh (~/.zshrc):
export PATH="$HOME/.local/bin:$PATH"For Fish (~/.config/fish/config.fish):
set -gx PATH $HOME/.local/bin $PATHCreate a file /etc/profile.d/local-bin.sh:
sudo tee /etc/profile.d/local-bin.sh > /dev/null << 'EOF'
export PATH="$HOME/.local/bin:$PATH"
EOFAdd to your shell configuration file (same as macOS terminal configuration above).
In WSL, configure your shell the same as Linux user-specific configuration.
After installation, verify everything is working:
-
Check the wrapper is installed:
ls -la ~/.local/bin/git -
Check PATH order:
echo $PATH | tr ':' '\n' | grep -n -E "(local/bin|bin/git)"
Ensure
~/.local/binappears before system git locations. -
Check which git will be used:
which git
This should show
~/.local/bin/git -
Test the wrapper:
# Run git to see if the wrapper is active git --version -
Test with an AI tool: If you're using Claude, Cursor, or another supported AI tool, try:
git add .You should see an error message about AI tools needing to add files individually.
Symptom: which git shows /usr/bin/git instead of ~/.local/bin/git
Solution:
- Ensure
~/.local/binis in your PATH - Ensure it comes BEFORE system directories
- Reload your shell configuration or start a new terminal
Symptom: PATH looks correct but wrapper isn't being used
Solution:
- On macOS: GUI applications may need system-wide PATH configuration (see macOS Option 1)
- Try logging out and back in
- For immediate effect in current terminal:
source ~/.bashrc(or appropriate config file)
Symptom: Can't create ~/.local/bin or install the wrapper
Solution:
- Ensure you own your home directory:
sudo chown -R $USER:$USER ~/.local - Check disk space:
df -h ~
Symptom: Installer reports git is not installed
Solution:
- macOS:
brew install git - Ubuntu/Debian:
sudo apt-get install git - Fedora/RHEL:
sudo yum install git - Arch:
sudo pacman -S git
./install.sh --uninstallrm ~/.local/bin/gitNote: PATH modifications in your shell configuration files are not automatically removed. You may want to remove the export PATH="$HOME/.local/bin:$PATH" line from your shell config if you added it solely for this tool.
If you encounter issues not covered here:
- Check the GitHub Issues
- Run the installer with verbose output:
./install.sh --verboseor./install.sh -v - Verify your shell and OS are supported
The verbose mode will show:
- Detected OS and shell information
- PATH analysis and precedence checks
- Download progress (when using curl/wget)
- Directory creation and permission details
- Each step of the installation process
Remember: The wrapper must be found in PATH before the system git for it to work correctly!