Metadata-Version: 2.1
Name: git_autocommit_hook
Version: 0.1.0
Summary: Automatically generate commit messages from changes
License: CECILL-B
Author: Tristan Brugère
Author-email: 67050900+tbrugere@users.noreply.github.com
Requires-Python: >=3.10,<4.0
Classifier: License :: CeCILL-B Free Software License Agreement (CECILL-B)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: faiss-cpu (>=1.9.0.post1,<2.0.0)
Requires-Dist: mistral-common (>=1.5.1,<2.0.0)
Requires-Dist: mistralai (>=1.2.3,<2.0.0)
Requires-Dist: pydantic (>=2.10.3,<3.0.0)
Requires-Dist: pygit2 (>=1.16.0,<2.0.0)
Description-Content-Type: text/x-rst

Autocommit: automatically write commit messages
===============================================

Uses the `Mistral api <https://mistral.ai/>`_ to pre-generate a commit message for you.

.. image:: .readme-images/autocommit.gif
    :alt: Autocommit in action

Features
--------

- Uses Retrieval-Augmented Generation (RAG) to give context to the LLM.
- Automatically pre-fills commit messages using git hooks.
- Optionally uses the mistral function-calling API to let the model access other files in the codebase (disabled by default).

Setup
-----

You can simply install autocommit using pip:

.. code-block:: console

    $ pip install git_autocommit_hook


Usage
-----

To use autocommit, simply run the following command in the root of your repository:

.. code-block:: console

    $ autocommit setup --key-file <path-to-mistral-api-key>

This will 

- create a ``.autocommit_storage_dir`` (untracked) directory in the root of your repository with the RAG database and the Mistral API key.
- add a git hook to your repository to automatically generate commit messages.
- add a git hook to your repository to keep the RAG database up-to-date.


Why ?
-----

.. figure:: .readme-images/horror.png
    :alt: screenshot of commit messages whose message is simply "update"

    This is why

