aimsg
v1.0.1
Published
AI-powered git commit messages. Free with Ollama, or use OpenAI/Anthropic/Google.
Maintainers
Readme
commitpilot
AI-powered git commit messages. Free with Ollama. Zero config.
Generate meaningful commit messages from your staged changes using AI.
Quick Start
# With Ollama (free, local, no API key needed)
npx aimsg
# Or install globally
npm install -g aimsg
aimsgThat's it. Stage your changes, run aimsg, and get a commit message.
Demo
$ git add .
$ aimsg
Provider: ollama | Model: llama3.2
Files: src/auth.ts, src/routes/login.ts
Generating commit message...
feat(auth): add JWT-based authentication with refresh tokens
[Y]es / [e]dit / [r]egenerate / [n]o? y
Committed!Features
- Free with Ollama — no API key needed, runs 100% locally
- Multi-provider — supports Ollama, OpenAI, Anthropic, and Google
- Conventional Commits — generates properly formatted conventional commits
- Interactive — accept, edit, regenerate, or cancel
- Zero config — works out of the box with Ollama
- Fast — generates messages in seconds
- Private — with Ollama, your code never leaves your machine
Providers
Ollama (Default — Free)
Install Ollama, then:
ollama pull llama3.2
aimsgOpenAI
export OPENAI_API_KEY=sk-...
AUTO_COMMIT_PROVIDER=openai aimsgAnthropic
export ANTHROPIC_API_KEY=sk-ant-...
AUTO_COMMIT_PROVIDER=anthropic aimsgexport GOOGLE_API_KEY=...
AUTO_COMMIT_PROVIDER=google aimsgConfiguration
All configuration is via environment variables. No config files needed.
| Variable | Default | Description |
|----------|---------|-------------|
| AUTO_COMMIT_PROVIDER | ollama | Provider: ollama, openai, anthropic, google |
| AUTO_COMMIT_MODEL | Auto | Model name (auto-selects best for provider) |
| AUTO_COMMIT_CONVENTIONAL | true | Use Conventional Commits format |
| OLLAMA_URL | http://localhost:11434 | Ollama server URL |
Default Models Per Provider
| Provider | Default Model |
|----------|--------------|
| Ollama | llama3.2 |
| OpenAI | gpt-4o-mini |
| Anthropic | claude-haiku-4-5-20251001 |
| Google | gemini-2.0-flash |
Options
aimsg # Generate and commit
aimsg --dry-run # Generate without committing
aimsg --help # Show helpHow It Works
- Reads your staged git diff (
git diff --cached) - Sends the diff to your chosen AI model
- Returns a clean, conventional commit message
- You accept, edit, regenerate, or cancel
Your diff is truncated to 8000 characters to stay within token limits. Only the diff is sent — no other files or context.
Tips
- Add to your shell alias:
alias ac="aimsg"for quick access - Use with Ollama for free: no API costs, no data leaves your machine
- Custom models:
AUTO_COMMIT_MODEL=codellama aimsg
Contributing
PRs welcome. See CONTRIBUTING.md for guidelines.
License
If this saves you time, give it a star.
Also By OuterSpacee
| Project | Description | |---------|-------------| | Awesome AI Tools | 200+ AI tools across 22 categories | | Build Your Own AI | 150+ tutorials for building AI projects from scratch | | AI Engineering Handbook | Everything you need to build production AI apps |
