A CLI tool for generating editable commit messages with local AI models
Project description
A lightweight CLI tool that automatically generates meaningful commit messages using small, efficient AI models locally. AutoCommitt leverages Ollama to create concise, context-aware commit messages while keeping resource usage minimal.
Features
- Local AI-Powered: Generates commit messages using a small LLM models locally
- Flexible Editing: Review and edit generated messages before committing
- Git Integration: Seamlessly works with your existing Git workflow
- Multiple Language Model Support: Option to choose different local AI models
Setup
Prerequisites
- RAM (minimum):
- 8GB for smaller models (<=3B parameters)
- 16GB for optimal performance
- GPU (Optional): Boosts performance, but not required
Installation
It is recommended to use a virtual environment.
pip install autocommitt
Upgrading
Check the installed version with:
pip list | grep autocommitt
If it's not latest, make sure to upgrade.
pip install -U autocommitt
Basic Usage
-
Start the Ollama Server
Launch the Ollama server to activate model-based commit message generation.autocommitt start
-
Stage Your Changes
Stage the files you want to commit using Git:git add <files...>
-
Generate and Edit Commit Messages
Generate a commit message based on your staged changes:autocommitt gen
-
The tool generates a message and allows you to review and edit it before committing.
-
To automatically push the commit to the remote repository, use the
-p
or--push
flag:autocommitt gen -p
Pro Tip: Save time by using the
--push
flag to combine committing and pushing into a single step. -
-
Stop the Ollama Server
Once you're done, stop the Ollama server to free up resources:autocommitt stop
Note: You can use the
ac
alias forautocommitt
throughout, making commands shorter and quicker to type!
Additional Commands
By default, AutoCommitt uses the llama3.2:3b
model to generate commit messages.
1. Using a Custom Model
- To view the list of available models, run the following command:
autocommitt list
- To select and set a model as active:
autocommitt use <model_name>
Note: If the model is not already downloaded, this command will pull the model by running
ollama pull <model_name>
and set it as the default.
2. Deleting a Model
autocommitt rm <model_name>
Note: Since models require a significant amount of memory (minimum 2GB), it is recommended to use only one model and delete the rest to free up space.
3. Viewing Commit History
Easily view recent commit messages using the his
command:
autocommitt his -n 5
- Flag Description:
-n
or--limit
: (Optional) Specify the number of recent commit messages to retrieve. If omitted, all commit messages will be displayed.
Pro Tip: Use this command to quickly review your project's recent changes before generating new commit messages.
How It Works
It runs the git diff --staged
command to gather all staged changes and processes them using a local LLM (default: llama3.2:3b
provided by Ollama). The model analyzes the changes and generates a concise, context-aware commit message, ensuring privacy and avoiding external API dependencies.
Future Enhancements
- Cross-Platform Support: Compatibility for Windows.
- Git Hooks Integration: Compatible with pre-commit hooks
- Custom Templates: Support for user-defined commit message templates
Contributing
We welcome contributions! To report bugs, fix issues, or add features, visit the Issues page. Please review our Contribution Guide for setup and contribution instructions.
For discussions or real-time collaboration, join our Gitter community. Your contributions are appreciated!
Acknowledgments
We would like to express our gratitude to the following open-source projects that made AutoCommitt possible:
- Ollama - Enables local AI with large language models.
- Typer - A CLI builder by Sebastián Ramírez, powering our command-line interface.
Special thanks to the maintainers and contributors for their outstanding work!
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
Built Distribution
File details
Details for the file autocommitt-0.1.9.tar.gz
.
File metadata
- Download URL: autocommitt-0.1.9.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88ee297bcb7c2fdac3b3fbc7f3f1b33a74182772851fb20097837455e3ac9716 |
|
MD5 | ebc4920b4187b3f11046135690498028 |
|
BLAKE2b-256 | 1ac978875e834f3e8e870fb70ac34436d37648a1ecf08b07be27797b4441eefd |
Provenance
The following attestation bundles were made for autocommitt-0.1.9.tar.gz
:
Publisher:
release.yaml
on Spartan-71/AutoCommitt
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
autocommitt-0.1.9.tar.gz
- Subject digest:
88ee297bcb7c2fdac3b3fbc7f3f1b33a74182772851fb20097837455e3ac9716
- Sigstore transparency entry: 151374237
- Sigstore integration time:
- Predicate type:
File details
Details for the file autocommitt-0.1.9-py3-none-any.whl
.
File metadata
- Download URL: autocommitt-0.1.9-py3-none-any.whl
- Upload date:
- Size: 19.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5f819b406e9e8f68a419fb0a012e29ffc19e39f3d248a98886faaa347c33062 |
|
MD5 | 7e02d757cb5596f572ad1d974f36a2b9 |
|
BLAKE2b-256 | 331ac1811a08ebf488d4b4c159d6053e8fd1021376a263404af14337d396e9bd |
Provenance
The following attestation bundles were made for autocommitt-0.1.9-py3-none-any.whl
:
Publisher:
release.yaml
on Spartan-71/AutoCommitt
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
autocommitt-0.1.9-py3-none-any.whl
- Subject digest:
e5f819b406e9e8f68a419fb0a012e29ffc19e39f3d248a98886faaa347c33062
- Sigstore transparency entry: 151374238
- Sigstore integration time:
- Predicate type: