Metadata-Version: 2.1
Name: cactus-commit
Version: 4.2.0
Summary: A tool for streamlined commit messaging using AI
Home-page: https://github.com/esauvisky/cactus
Author: @emi
Author-email: esauvisky@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scikit-learn
Requires-Dist: thefuzz
Requires-Dist: unidiff
Requires-Dist: openai
Requires-Dist: google-generativeai
Requires-Dist: tiktoken
Requires-Dist: loguru
Requires-Dist: inquirer>=3.4.0
Requires-Dist: prompt-toolkit>=3.0.48

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

## Demo

![Demo](demo.mp4)

## 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:

```shell
$ pip install cactus-commit
```

Set up your API key(s):

```shell
$ 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:

```shell
$ git add myfile1.py myfile2.py
```
> Anything left unstaged will be ignored when generating commit messages.

Run `cactus` to generate commit messages:

```shell
$ cactus
```

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

```shell
cactus 3 # Will generate 3 commits
```

### Create a Changelog

```sh
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.
