AutoCommit is a free and open-source AI-powered CLI tool that generates unlimited commit messages locally using Ollama. It works entirely offline, requiring no API keys, providing developers with a private and efficient way to create concise, context-aware commit messages.
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
- Ollama: Download and install ollama from offical website.
- 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
act startNote: The Ollama server starts automatically after installation. However, running this command ensures that all configuration files are updated and a default model is properly set up.
-
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:act 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
-por--pushflag:act gen -p
Pro Tip: Save time by using the
--pushflag to combine committing and pushing into a single step. -
-
Stop the Ollama Server
To free up resources after you're done, stop the Ollama server:act stopNote: This command is supported only on Linux. On Windows and macOS, the Ollama server runs continuously as long as the machine is active.
Pro Tip: You can use the
autocommittalias foractthroughout, 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:
act list - To select and set a model as active:
act 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
act 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:
act his -n 5
- Flag Description:
-nor--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 MacOS.
- 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.
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!
Metadata
Release files for autocommitt 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| autocommitt-0.3.0.tar.gz | 34.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autocommitt-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.7 kB
Release files / autocommitt-0.3.0.tar.gz
| Download URL | autocommitt-0.3.0.tar.gz |
|---|---|
| Size | 34.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aea11e91b183743bd73f49891210f27b7427d312302f3be5e9dd241588c1fe8f
|
|
BLAKE2b-256 checksum How to use checksums |
b1708de9ff037065fc674ffbe6cf695b0b412072d7dd069e8ee3aee2b32c3bf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 2, 2025.
Transparency logRelease files / autocommitt-0.3.0-py3-none-any.whl
| Download URL | autocommitt-0.3.0-py3-none-any.whl |
|---|---|
| Size | 23.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86801c75f33d682cdf09c572ec2561c776bdd2d61977e53ac866010598fde871
|
|
BLAKE2b-256 checksum How to use checksums |
74dcc1f7c09a3c80417e4dfe18bed29fbc5e12cd7ecb8768ac4ef0c5b4f2a872
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 2, 2025.
Transparency logSecurity for autocommitt 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for autocommitt-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 2, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.