@juleczek.1/smartcommit
v0.1.1
Published
AI-powered Git commit assistant for the terminal.
Maintainers
Readme
SmartCommit
SmartCommit is an open-source AI-powered Git commit assistant for the terminal. It analyzes your staged diff, sends the relevant changes to your selected AI provider, and generates a professional Conventional Commit message.
Bring your own API key
Your code never touches our servers.
SmartCommit runs locally as a CLI. Provider requests go directly from your machine to the provider you configure, or to your local Ollama instance.
Features
- Analyze staged changes from
git diff --cached - Filter generated, build, coverage, lock, and minified files
- Generate Conventional Commit messages
- Optional commit body generation with
--body - Interactive flow: Commit, Edit, Regenerate, Cancel
- Auto-commit flow with
--yes - Provider abstraction layer for OpenAI, Anthropic, Gemini, and Ollama
- Local config in
~/.smartcommit/config.json - Doctor command for repository, config, API, and Ollama checks
- Strict TypeScript project ready for npm and GitHub
Installation
npm install -g smartcommitFor local development:
git clone https://github.com/your-org/smartcommit.git
cd smartcommit
npm install
npm run build
npm linkSetup
smartcommit configThe setup flow asks for:
- Provider
- Model
- API key when required
- Optional Ollama base URL
- Request timeout
Config is saved to:
~/.smartcommit/config.jsonExample:
{
"provider": "anthropic",
"model": "claude-sonnet-4",
"apiKey": "xxxxx",
"timeoutMs": 45000
}You can also use environment variables during setup:
OPENAI_API_KEYANTHROPIC_API_KEYGEMINI_API_KEY
Usage
git add .
smartcommitAuto-commit without the interactive menu:
smartcommit --yesAsk the model to include a body when useful:
smartcommit --bodyIncrease the maximum diff size:
smartcommit --max-diff-size 400000Commands
smartcommit # generate a commit message from staged changes
smartcommit config # configure provider, model, and API key
smartcommit providers # list supported providers
smartcommit models # list supported models
smartcommit doctor # check git, config, API connectivity, and OllamaSupported providers and models
| Provider | Models |
| --- | --- |
| OpenAI | gpt-5-mini, gpt-5, gpt-4.1-mini |
| Anthropic | claude-sonnet-4, claude-opus-4 |
| Google Gemini | gemini-2.5-flash, gemini-2.5-pro |
| Ollama | qwen2.5-coder, codellama, deepseek-coder |
Ollama
SmartCommit uses:
http://localhost:11434/api/generateInstall and start Ollama, then pull a supported model:
ollama pull qwen2.5-coder
smartcommit config
smartcommit doctorScreenshots
docs/screenshots/config-flow.png
docs/screenshots/generated-message.png
docs/screenshots/doctor-check.pngExample output
SmartCommit
AI-powered Git commit assistant
✓ Staged diff loaded
✓ Commit message generated
Generated commit message:
feat(auth): add JWT token validation
? What do you want to do?
❯ Commit
Edit
Regenerate
CancelSmartCommit
AI-powered Git commit assistant
✓ Git repository
✓ Staged changes - 4 staged file(s)
✓ Filtered diff - 3 included, 1 ignored
✓ Config - Anthropic / claude-sonnet-4
✓ API connectivity - reachable
✓ Ollama status - running, 2 model(s)Development
npm install
npm run dev -- --help
npm run lint
npm run typecheck
npm run buildProject layout:
smartcommit/
├── bin/
│ └── cli.ts
├── src/
│ ├── providers/
│ ├── git/
│ ├── config/
│ ├── prompts/
│ ├── commands/
│ ├── ui/
│ └── utils/
├── package.json
├── tsconfig.json
├── README.md
├── .gitignore
└── LICENSEPublishing to npm
npm login
npm run prepublishOnly
npm publish --access publicPublishing to GitHub
git init
git add .
git commit -m "chore: initial release"
git branch -M main
git remote add origin https://github.com/your-org/smartcommit.git
git push -u origin mainRoadmap
- Config profiles per repository
- Provider-specific model discovery
- Streaming generation
- Commit message history
- Shell completions
- Git hooks integration
Contributing
Contributions are welcome. Please open an issue before large architectural changes, keep the TypeScript strict checks passing, and include focused documentation updates for user-facing behavior.
License
MIT
