@resdeby/commitify
v1.1.8
Published
AI-Powered Git Commit Message Generator CLI
Maintainers
Readme
🚀 Commitify
✨ AI-powered Git commit message generator with multiple providers (Gemini, Groq, Ollama)
Ucapkan selamat tinggal pada kebingungan merangkai pesan commit manual! Commitify menganalisis perubahan kode Anda (git diff) dan menghasilkan pesan commit yang singkat, padat, dan sesuai standar Conventional Commits menggunakan AI.
✨ Fitur Unggulan
- 🤖 Multi-Provider AI – Pilih antara Google Gemini, Groq, atau Ollama (local, gratis tanpa limit).
- 📋 Conventional Commits – Otomatis menghasilkan pesan dengan tipe seperti
feat,fix,chore,refactor, dll. - ⚡ Cepat & Efisien – Analisis diff dan generate commit dalam hitungan detik.
- 🎨 Emoji Support – Tambahkan emoji di awal pesan commit untuk tampilan yang lebih menarik.
- 🔧 Konfigurasi Global – Simpan API key secara global (
~/.commitifyrc) agar bisa digunakan di semua proyek. - 📜 Riwayat Commit – Lihat riwayat commit yang pernah digenerate dengan
commitify history. - 🧪 Dry Run – Coba generate pesan tanpa melakukan commit (
--dry-run). - 📊 Statistik Perubahan – Tampilkan jumlah file, insertions, dan deletions (
--stats). - 🛠️ Custom Template – Buat prompt template sendiri sesuai kebutuhan (inline
--templateatau via--template-file). - ⚠️ Breaking Changes – Tandai perubahan sebagai breaking dengan menambahkan
!di pesan commit. - 🪝 Git Hook – Otomatis generate pesan saat
git commit(commitify hook install). - ↩️ Undo Commit – Batalkan commit terakhir, perubahan kembali ke staging (
commitify undo). - 🌊 Streaming Output – Pesan commit muncul real-time saat digenerate (Gemini, Groq, Ollama).
- 🔄 Auto Retry – Error rate limit/server sibuk otomatis dicoba ulang.
🛠️ Prasyarat
- Node.js (versi 18 atau lebih baru)
- Git yang sudah terinisialisasi di repository Anda
- API Key dari salah satu provider (kecuali Ollama):
- Google Gemini – gratis 60 req/menit
- Groq – gratis 30 req/menit, lebih cepat
- Ollama – local, gratis tanpa limit (install terpisah)
📦 Instalasi
Via NPM
npm install -g @resdeby/commitify⚠️ Paketnya bernama
@resdeby/commitify(scoped). Perintah CLI yang terpasang tetapcommitify.
Via Repository (untuk development)
git clone https://gitlab.com/resdeby/commitify.git
cd commitify
npm install
npm run build
npm link⚙️ Konfigurasi
Commitify mendukung 3 cara konfigurasi (prioritas: lokal > global > environment):
- Interaktif (Direkomendasikan)
commitify --initIkuti panduan interaktif untuk memilih provider, memasukkan API key, dan mengatur preferensi lainnya. Pada akhir setup, Anda akan ditanya apakah ingin menyimpan konfigurasi secara global (agar bisa dipakai di semua proyek) atau lokal (hanya untuk proyek saat ini).
- Manual – File Konfigurasi
Buat file
.commitifyrcdi root proyek (lokal) atau di home directory (global):
{
"provider": "gemini",
"model": "gemini-2.0-flash-exp",
"geminiApiKey": "YOUR_GEMINI_API_KEY",
"emoji": true,
"autoApprove": false,
"defaultType": "feat",
"defaultScope": "",
"maxTokens": 300,
"maxDiffSize": 3000,
"language": "en",
"promptTemplate": "Analisis git diff berikut..."
}Catatan:
temperaturediatur per provider (tidak bisa diubah lewat config). DefaultmaxTokens= 300, defaultmaxDiffSize= 3000.
3. Environment Variables
export GEMINI_API_KEY=your_key_here
export GROQ_API_KEY=your_key_here🚀 Penggunaan
Perintah Dasar
# Stage perubahan terlebih dahulu
git add .
# Jalankan commitify (akan interaktif)
commitify
# Mode cepat (auto-approve)
commitify -y
# Auto-add + dry-run
commitify --add --dry-run
# Tampilkan statistik perubahan
commitify --stats
# Gunakan custom template
commitify --template "Buatkan pesan commit untuk: {diff}"
# Tandai sebagai breaking change
commitify --breaking
# Pilih file yang di-staging secara interaktif
commitify --select-files
# Biarkan AI mendeteksi tipe commit
commitify --auto-type
# Generate 3 pilihan pesan commit
commitify --multi
# Pesan commit dalam bahasa Indonesia
commitify --lang id
# Auto-scope dari direktori file yang berubah
commitify --auto-scope -y
# Template prompt dibaca dari file
commitify --template-file ./prompt.txtGit Hook & Undo
# Pasang prepare-commit-msg hook (commitify generate pesan saat git commit)
commitify hook install
# Cek status / lepas hook
commitify hook status
commitify hook uninstall
# Undo commit terakhir (perubahan tetap di-staging)
commitify undo
# Paksa reset walaupun commit bukan dari Commitify
commitify undo --forceRiwayat
# Lihat 5 commit terakhir
commitify history --last 5
# Export riwayat ke JSON / CSV
commitify history --export riwayat.json
commitify history --export riwayat.csv
# Hapus seluruh riwayat
commitify history --clearSubcommand
| Perintah | Deskripsi |
| :------------------------ | ------------------------------------------------------------------------- |
| commitify | Jalankan generator utama (interaktif) |
| commitify doctor | Diagnostik sistem dan konfigurasi |
| commitify config [apiKey] | Lihat atau set API Key (tambahkan --global untuk global) |
| commitify generate / gen | Generate commit message (mode sederhana) |
| commitify history | Riwayat commit (--last [n], --export <file>, --clear, --yes) |
| commitify hook <action> | Kelola git hook: install, uninstall, status |
| commitify undo [--force] | Undo commit terakhir (soft reset; --force jika bukan dari Commitify) |
| commitify interactive / i | Mode interaktif step-by-step |
| commitify --init | Setup interaktif konfigurasi |
Opsi (Flags)
| Flag | Deskripsi |
| :---------------------- | ----------------------------------------------------------------- |
| -y, --yes | Langsung commit tanpa konfirmasi manual |
| -a, --add | Otomatis git add . sebelum commit |
| -s, --select-files | Pilih file yang akan di-staging secara interaktif (checkbox) |
| -t, --auto-type | Biarkan AI mendeteksi tipe commit dari diff (skip pilihan tipe) |
| --amend | Lakukan git commit --amend |
| --init | Generate file .commitifyrc interaktif |
| -v, --verbose | Tampilkan detail proses (debug) |
| --stats | Tampilkan statistik perubahan |
| --dry-run | Generate pesan tanpa melakukan commit |
| --multi | Generate 3 pilihan pesan commit untuk dipilih |
| --lang <en\|id> | Bahasa pesan commit (default: dari config, en) |
| --template <template> | Custom prompt template (gunakan {diff}, {type}, {scope}, {emoji}) |
| --template-file <path> | Baca prompt template dari file |
| --auto-scope | Deteksi scope otomatis dari direktori file yang diubah |
| --breaking | Tandai sebagai breaking change (tambah !) |
| --hook <file> | Mode git hook: tulis pesan commit ke file (dipanggil prepare-commit-msg) |
| --hook-source <source> | Sumber hook (message/merge/dll dilewati, tidak memblokir commit) |
🧪 Contoh Sesi
$ commitify --add --dry-run
╭────────────────────────────────────────────╮
│ ⚡ COMMITIFY v1.1.5 │
│ AI-Powered Git Commit Message Generator │
╰────────────────────────────────────────────╯
── Ringkasan Perubahan ──────────────────────────────────────────
3 file +45 −6
package.json + 3 − 1
src/services/git.service.ts + 30 − 4
src/utils/config.ts + 12 − 1
Diff 10020 chars (dipotong)
✅ Semua perubahan berhasil di-stage.
── Konfigurasi AI ───────────────────────────────────────────────
Provider Groq
Model llama-3.3-70b-versatile · max 300 tokens
Bahasa English
API key gsk_••••••••abcd
Branch main
Mode interaktif · dry-run
── Pilih tipe commit ────────────────────────────────────────────
✨ feat - Fitur baru
🐛 fix - Perbaikan bug
❯ 🔧 chore - Maintenance / tugas teknis
── Konfirmasi commit ────────────────────────────────────────────
╭──────────────────────────────────────────────╮
│ Pesan commit yang akan digunakan │
│ │
│ 🔧 chore(deps): update dependencies latest │
╰──────────────────────────────────────────────╯
Gunakan pesan ini?
✅ Ya, commit sekarang
✏️ Edit pesan
❌ Batal
╭──────────────────────────────────────────────╮
│ 🧪 DRY RUN – tidak melakukan commit │
│ │
│ Pesan 🔧 chore(deps): update dependencies… │
│ Meta main · 2.1s │
│ Diff 3 file +45 −6 │
│ AI groq · llama-3.3-70b-versatile │
│ │
│ Jalankan ulang tanpa --dry-run untuk commit. │
╰──────────────────────────────────────────────╯🤝 Kontribusi
Kontribusi sangat diterima! Silakan buka issue atau pull request.
- Fork repository ini
- Buat branch fitur (git checkout -b feature/FiturBaru)
- Commit perubahan (git commit -m 'feat: Menambahkan fitur X')
- Push ke branch (git push origin feature/FiturBaru)
- Buat Pull Request
📄 Lisensi
Proyek ini dilisensikan di bawah MIT License.
Hak Cipta © [2026] [Resdeby]
Dengan lisensi ini, Anda diperbolehkan untuk:
- Menggunakan, menyalin, dan memodifikasi perangkat lunak ini
- Mendistribusikan ulang perangkat lunak ini, baik versi asli maupun yang telah dimodifikasi
- Menggabungkan ke dalam proyek komersial maupun pribadi
Satu-satunya kewajiban Anda adalah mencantumkan pemberitahuan hak cipta dan pernyataan lisensi ini di semua salinan atau bagian penting dari perangkat lunak ini.
📌 Untuk teks lisensi selengkapnya, silakan lihat file
LICENSEatau kunjungi opensource.org/licenses/MIT.
