@juleczek.1/aicommit
v0.1.2
Published
AI-powered Git commit assistant for the terminal.
Maintainers
Readme
AICommit
AICommit is an AI-powered Git commit assistant for the terminal. It reads your staged Git diff, asks your configured AI provider to generate a professional Conventional Commit message, and can create the commit for you.
Package:
@juleczek.1/aicommitCommands:
aicommit
smartcommitaicommit is the main command. smartcommit is kept as a compatibility alias.
Language
English
Privacy
Bring your own API key.
Your code never touches our servers.
AICommit runs locally on your machine. When you use a cloud AI provider, the staged diff is sent directly from your computer to that provider. When you use Ollama, the request stays local.
Features
- Reads staged changes using
git diff --cached - Filters generated files, build output, lockfiles, coverage files, and minified JS
- Generates Conventional Commit messages
- Supports optional commit body generation
- Supports interactive actions: Commit, Edit, Regenerate, Cancel
- Supports automatic commits with
--yes - Supports OpenAI, Anthropic, Google Gemini, and Ollama
- Stores user config locally in
~/.aicommit/config.json - Can read legacy config from
~/.smartcommit/config.json - Includes
doctorchecks for Git, staged files, config, API connectivity, and Ollama
Requirements
Install these first:
- Node.js 20 or newer
- npm
- Git
- An API key for OpenAI, Anthropic, or Gemini, or a local Ollama installation
Check your versions:
node --version
npm --version
git --versionInstallation
Install AICommit globally:
npm install -g @juleczek.1/aicommitOn PowerShell, use quotes if npm has trouble reading the scoped package name:
npm install -g '@juleczek.1/aicommit'Verify the installation:
aicommit --helpExpected result:
Usage: aicommit [options] [command]First-time setup
Run:
aicommit configThe setup wizard asks for:
- AI provider
- Model
- API key if required
- Ollama base URL if you choose Ollama
- Request timeout
The config file is saved locally:
~/.aicommit/config.jsonExample config:
{
"provider": "anthropic",
"model": "claude-sonnet-4",
"apiKey": "xxxxx",
"timeoutMs": 45000
}Never commit this file to GitHub if it contains an API key.
API keys
AICommit does not include any API keys. Each user must provide their own key.
You can enter the key during aicommit config, or you can provide it through environment variables:
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
GEMINI_API_KEY=...On PowerShell:
$env:OPENAI_API_KEY="your-key"
$env:ANTHROPIC_API_KEY="your-key"
$env:GEMINI_API_KEY="your-key"Supported 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 |
Using OpenAI, Anthropic, or Gemini
- Install AICommit:
npm install -g @juleczek.1/aicommit- Configure the provider:
aicommit configSelect provider and model.
Paste your API key when asked.
Check the setup:
aicommit doctorUsing Ollama
Ollama runs locally and does not require an API key.
- Install Ollama from:
https://ollama.com- Pull a supported model:
ollama pull qwen2.5-coder- Configure AICommit:
aicommit config- Choose:
Ollama
qwen2.5-coder- Check the setup:
aicommit doctorAICommit uses this Ollama endpoint:
http://localhost:11434/api/generateDaily usage
Run AICommit inside the Git repository where you want to create a commit.
- Go to your project:
cd path/to/your/project- Stage your changes:
git add .- Run AICommit:
aicommitAICommit will:
- Read staged changes with
git diff --cached - Filter unnecessary files
- Send the diff to the configured AI provider
- Generate a Conventional Commit message
- Show an interactive menu
- Run
git commit -m "..."
Example:
AICommit
AI-powered Git commit assistant
OK Staged diff loaded
OK Commit message generated
Generated commit message:
feat(auth): add JWT token validation
? What do you want to do?
> Commit
Edit
Regenerate
CancelCommands
aicommit
aicommit --yes
aicommit --body
aicommit config
aicommit providers
aicommit models
aicommit doctorCommand details:
| Command | Description |
| --- | --- |
| aicommit | Generates a commit message from staged changes |
| aicommit --yes | Commits automatically without the interactive menu |
| aicommit --body | Allows the model to include a useful commit body |
| aicommit config | Configures provider, model, and API key |
| aicommit providers | Lists supported providers |
| aicommit models | Lists supported models |
| aicommit doctor | Checks Git, staged changes, config, API connectivity, and Ollama |
Files ignored from the diff
AICommit automatically ignores:
package-lock.jsonyarn.lockdist/build/coverage/*.min.js
Troubleshooting
If aicommit is not recognized:
npm install -g @juleczek.1/aicommit
aicommit --helpOn PowerShell:
npm install -g '@juleczek.1/aicommit'If there are no staged changes:
git status
git add .
aicommitIf config is missing:
aicommit configIf API connectivity fails:
aicommit doctorIf Ollama fails:
ollama list
ollama pull qwen2.5-coder
aicommit doctorIf npm says a version already exists during publishing:
npm version patch --no-git-tag-version
npm publish --access publicUpdating
npm install -g @juleczek.1/aicommit@latestPowerShell:
npm install -g '@juleczek.1/aicommit@latest'Uninstalling
npm uninstall -g @juleczek.1/aicommitWhat not to commit to GitHub
Do not commit:
node_modules/dist/coverage/.env.env.*.npmrcif it contains an npm token*.tgz.aicommit/.smartcommit/- local config files containing API keys
- npm/yarn/pnpm logs
- editor and OS files like
.DS_Store,Thumbs.db,.idea/,.vscode/
Commit these files:
bin/src/package.jsonpackage-lock.jsontsconfig.jsoneslint.config.jsREADME.mdLICENSE.gitignore
package-lock.json should be committed because it makes dependency installation reproducible.
dist/ does not need to be committed to GitHub. It is generated before publishing through npm run build.
Development
Install dependencies:
npm installRun locally:
npm run dev -- --helpCheck the project:
npm run lint
npm run typecheck
npm run buildLink the CLI locally:
npm link
aicommit --helpPublishing 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/aicommit.git
git push -u origin mainPolski
Prywatność
Używasz własnego API key.
Twój kod nigdy nie trafia na nasze serwery.
AICommit działa lokalnie na Twoim komputerze. Jeżeli używasz providera chmurowego, staged diff jest wysyłany bezpośrednio z Twojego komputera do tego providera. Jeżeli używasz Ollama, request zostaje lokalnie.
Funkcje
- Pobiera staged changes przez
git diff --cached - Filtruje pliki generowane, build output, lockfile, coverage i minified JS
- Generuje wiadomości zgodne z Conventional Commits
- Opcjonalnie generuje commit body
- Obsługuje menu: Commit, Edit, Regenerate, Cancel
- Obsługuje automatyczny commit przez
--yes - Obsługuje OpenAI, Anthropic, Google Gemini i Ollama
- Zapisuje config lokalnie w
~/.aicommit/config.json - Potrafi odczytać stary config z
~/.smartcommit/config.json - Ma komendę
doctor, która sprawdza Git, staged files, config, API i Ollama
Wymagania
Najpierw zainstaluj:
- Node.js 20 lub nowszy
- npm
- Git
- API key do OpenAI, Anthropic albo Gemini, albo lokalną Ollama
Sprawdź wersje:
node --version
npm --version
git --versionInstalacja
Zainstaluj AICommit globalnie:
npm install -g @juleczek.1/aicommitW PowerShell użyj apostrofów, jeśli npm źle interpretuje nazwę paczki z @:
npm install -g '@juleczek.1/aicommit'Sprawdź instalację:
aicommit --helpOczekiwany wynik:
Usage: aicommit [options] [command]Pierwsza konfiguracja
Uruchom:
aicommit configKonfigurator zapyta o:
- Providera AI
- Model
- API key, jeżeli provider go wymaga
- URL Ollama, jeżeli wybierzesz Ollama
- Timeout requestów
Config zapisuje się lokalnie:
~/.aicommit/config.jsonPrzykładowy config:
{
"provider": "anthropic",
"model": "claude-sonnet-4",
"apiKey": "xxxxx",
"timeoutMs": 45000
}Nie wrzucaj tego pliku na GitHub, jeżeli zawiera API key.
API keys
AICommit nie ma żadnych własnych API keys. Każdy użytkownik podaje własny klucz.
Możesz wkleić API key podczas aicommit config albo ustawić go przez zmienne środowiskowe:
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
GEMINI_API_KEY=...PowerShell:
$env:OPENAI_API_KEY="twoj-klucz"
$env:ANTHROPIC_API_KEY="twoj-klucz"
$env:GEMINI_API_KEY="twoj-klucz"Obsługiwani providerzy i modele
| Provider | Modele |
| --- | --- |
| 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 |
Użycie OpenAI, Anthropic albo Gemini
- Zainstaluj AICommit:
npm install -g @juleczek.1/aicommit- Uruchom konfigurację:
aicommit configWybierz providera i model.
Wklej API key, gdy konfigurator o niego poprosi.
Sprawdź konfigurację:
aicommit doctorUżycie Ollama
Ollama działa lokalnie i nie wymaga API key.
- Zainstaluj Ollama:
https://ollama.com- Pobierz obsługiwany model:
ollama pull qwen2.5-coder- Skonfiguruj AICommit:
aicommit config- Wybierz:
Ollama
qwen2.5-coder- Sprawdź konfigurację:
aicommit doctorAICommit używa endpointu Ollama:
http://localhost:11434/api/generateCodzienne użycie
Uruchamiaj AICommit w repozytorium Git, w którym chcesz zrobić commit.
- Wejdź do projektu:
cd sciezka/do/twojego/projektu- Dodaj zmiany do staged:
git add .- Uruchom AICommit:
aicommitAICommit wykona:
- Odczyt staged changes przez
git diff --cached - Filtrowanie niepotrzebnych plików
- Wysłanie diffu do skonfigurowanego providera AI
- Wygenerowanie Conventional Commit message
- Pokazanie interaktywnego menu
- Uruchomienie
git commit -m "..."
Przykład:
AICommit
AI-powered Git commit assistant
OK Staged diff loaded
OK Commit message generated
Generated commit message:
feat(auth): add JWT token validation
? What do you want to do?
> Commit
Edit
Regenerate
CancelKomendy
aicommit
aicommit --yes
aicommit --body
aicommit config
aicommit providers
aicommit models
aicommit doctorOpis:
| Komenda | Opis |
| --- | --- |
| aicommit | Generuje commit message ze staged changes |
| aicommit --yes | Robi commit automatycznie, bez menu |
| aicommit --body | Pozwala modelowi dodać przydatne commit body |
| aicommit config | Konfiguruje providera, model i API key |
| aicommit providers | Pokazuje obsługiwanych providerów |
| aicommit models | Pokazuje obsługiwane modele |
| aicommit doctor | Sprawdza Git, staged changes, config, API i Ollama |
Pliki ignorowane z diffu
AICommit automatycznie ignoruje:
package-lock.jsonyarn.lockdist/build/coverage/*.min.js
Rozwiązywanie problemów
Jeżeli aicommit nie jest rozpoznawany:
npm install -g @juleczek.1/aicommit
aicommit --helpPowerShell:
npm install -g '@juleczek.1/aicommit'Jeżeli nie ma staged changes:
git status
git add .
aicommitJeżeli brakuje configu:
aicommit configJeżeli API nie odpowiada:
aicommit doctorJeżeli problem dotyczy Ollama:
ollama list
ollama pull qwen2.5-coder
aicommit doctorJeżeli npm mówi, że wersja już istnieje podczas publikacji:
npm version patch --no-git-tag-version
npm publish --access publicAktualizacja
npm install -g @juleczek.1/aicommit@latestPowerShell:
npm install -g '@juleczek.1/aicommit@latest'Odinstalowanie
npm uninstall -g @juleczek.1/aicommitCzego nie wrzucać na GitHub
Nie commituj:
node_modules/dist/coverage/.env.env.*.npmrc, jeżeli zawiera token npm*.tgz.aicommit/.smartcommit/- lokalnych configów z API key
- logów npm/yarn/pnpm
- plików edytora i systemu, np.
.DS_Store,Thumbs.db,.idea/,.vscode/
Commituj:
bin/src/package.jsonpackage-lock.jsontsconfig.jsoneslint.config.jsREADME.mdLICENSE.gitignore
package-lock.json warto commitować, bo daje powtarzalną instalację zależności.
dist/ nie musi być w repozytorium GitHub. Jest generowany przed publikacją przez npm run build.
Development
Instalacja zależności:
npm installUruchomienie lokalne:
npm run dev -- --helpSprawdzenie projektu:
npm run lint
npm run typecheck
npm run buildLokalne podpięcie CLI:
npm link
aicommit --helpPublikacja npm
npm login
npm run prepublishOnly
npm publish --access publicPublikacja GitHub
git init
git add .
git commit -m "chore: initial release"
git branch -M main
git remote add origin https://github.com/your-org/aicommit.git
git push -u origin mainLicense
MIT
