{"id":41146386,"url":"https://github.com/moris88/git-commit-helper","last_synced_at":"2026-01-22T18:56:34.078Z","repository":{"id":302627528,"uuid":"1012963936","full_name":"moris88/git-commit-helper","owner":"moris88","description":"An intelligent CLI tool that leverages the power of AI to streamline your Git workflow. It helps you create flawless, Conventional-Commit-compliant commit messages, performs AI-powered code reviews, and ensures your codebase remains clean and consistent.","archived":false,"fork":false,"pushed_at":"2025-08-14T10:45:12.000Z","size":139,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-14T11:28:16.302Z","etag":null,"topics":["cli","gemini","git","google","helper","inquirer","ollama","yargs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/git-commit-helper-it","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moris88.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-03T06:46:50.000Z","updated_at":"2025-08-14T10:47:20.000Z","dependencies_parsed_at":"2025-08-14T11:19:22.098Z","dependency_job_id":null,"html_url":"https://github.com/moris88/git-commit-helper","commit_stats":null,"previous_names":["moris88/git-commit-helper"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/moris88/git-commit-helper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moris88%2Fgit-commit-helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moris88%2Fgit-commit-helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moris88%2Fgit-commit-helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moris88%2Fgit-commit-helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moris88","download_url":"https://codeload.github.com/moris88/git-commit-helper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moris88%2Fgit-commit-helper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28668664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T17:07:18.858Z","status":"ssl_error","status_checked_at":"2026-01-22T17:05:02.040Z","response_time":144,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","gemini","git","google","helper","inquirer","ollama","yargs"],"created_at":"2026-01-22T18:56:33.992Z","updated_at":"2026-01-22T18:56:34.058Z","avatar_url":"https://github.com/moris88.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Commit Helper with AI\n\nAn intelligent CLI tool that leverages the power of multiple AI providers (Gemini, OpenAI, Ollama) to streamline your Git workflow. It helps you create flawless, Conventional-Commit-compliant commit messages, performs AI-powered code reviews, and ensures your codebase remains clean and consistent.\n\nThis tool is designed for developers who want to improve their productivity and maintain high-quality standards in their projects. It operates in both **English** and **Italian**, automatically detecting your system's language and translating AI responses when needed.\n\n\n## ✨ Features\n\n*   **🤖 Multi-AI Provider Support**: Seamlessly use **Google Gemini**, **OpenAI**, or a local **Ollama** instance. The tool automatically detects the configured provider.\n*   **🌐 Automatic Translation**: AI-generated content (reviews, commit messages) is automatically translated into Italian if the system locale is set to Italian.\n*   **🚀 Optimized Prompts**: Uses provider-specific prompts to ensure the highest quality responses, with special instructions for local models like CodeLlama to prevent formatting issues.\n*   **🌿 AI-Powered Branch Naming**: Suggests a descriptive branch name based on your un-staged changes.\n*   **🔍 AI-Powered Code Review**: Get an instant code review before committing, with a quality score and detailed feedback.\n*   **✍️ AI-Powered Commit Generation**: Automatically generates a concise **subject** and a detailed **body** for your commit message.\n*   **🛡️ Protected Branch Guard**: Prevents direct commits to critical branches (`main`, `master`, `dev`), guiding you to create a new feature branch.\n*   **⚙️ Fully Configurable**: Customize prompts, models, and workflow rules through a simple `gch.config.json` file.\n*   **훅 Pre-Commit Hooks**: Define custom shell commands (like `npm run lint` or `npm run test`) to run before the AI review.\n*   **⚡ Single-Action Commands**: Execute specific tasks like creating a branch (`gch branch`), reviewing code (`gch review`), or generating a commit (`gch commit`) independently.\n*   **👁️ Git Log \u0026 Graph Viewer**: Quickly view the last 5 commits (`gch log`) or a decorated branch graph (`gch adog`).\n*   **🔄 Interactive Rebase \u0026 Checkout**: User-friendly commands (`gch rebase`, `gch checkout`) that let you select a branch from a list.\n*   **↩️ Safe Commit Undo**: The `gch undo` command reverts the last local commit, but only if it hasn't been pushed.\n*   **🤫 Non-Interactive Mode**: Use the `-y` or `--yes` flag to accept all suggestions automatically, perfect for scripting.\n*   **🤝 Conventional Commits Standard**: Enforces the Conventional Commits specification to keep your commit history organized and readable.\n\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n*   Node.js (v18 or higher)\n*   Git\n*   An API Key for your chosen provider (Gemini or OpenAI) or a running Ollama instance.\n\n### Installation\n\nInstall the package globally for easy access from any project:\n\n```bash\nnpm install -g git-commit-helper-it\n```\n\n### Configuration\n\nBefore the first run, you need to create a configuration file. You can do this automatically by running the init script:\n\n```bash\nnpx gch-init // local install\ngch-init // global install\n```\n\nThis will create a `gch.config.json` file in your project's root directory. To use a single configuration for all your projects, you can create a global file instead:\n\n```bash\ngch-init --global\n```\n\nOpen the configuration file and add the keys for your desired AI provider. The tool will automatically use the first valid configuration it finds.\n\nHere is a full example showing all available options:\n\n```json\n{\n  // --- Provider Settings (add only one set of credentials) ---\n  \"geminiApiKey\": \"your-gemini-api-key\",\n  \"geminiModel\": \"gemini-1.5-flash\",\n\n  \"openaiApiKey\": \"your-openai-api-key\",\n  \"openaiModel\": \"gpt-4o-mini\",\n\n  \"ollamaModel\": \"codellama\", // The name of the model pulled in Ollama\n\n  // --- Workflow Settings ---\n  \"aiReviewEnabled\": true,\n  \"defaultCommitType\": \"feat\",\n  \"maxSubjectLength\": 60,\n  \"minReviewScore\": 6,\n  \"maxDiffLines\": 3500,\n  \"preCommitCommands\": [\n    \"npm run lint\",\n    \"npm run build\",\n    \"npm run test\"\n  ]\n}\n```\n\n\n## Usage\n\nThe tool can be run in two main ways: as a full interactive workflow or as a single-action command.\n\n### Full Workflow\n\nTo start the complete, step-by-step interactive process, simply run the main command:\n\n```bash\nnpx gch // local install\ngch // global install\n```\n\nThe tool will guide you through the following steps:\n1.  **Branch Check**: If you are on a protected branch, it suggests a new branch name.\n2.  **File Staging**: Asks you which modified files to stage for the commit.\n3.  **Pre-Commit Hooks**: Runs any configured pre-commit commands.\n4.  **Code Review (Optional)**: Performs an AI-powered code review of your changes.\n5.  **Commit Message Generation**: Generates a subject and, optionally, a detailed body for the commit message.\n6.  **Commit Confirmation**: Shows you the final message and asks for confirmation.\n7.  **Push Confirmation**: Asks if you want to push the changes to the remote repository.\n\nFor a fully automated run, use the `-y` or `--yes` flag:\n\n```bash\nnpx gch -y // local install\ngch -y // global install\n```\n\n### Single-Action Commands\n\nYou can also run specific parts of the workflow independently.\n\n*   `gch branch`: Suggests and creates a new branch.\n*   `gch review`: Stages files and performs an AI code review.\n*   `gch commit`: Stages files and generates a commit message.\n*   `gch push`: Stages, commits, and pushes the current branch.\n*   `gch log`: Displays the last 5 commits.\n*   `gch adog`: Displays a decorated graph of all branches.\n*   `gch rebase`: Starts an interactive rebase process.\n*   `gch undo`: Undoes the last local commit.\n*   `gch checkout`: Starts an interactive process to switch branches.\n\nThe `-y` or `--yes` flag can be combined with any command to skip interactive prompts (e.g., `gch commit -y`).\n\n---\n---\n\n# Git Commit Helper con AI (Italiano)\n\nUno strumento CLI intelligente che sfrutta la potenza di diversi provider AI (Gemini, OpenAI, Ollama) per ottimizzare il tuo flusso di lavoro Git. Ti aiuta a creare messaggi di commit impeccabili e conformi allo standard Conventional Commits, esegue revisioni del codice basate su AI e garantisce che la tua codebase rimanga pulita e coerente.\n\nQuesto strumento è pensato per gli sviluppatori che desiderano migliorare la propria produttività e mantenere standard di alta qualità nei loro progetti. Funziona sia in **inglese** che in **italiano**, rilevando automaticamente la lingua del sistema e traducendo le risposte dell'AI quando necessario.\n\n\n## ✨ Funzionalità\n\n*   **🤖 Supporto Multi-AI Provider**: Usa senza problemi **Google Gemini**, **OpenAI** o un'istanza locale di **Ollama**. Lo strumento rileva automaticamente il provider configurato.\n*   **🌐 Traduzione Automatica**: Il contenuto generato dall'AI (revisioni, messaggi di commit) viene tradotto automaticamente in italiano se la lingua del sistema è impostata su italiano.\n*   **🚀 Prompt Ottimizzati**: Utilizza prompt specifici per ogni provider per garantire la massima qualità delle risposte, con istruzioni speciali per modelli locali come CodeLlama per prevenire problemi di formattazione.\n*   **🌿 Nomi Branch AI**: Suggerisce un nome di branch descrittivo basato sulle modifiche non ancora in staging.\n*   **🔍 Code Review AI**: Ottieni una revisione istantanea del codice prima di committare, con un punteggio di qualità e un feedback dettagliato.\n*   **✍️ Generazione Commit AI**: Genera automaticamente un **soggetto** conciso e un **corpo** dettagliato per il tuo messaggio di commit.\n*   **🛡️ Protezione Branch Critici**: Impedisce commit diretti su branch critici (`main`, `master`, `dev`), guidandoti nella creazione di un nuovo feature branch.\n*   **⚙️ Completamente Configurabile**: Personalizza prompt, modelli e regole del flusso di lavoro tramite un semplice file `gch.config.json`.\n*   **훅 Hook Pre-Commit**: Definisci comandi shell personalizzati (come `npm run lint` o `npm run test`) da eseguire prima della revisione AI.\n*   **⚡ Comandi Singoli**: Esegui operazioni specifiche in modo indipendente, come la creazione di un branch (`gch branch`), la revisione del codice (`gch review`) o la generazione di un commit (`gch commit`).\n*   **👁️ Visualizzatore Log e Grafico Git**: Visualizza rapidamente gli ultimi 5 commit (`gch log`) o un grafico decorato dei branch (`gch adog`).\n*   **🔄 Rebase e Checkout Interattivi**: Comandi intuitivi (`gch rebase`, `gch checkout`) che ti permettono di selezionare un branch da un elenco.\n*   **↩️ Annullamento Sicuro del Commit**: Il comando `gch undo` annulla l'ultimo commit locale, ma solo se non è stato ancora pushato.\n*   **🤫 Modalità Non Interattiva**: Usa il flag `-y` o `--yes` per accettare automaticamente tutti i suggerimenti, ideale per gli script.\n*   **🤝 Standard Conventional Commits**: Impone la specifica Conventional Commits per mantenere la cronologia dei commit organizzata e leggibile.\n\n\n## 🚀 Come Iniziare\n\n### Prerequisiti\n\n*   Node.js (v18 o superiore)\n*   Git\n*   Una API Key per il provider scelto (Gemini o OpenAI) o un'istanza di Ollama in esecuzione.\n\n### Installazione\n\nInstalla il pacchetto globalmente per un accesso semplice da qualsiasi progetto:\n\n```bash\nnpm install -g git-commit-helper-it\n```\n\n### Configurazione\n\nPrima del primo utilizzo, devi creare un file di configurazione. Puoi farlo automaticamente eseguendo lo script di inizializzazione:\n\n```bash\nnpx gch-init // installazione locale\ngch-init // installazione globale\n```\n\nQuesto creerà un file `gch.config.json` nella directory principale del tuo progetto. Per usare una singola configurazione per tutti i tuoi progetti, puoi creare un file globale:\n\n```bash\ngch-init --global\n```\n\nApri il file di configurazione e aggiungi le chiavi per il provider AI che desideri utilizzare. Lo strumento utilizzerà automaticamente la prima configurazione valida che trova.\n\nEcco un esempio completo che mostra tutte le opzioni disponibili:\n\n```json\n{\n  // --- Impostazioni Provider (aggiungi solo un set di credenziali) ---\n  \"geminiApiKey\": \"la-tua-api-key-gemini\",\n  \"geminiModel\": \"gemini-1.5-flash\",\n\n  \"openaiApiKey\": \"la-tua-api-key-openai\",\n  \"openaiModel\": \"gpt-4o-mini\",\n\n  \"ollamaModel\": \"codellama\", // Il nome del modello scaricato in Ollama\n\n  // --- Impostazioni Flusso di Lavoro ---\n  \"aiReviewEnabled\": true,\n  \"defaultCommitType\": \"feat\",\n  \"maxSubjectLength\": 60,\n  \"minReviewScore\": 6,\n  \"maxDiffLines\": 3500,\n  \"preCommitCommands\": [\n    \"npm run lint\",\n    \"npm run test\"\n  ]\n}\n```\n\n\n## Utilizzo\n\nLo strumento può essere utilizzato in due modi principali: come un flusso di lavoro interattivo completo o come un comando per una singola operazione.\n\n### Flusso di Lavoro Completo\n\nPer avviare il processo interattivo completo, esegui semplicemente il comando principale:\n\n```bash\nnpx gch // installazione locale\ngch // installazione globale\n```\n\nLo strumento ti guiderà attraverso i seguenti passaggi:\n1.  **Controllo Branch**: Se ti trovi su un branch protetto, suggerisce un nuovo nome per il branch.\n2.  **Staging dei File**: Ti chiede quali file modificati mettere in staging per il commit.\n3.  **Hook Pre-Commit**: Esegue i comandi di pre-commit configurati.\n4.  **Code Review (Opzionale)**: Esegue una revisione del codice delle tue modifiche tramite AI.\n5.  **Generazione Messaggio di Commit**: Genera un soggetto e, opzionalmente, un corpo dettagliato per il messaggio.\n6.  **Conferma Commit**: Ti mostra il messaggio finale e chiede conferma.\n7.  **Conferma Push**: Ti chiede se desideri inviare le modifiche al repository remoto.\n\nPer un'esecuzione completamente automatizzata, usa il flag `-y` o `--yes`:\n\n```bash\nnpx gch -y // installazione locale\ngch -y // installazione globale\n```\n\n### Comandi per Operazione Singola\n\nPuoi anche eseguire parti specifiche del flusso di lavoro in modo indipendente.\n\n*   `gch branch`: Suggerisce e crea un nuovo branch.\n*   `gch review`: Esegue lo staging dei file ed esegue una code review AI.\n*   `gch commit`: Esegue lo staging dei file e genera un messaggio di commit.\n*   `gch push`: Esegue staging, commit e push del branch corrente.\n*   `gch log`: Visualizza gli ultimi 5 commit.\n*   `gch adog`: Visualizza un grafico decorato di tutti i branch.\n*   `gch rebase`: Avvia un processo di rebase interattivo.\n*   `gch undo`: Annulla l'ultimo commit locale.\n*   `gch checkout`: Avvia un processo interattivo per cambiare branch.\n\nIl flag `-y` o `--yes` può essere combinato con qualsiasi comando per saltare le richieste interattive (es. `gch commit -y`).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoris88%2Fgit-commit-helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoris88%2Fgit-commit-helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoris88%2Fgit-commit-helper/lists"}