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.7.1.tar.gz (8.6 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.7.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for lazym-0.7.1.tar.gz
Algorithm Hash digest
SHA256 2744179eb0fa84901df21a98b147ebef702509ef6d36348776b5b09ba0f52c38
MD5 8d7342f5fee85b6ca727670aa4e5ac91
BLAKE2b-256 8d3400ced2ef80d05aecdfce95ca9b9c1cf66c22541381029509489db6be699a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lazym-0.7.1-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

Hashes for lazym-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9505aef7e43dc2afc20c161a2a0bf508daa5f6324b9883e7be2d5157a37b40b9
MD5 3b52f780b9049270ecc0ee6afb46737f
BLAKE2b-256 336abffe60f42418d4b90952dcb5cc699e786532bf919c6c5d57d28df8583d6b

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