A sophisticated Git commit message generator that uses AI to create meaningful, conventional commit messages based on your code changes.
Project description
Commit For Free
A sophisticated Git commit message generator that uses AI to create meaningful, conventional commit messages based on your code changes.
Features
- 🤖 AI-powered commit message generation using GPT models
- 📝 Follows Conventional Commits format
- 🔍 Smart analysis of file changes and diffs
- 🎨 Beautiful CLI interface with rich formatting
- ⚡ Efficient handling of both small and large changes
- 🔄 Fallback mechanisms for reliability
- 🎯 Automatic change type detection (feat, fix, docs, etc.)
- 📊 Progress tracking and status display
Installation
- Clone the repository:
git clone https://github.com/alaamer12/c4f.git
cd c4f
- Install the required dependencies:
pip install -r requirements.txt
Usage
Simply run the script in your Git repository:
python c4f/cli.py [COMMANDS]
The tool will:
- Detect staged and unstaged changes in your repository
- Analyze the changes and their context
- Generate an appropriate commit message using AI
- Stage and commit the changes with the generated message
Features in Detail
- Smart Change Analysis: Automatically detects the type of changes (feature, fix, documentation, etc.) based on file paths and content
- Comprehensive Messages: Generates detailed commit messages for larger changes with bullet points and breaking change notifications
- Interactive Interface: Displays changes in a formatted table and allows user interaction when needed
- Progress Tracking: Shows real-time progress for file analysis and commit operations
- Fallback Mechanism: Includes a fallback system if AI generation fails or times out
Configuration
C4F can be configured through command-line arguments:
python c4f/cli.py [OPTIONS]
Available options:
-h, --help: Show help message and exit-v, --version: Show program's version number and exit-r, --root PATH: Set the root directory [default: current project root]-m, --model MODEL: Set the AI model to use [default: gpt-4-mini]-a, --attempts NUM: Set the number of generation attempts [default: 3]-t, --timeout SEC: Set the fallback timeout in seconds [default: 10]-f, --force-brackets: Force conventional commit type with brackets [default: False]
Example usage:
python c4f/cli.py --model gpt-4 --attempts 5 --timeout 15
Requirements
- Python 3.9+
- Git
- Required Python packages (see requirements.txt)
- Internet connection for AI model access
Security
⚠️ Important: C4F is currently in its initial release (v0.1.0) and does not provide any security guarantees. Please read our SECURITY.md file for:
- Current security status
- Known limitations
- Future security plans
- How to report issues
Code of Conduct
We want to foster an inclusive and welcoming environment. All participants in our project are expected to follow basic principles of respect and professionalism. While we don't have formal guidelines yet, please:
- Be respectful and inclusive
- Avoid offensive or harmful behavior
- Help others when possible
- Keep discussions constructive
Contributing
We love contributions! The process is simple:
- Fork the repository
- Install dependencies:
pip install -r requirements.txt
- Make your changes
- Submit a Pull Request
That's it! No complex rules or constraints. Feel free to:
- Fix bugs
- Add features
- Improve documentation
- Suggest ideas
See our ROADMAP.md for planned features you might want to help with.
Model Compatibility
While c4f has been primarily tested with gpt-4-mini, gpt-4, and gpt-3.5-turbo, the underlying g4f library supports many additional models. However, please note:
⚠️ Warning: Although most g4f-supported models may technically work with c4f, they have not been extensively tested and are not officially recommended. Using untested models may result in:
- Lower quality commit messages
- Slower performance
- Unexpected errors or timeouts
For the best experience, we recommend using one of the officially supported models specified in the command-line options.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file commit_for_free-1.0.0.tar.gz.
File metadata
- Download URL: commit_for_free-1.0.0.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b36c5f654643b921aa53f128a3606436f136dd86308c9cfdca173b29f56bce4b
|
|
| MD5 |
8c5df7a34d1e9b8128d129d2946f40a8
|
|
| BLAKE2b-256 |
3f8be01c3919c0b4e59ae2bba04e6339a7b254c7d2d46f86667e639981f0a6da
|
File details
Details for the file commit_for_free-1.0.0-py3-none-any.whl.
File metadata
- Download URL: commit_for_free-1.0.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2d4c5d34e77f8d5891f9143d30a4fe46e5d69bd3a05cef9b049bfe74ff0072c
|
|
| MD5 |
b97e2c7d4a0c56f72d1afc1ad05eeb06
|
|
| BLAKE2b-256 |
f2a129390024a9fa835e9212aa266f4da8b8cbf9e98dbfcf8baf485082e60a09
|