https://github.com/spartan-71/autocommitt
A CLI tool to generate AI-powered commit messages locally with Ollama—completely free, private, and offline!
https://github.com/spartan-71/autocommitt
ai-commit cli git ollama
Last synced: 4 months ago
JSON representation
A CLI tool to generate AI-powered commit messages locally with Ollama—completely free, private, and offline!
- Host: GitHub
- URL: https://github.com/spartan-71/autocommitt
- Owner: Spartan-71
- License: apache-2.0
- Created: 2024-11-18T11:43:58.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-26T19:27:03.000Z (5 months ago)
- Last Synced: 2025-06-26T20:32:16.439Z (5 months ago)
- Topics: ai-commit, cli, git, ollama
- Language: Python
- Homepage: https://pypi.org/project/autocommitt/
- Size: 167 KB
- Stars: 40
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://www.python.org/downloads/)
[](https://badge.fury.io/py/autocommitt)

AutoCommit is a FOSS **AI-powered CLI tool** that generates context-aware commit messages locally.
## 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](https://ollama.com/download).
- **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.
```bash
pip install autocommitt
```
### Upgrading
Check the installed version with:
```bash
pip list | grep autocommitt
```
If it's not [latest](https://github.com/Spartan-71/AutoCommitt/releases/), make sure to upgrade.
```bash
pip install -U autocommitt
```
## Basic Usage
1. **Stage Your Changes**
Stage the files you want to commit using Git:
```bash
git add
```
2. **Generate and Edit Commit Messages**
Generate a commit message based on your staged changes:
```bash
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 `-p` or `--push` flag:
```bash
act gen -p
```
## Additional Commands
By default, **AutoCommitt** uses the `deepseek-r1:1.5b` model to generate commit messages.
#### 1. Using a Custom Model
- To view the list of available models, run the following command:
```bash
act list
```
- To select and set a model as active:
```bash
act use
```
> **Note**: If the model is not already downloaded, this command will pull the model by running `ollama pull ` and set it as the default.
#### 2. Deleting a Model
```bash
act rm
```
#### 3. Viewing Commit History
Easily view recent commit messages using the `his` command:
```bash
act 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.
## 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](https://github.com/Spartan-71/AutoCommitt/issues) page. Please review our [Contribution Guide](CONTRIBUTING.md) for setup and contribution instructions.
## Acknowledgments
We would like to express our gratitude to the following open-source projects that made AutoCommitt possible:
- [Ollama](https://ollama.ai/) - Enables local AI with large language models.
- [Typer](https://typer.tiangolo.com/) - A CLI builder by [Sebastián Ramírez](https://github.com/tiangolo), powering our command-line interface.
Special thanks to the maintainers and contributors for their outstanding work!
---