Skip to main content

A tool for streamlined commit messaging using AI

Project description

Cactus: AI-Powered Commit Message Generator

Cactus is an command-line tool that leverages AI to automate and enhance the process of creating Git commit messages. By analyzing staged changes, Cactus Automates Commits Through Uncomplicated Suggestions.

Demo

https://github.com/user-attachments/assets/bb3553db-78d5-42b1-888c-9e9e6a4edb77

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.6.1.tar.gz (279.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cactus_commit-4.6.1-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cactus_commit-4.6.1.tar.gz
  • Upload date:
  • Size: 279.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for cactus_commit-4.6.1.tar.gz
Algorithm Hash digest
SHA256 491b35c32bc62e0f172100c51625073f0451be1a88e411b2aa1b91bcbf4c5cf8
MD5 f2fa86129239a3883007e1c97ded5db1
BLAKE2b-256 a20baf5dbf70eeba126b6f1750c3a0e067a7deb93b2e6fbb6f149261c888fa95

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cactus_commit-4.6.1-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for cactus_commit-4.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d0e80417d28ab04359e113d7d1d816ea71490eef9df36f0c7ccd3ea17164ba9
MD5 ac13d7a9d29e4efcf130b7385470d610
BLAKE2b-256 ea0425a388dde9cb99e1a9ca2f85990e3fddac0b50daaa5f33f570e9bdcc50c5

See more details on using hashes here.

Supported by

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