A tool to generate commit messages using AI
Project description
lazym
lazym is an AI-powered tool that automatically generates meaningful commit messages for your Git repositories.
lazym is inspired by jen-Ya/commitgpt
Features
- Generates commit messages based on staged changes
- Without the risk of leaking code snippets to external LLM services
- Integrates seamlessly with your Git workflow
- Uses advanced language models for intelligent message generation
Requirements
- Ollama with Llama 3.1:8b model
- Git (version 2.0 or higher)
- Python 3.7 or above
Command to pull Llama 3.1:8b model for Ollama:
$ ollama run llama3.1:8b
Installation
To install lazym, follow these steps:
-
Ensure you have Python 3.7+ and pip installed on your system.
-
Install lazym using pip:
pip install lazym -
After installation, navigate to any Git repository and run the following command to set up the Git hook:
lazym installThis will install the necessary Git hook to enable automatic commit message generation.
Usage
Once installed and set up, lazym works in two ways:
-
Automatically when you make a commit: Simply stage your changes as usual and run
git commit. lazym will generate a commit message based on your staged changes. -
Manually by running
lazym ci "<hints for LLM>": This command allows you to generate a commit message with additional context provided to the LLM.
After generating the commit message, you'll be presented with three options:
- Accept and commit: Use the generated message as-is and commit.
- Edit message: Modify the generated message before committing.
- Cancel commit: Abort the commit process.
This allows you to benefit from the AI-generated suggestions while maintaining full control over your commit messages. When editing, you can start with the AI-generated message and make any necessary adjustments.
Commands
lazym install: Install the prepare-commit-msg hook in the current Git repository.lazym uninstall: Uninstall the prepare-commit-msg hook from the current Git repository.lazym ci "<optional hints>": Generate a commit message with optional additional context.
Configuration
lazym can be configured using a config.ini file located at ~/.config/lazym/config.ini. The following options are available:
[DEFAULT]
-
model: The AI model to use for generating commit messages.- Default:
"llama3.1:8b"
- Default:
-
message_format: The format to apply to the generated commit message.- Default:
"lowercase" - Options:
"lowercase": Converts the first character of the message to lowercase."sentence case": Capitalizes the first character of each sentence.- Any other value will keep the original format as generated by the AI.
- Default:
Example config.ini:
[DEFAULT]
model = llama3.1:8b
message_format = lowercase
If the config.ini file doesn't exist, lazym will use the default values. You can create and edit this file to customize lazym's behavior according to your preferences.
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 lazym-0.7.2.tar.gz.
File metadata
- Download URL: lazym-0.7.2.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aacb256e78576d4a065be12c287de340cc1abd5e1687614e640f69d1c3ae8875
|
|
| MD5 |
ba54f579375e69cc94b02e2ffecf7f8e
|
|
| BLAKE2b-256 |
cec826f998a82259cb79de17fbed5ab7d0dd0e68f8ff91bdf139211f949bfde6
|
File details
Details for the file lazym-0.7.2-py3-none-any.whl.
File metadata
- Download URL: lazym-0.7.2-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cdc9a8c5190e7431d9ddce870e3435b712e203a58a3f7f930db805f927a33f9
|
|
| MD5 |
ff4ba1f65e792df3cf975b4964fc4053
|
|
| BLAKE2b-256 |
a360256b087c748c0d945b4f58edef1d780de026206cbb5adc4c34ad39905bb0
|