Download the PHP package mdeloughry/gcm-gen without Composer
On this page you can find all versions of the php package mdeloughry/gcm-gen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package gcm-gen
GCM-Gen (Git Commit Message Generator)
GCM-Gen is a CLI tool that generates meaningful commit messages by analysing your git changes. It uses AI to understand your code changes and generate appropriate commit messages. Supports both ChatGPT and Ollama for AI processing.
Features
- 🤖 AI-powered commit message generation (ChatGPT or Ollama)
- ⚡ Quick and easy to use
- 🛠️ Configurable prompts and settings
- 📝 Direct git commit integration with branch-based commit types
- 🎨 Beautiful terminal UI
Choosing an LLM Provider
GCM-Gen supports two AI providers, each with their own advantages:
ChatGPT (Recommended for Best Results)
- ✅ Superior commit message quality
- ✅ Faster processing
- ✅ Lower system requirements
- ❌ Requires API key
- ❌ Sends code diffs to OpenAI servers
- ❌ Usage costs (pay per API call)
Ollama (Recommended for Privacy/Offline Use)
- ✅ Completely free to use
- ✅ Runs 100% locally
- ✅ No data leaves your machine
- ❌ Requires significant system resources
- ❌ Slower processing time
- ❌ May produce less consistent results
Choose ChatGPT if you want the best quality commit messages and don't mind the API costs. Choose Ollama if you need to keep your code private or want a free, offline solution.
Requirements
Core Requirements
- PHP 8.1 or higher
- Composer
- Git
AI Provider Requirements
Option 1: ChatGPT
- OpenAI API Key
- Sign up at OpenAI Platform
- Create an API key at API Keys
- Add the API key to your configuration file
Option 2: Ollama
- Install Ollama
- Visit Ollama.ai to download and install
- Follow the installation instructions for your operating system
-
Start the Ollama service:
- Pull the required model:
Installation
Global Installation
Make sure your global Composer bin directory is in your system's PATH.
Usage
Configuration
On first run, GCM-Gen will create a configuration file at ~/.config/gcm-gen.config.php. You can edit this file directly or use:
Configuration Options
The configuration file supports both ChatGPT and Ollama providers. Here's a complete example:
Configuration Breakdown
provider: Choose between 'chatgpt' or 'ollama'ignore_files: List of files and directories to exclude from the git diff analysisollama: Ollama-specific settingsmodel: The Ollama model to use (default: llama3.2)
chatgpt: ChatGPT-specific settingsmodel: The GPT model to use (default: gpt-4)api_key: Your OpenAI API key
prompt: The template used to generate commit messages, supporting:- Automatic emoji type based on branch name
- Ticket number extraction from branch names
- Conventional commit message formatting
Development Setup
-
Clone the repository:
-
Install dependencies:
-
Set up your environment:
- Copy
.env.exampleto.env - Add your OpenAI API key to
.env
- Copy
- Run tests:
Development Requirements
- PHP 8.1 or higher
- Composer
- OpenAI API key or Ollama installed locally
- Git
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
If you encounter any problems or have suggestions, please open an issue.