Skip to main content

Gultron: AI-powered Git Commit Message Generator

Gultron is an AI-powered tool that automatically generates Git commit messages based on your code changes. It uses Google's Gemini AI to analyze your Git diffs and suggest meaningful, descriptive commit messages. Gultron helps save time and ensures your commit history is consistent and descriptive.

Features

  • AI-powered commit message generation: Suggest commit messages based on the code changes using Google's Gemini AI.
  • Staged changes support: Generate commit messages based on the current staged changes.
  • Clipboard integration: Optionally copy the generated commit message to your clipboard for easy pasting.

Installation

Manual Installation

To install Gultron manually, follow these steps:

  1. Clone the repository:

    git clone https://github.com/Mahmoud-Emad/gultron.git
    cd gultron
    
  2. Install the dependencies:

    poetry install
    
  3. Build the executable:

    ./build
    
  4. Run the executable:

    # Inside a repo you can do
    gultron --generate
    # or run it from everywhere and pass the repo path as an argument
    gultron --repo "/path/to/your/repo" --generate
    

Using pip

You can install Gultron using pip:

    pip install gultron

Run the executable:

# Inside a repo you can do
gultron --generate
# or run it from everywhere and pass the repo path as an argument
gultron --repo "/path/to/your/repo" --generate

Now you're ready to use Gultron!

Usage

After installation, you can use the command-line interface (CLI) to generate commit messages.

Basic Usage

To generate a commit message based on the latest changes in your repository:

gultron --repo "/path/to/your/repo" --generate

Use Staged Changes

If you want to generate a commit message based on the staged changes:

gultron --repo "/path/to/your/repo" --cached

Set an API Key

You can provide your API key directly via the --api-key option:

gultron --repo "/path/to/your/repo" --api-key "your_api_key"

Alternatively, you can set the API key as an environment variable:

export API_KEY="your_api_key"
gultron --repo "/path/to/your/repo"

If no API key is provided, a default API key will be used.

Copy the Commit Message to Clipboard

To copy the generated commit message to your clipboard, use the --copy flag:

gultron --repo "/path/to/your/repo" --copy

This requires the installation of xclip (on Linux systems). If it's not installed, Gultron will attempt to install it automatically.

Regenerate a Commit Message

To regenerate the commit message, you can use the --regenerate flag, which will generate a new commit message based on the latest changes.

gultron --repo "/path/to/your/repo" --regenerate

Configuration

Gultron uses a .env file to configure certain settings. You can modify the following settings:

  • API_KEY: Your Gemini AI API key.
  • MODEL_NAME: The AI model to use for commit message generation (e.g., gemini-1.5-flash).

Contributing

We welcome contributions to Gultron! If you find a bug or want to suggest a new feature, please open an issue or submit a pull request.

  1. Fork the repository.
  2. Create a new branch for your feature (git checkout -b feature-name).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-name).
  5. Create a new pull request.

License

Gultron is open-source software licensed under the MIT License. See the LICENSE file for more details.

Release files for gultron 1.2.2

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

Source distribution (sdist)

Source distribution for gultron 1.2.2
File Size Uploaded
gultron-1.2.2.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gultron 1.2.2
File Interpreter ABI Platform
gultron-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 14.5 kB

Release files / gultron-1.2.2.tar.gz

Download URL gultron-1.2.2.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
41bfe3c8e0667e1befeb2d1baf847c0322c513142695d52e90dad8dc5fdfff6f
BLAKE2b-256 checksum
How to use checksums
d94010878bffc9a3cf98beced25f2f27aa021dad1f4d85d116db4128b6ac3fe6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.3 Linux/6.8.0-51-generic

Release files / gultron-1.2.2-py3-none-any.whl

Download URL gultron-1.2.2-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9333a5c80fe5200ea0e1d80f8c2578124ad99b462f574f36e65c473a71aec60a
BLAKE2b-256 checksum
How to use checksums
f7bbc06b9cb3fe76d3b9b8947b89fed2f9cd38e39e2df863a31b75cf51edbfbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.4 CPython/3.12.3 Linux/6.8.0-51-generic

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.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