Skip to main content

A tool for streamlined commit messaging using AI

Project description

Cactus: AI-Powered Commit Message Generator

Cactus is an innovative command-line tool that leverages AI to automate and enhance the process of creating Git commit messages. By analyzing staged changes, Cactus generates meaningful, conventional commit messages, streamlining your version control workflow.

Features

  • AI-Powered Commit Generation: Utilizes OpenAI's GPT models or Google's Gemini models to analyze code changes and generate appropriate commit messages.
  • Customizable Commit Grouping: Allows specifying the number of commits to generate, intelligently grouping related changes.
  • Interactive Changelog Creation: Generates comprehensive changelogs between specified Git commits.
  • Multi-Model Support: Compatible with various AI models, including GPT-3.5, GPT-4, and Gemini.
  • Conventional Commits: Adheres to the Conventional Commits standard for consistent, readable commit histories.

Installation

Install Cactus using pip:

$ pip install cactus-commit

Set up your API key(s):

$ cactus setup OpenAI  # For OpenAI API
# or
$ cactus setup Gemini  # For Google Gemini API

Usage

Generate Commit Messages

Add the files you want to create commits for to the staging area:

$ git add myfile1.py myfile2.py

Anything left unstaged will be ignored when generating commit messages.

Run cactus to generate commit messages:

$ cactus

If you want to force a specific number of commits, pass the number as an argument:

cactus 3 # Will generate 3 commits

Create a Changelog

cactus changelog [SHA] [-p PATHSPEC]
  • SHA: The starting commit hash for the changelog.

Additional Options

  • -d, --debug: Enable debug logging.
  • -c, --context-size: Set the context size for git diff (default: 1).
  • -m, --model: Specify the AI model to use (e.g., "gpt-4", "gemini-1.5-pro").

How It Works

  1. Cactus analyzes staged Git changes.
  2. It uses AI to understand the context and significance of the changes.
  3. Based on the analysis, it generates commit messages or changelogs.
  4. Users can interactively accept, regenerate, or adjust the number of commits.

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

cactus_commit-4.1.2.tar.gz (756.8 kB view details)

Uploaded Source

Built Distribution

cactus_commit-4.1.2-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file cactus_commit-4.1.2.tar.gz.

File metadata

  • Download URL: cactus_commit-4.1.2.tar.gz
  • Upload date:
  • Size: 756.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for cactus_commit-4.1.2.tar.gz
Algorithm Hash digest
SHA256 917d0555052fdc0f6473b88d7e12d250c19ca327ba66863a8c1eee0a08ecc9b9
MD5 4558f162960d1b962bf1634d59804581
BLAKE2b-256 f905ce2ef7e268758e10f7578a32a0b9fe4c120ba3ecbb235cb3b9d9fe7421f1

See more details on using hashes here.

File details

Details for the file cactus_commit-4.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for cactus_commit-4.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5ae1648b3e8de418b817356e38c4a5775b9a929037c82984b7cb5d0648d989a1
MD5 e7cb09a19be36fb9c8076dd9c7e7dafe
BLAKE2b-256 8d8195f283d7b6a5c98664b76bf3184612d242b396aaa545064a644e71d4a593

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page