@vjrngn/gait
v1.1.0
Published
Git Commit with AI
Maintainers
Readme
@vjrngn/gait
AI-powered git commit message generator. Uses Ollama or other AI providers to automatically generate meaningful commit messages from your staged changes.
Features
- 🤖 AI-Powered - Generate commit messages using local or cloud AI models
- 🔒 Privacy-First - Uses Ollama for local processing (your code never leaves your machine)
- 🌐 Multi-Provider Support - Ollama, OpenAI, Anthropic, Google, Cohere, Mistral
- 🎯 Conventional Commits - Generates messages following the Conventional Commits specification
- ⚡ Fast - Simple CLI interface
- 💾 Configurable - Custom model selection and provider configuration
Installation
# Install globally
npm install -g @vjrngn/gait
# Or use npx without installing
npx @vjrngn/gaitPrerequisites
For Ollama (Default - Local)
- Install Ollama
- Pull a model:
ollama pull llama3 ollama pull codellama ollama pull mistral
For Cloud Providers
If using OpenAI, Anthropic, or other cloud providers, set their API keys:
export OPENAI_API_KEY="your-key"
export ANTHROPIC_API_KEY="your-key"
# etc.Usage
# Stage your changes first
git add .
# Run gait to generate a commit message
gait
# Or use the full command
git-commit-aiOptions
gait # Generate commit message for staged changes
gait --all # Use all changes (not just staged)
gait --model <name> # Specify a different model
gait --provider <name> # Switch between ollama/openai/anthropic/etc.
gait --config # Open configuration
gait --list-models # List available Ollama modelsConfiguration
Gait stores config in ~/.gait/gait.json. You can configure:
- Default provider - Which AI provider to use
- Model - Which model to use per provider
- Custom prompts - Modify how commit messages are generated
Example Configuration
{
"providers": {
"ollama": {
"model": "llama3"
},
"openai": {
"model": "gpt-4"
}
},
"activeProvider": "ollama"
}Supported Providers
| Provider | Setup Required |
|----------|---------------|
| Ollama | Install Ollama, pull model |
| OpenAI | Set OPENAI_API_KEY |
| Anthropic | Set ANTHROPIC_API_KEY |
| Google Gemini | Set GOOGLE_API_KEY |
| Cohere | Set COHERE_API_KEY |
| Mistral | Set MISTRAL_API_KEY |
Development
# Clone the repo
git clone https://github.com/vjrngn/gait.git
cd gait
# Install dependencies
npm install
# Run tests
npm test
# Link for local development
npm linkPublishing
# Create a git release (patch version)
npm run release
# Create a git release (minor version)
npm run release:minor
# Create a git release (major version)
npm run release:major
# Publish to npm
npm run publishHow It Works
- Git Diff - Gait runs
git diff --stagedto get your staged changes - Prompt Engineering - The diff is sent to your configured AI provider with a prompt asking for a conventional commit message
- Message Generation - AI generates a commit message following the format:
type(scope): description - Confirmation - You can edit or accept the generated message before committing
License
MIT
