Skip to main content

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

Command to pull Llama 3.1:8b model for Ollama:

$ ollama run llama3.1:8b

Installation

To install lazym, follow these steps:

  1. Ensure you have Python 3.7+ and pip installed on your system.

  2. Install lazym using pip:

    pip install lazym
    
  3. After installation, navigate to any Git repository and run the following command to set up the Git hook:

    lazym install
    

    This will install the necessary Git hook to enable automatic commit message generation.

Usage

Once installed and set up, lazym works in two ways:

  1. 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.

  2. 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:

  1. Accept and commit: Use the generated message as-is and commit.
  2. Edit message: Modify the generated message before committing.
  3. 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"
  • 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.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lazym-0.5.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lazym-0.5.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file lazym-0.5.1.tar.gz.

File metadata

  • Download URL: lazym-0.5.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.6

File hashes

Hashes for lazym-0.5.1.tar.gz
Algorithm Hash digest
SHA256 8e9db516a21b4cd34268994c7a2d478b2bf2b8aa18519eec05ba970d26b00f38
MD5 c863200fad611c7f24d7d7c574cf9481
BLAKE2b-256 8ad85a5c1b1a72d7c32aaad199c03ea3871d75d5742d3e7ee40174c5d4c2b58a

See more details on using hashes here.

File details

Details for the file lazym-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: lazym-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.6

File hashes

Hashes for lazym-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3371404e08da9ac4a68e58e31fbc5014df3df83fec48d6cd36fc20b7acc2b3f2
MD5 167dced24f2087b6e8fe74d4f05267ef
BLAKE2b-256 591909fca4290348d1f2e43472bb0f0e205682a7f6cc5e33c15730a33b20bb46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page