Skip to main content

Commit Maker Created with Python Created with uv Created with ollama

Demo

All commits in the repository are generated by this program

This CLI utility automatically creates meaningful git commit messages using local models via ollama/Mistral AI API based on the output of git status and git diff commands. It is implemented as a single file for easy conversion into an executable.

  1. Features
  2. Requirements
  3. Installation
  4. Setting up environment variables
  5. Usage
  6. Notes
  7. License

Features

  • Automatically generates meaningful commit messages in Russian or English
  • Interactive confirmation before creating a commit
  • Works with both existing and new Git repositories
  • Uses local models/Mistral AI API to generate commit messages based on repository changes

Requirements

  • Git installed on your system
  • Mistral API key (for using Mistral AI API)
  • Ollama installed on your system (for using local models)

Getting a Mistral AI API Key

To get a key, go to the Mistral console website Mistral and create an API key. You need a Mistral account to do this.

Installing Ollama

To install ollama, go to the Ollama website and choose the method suitable for your system.

Installation

From PyPI

pip install commit-maker

From Source

When installing from source, use the -e flag to always have the latest version of the utility after git pull without reinstallation!

git clone https://github.com/Sashayerty/commit_maker
cd ./commit_maker
# Windows
pip install -r requirements.txt
# Linux/MacOS
pip3 install -r requirements.txt

Setting Up Environment Variables

After installing the utility, you must add the MISTRAL_API_KEY environment variable.

Windows

  1. Open Command Prompt as Administrator
  2. Set the Mistral API key:
    setx MISTRAL_API_KEY "your_api_key_here"
    
  3. Restart your terminal/IDE to apply the changes

Linux/macOS

  1. Open the terminal
  2. Add to your shell configuration file (~/.bashrc, ~/.zshrc, or ~/.bash_profile):
    export MISTRAL_API_KEY="your_api_key_here"
    
  3. Reload the configuration:
    source ~/.bashrc  # or whichever file you edited
    

Usage

commit_maker [OPTION] [VALUE]

Usage Examples

-h, --help - display help
-l, --local-models - use local models
-m, --max-symbols - limit the length of the commit message
-M, --model - specify which local model to use (with -l)
-d, --dry-run - display the message based on staged changes without creating a commit
-t, --temperature - model temperature when creating the message
-e, --exclude - files to ignore when creating the commit message
-w, --wish - wishes/edits for the message
-L, --language - change language of commits
-V, --version - show version

  1. Use local models, limit commit message length to 300 characters, use qwen2.5:12b
    commit_maker -l -m 300 -M qwen2.5:12b
    
  2. Use Mistral, temperature 1.3, dry run
    commit_maker -t 1.3 -d
    
  3. Local models, interactive model selection
    commit_maker -l
    
  4. Local models, message length 100 characters, ignore uv.lock, wish "Mention the README.md change"
    commit_maker -l -m 100 -e "./uv.lock" -w "Mention the README.md change"
    

Notes

  • To view all possible script execution options, add the --help flag
  • The script will show the generated commit message before creating it
  • You can regenerate the message by pressing r when prompted for confirmation
  • By default, messages are generated in Russian (can be changed in the script)

License

Commit Maker is licensed under MIT

Metadata

Release files for commit-maker 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for commit-maker 0.3.1
File Size Uploaded
commit_maker-0.3.1.tar.gz 11.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for commit-maker 0.3.1
File Interpreter ABI Platform
commit_maker-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 23.1 kB

Release files / commit_maker-0.3.1.tar.gz

Download URL commit_maker-0.3.1.tar.gz
Size 11.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d1c86d90954abdb9417940034090a8266a67c6110cccc79742f09da5eb2d458e
BLAKE2b-256 checksum
How to use checksums
9fb603657c8cb747fe4d35d96f516782512653fe331b64eae484671297846c13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / commit_maker-0.3.1-py3-none-any.whl

Download URL commit_maker-0.3.1-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0d4fc335a8ea7588c362bc02dabf17a4d7bc52915d053aa187afc8d616c4b5a
BLAKE2b-256 checksum
How to use checksums
993dd212a972ac8e8b18e908d21a064c0e8c2d50af3df6fe39a68e5492077dee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

1 release file

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page