Metadata-Version: 2.4
Name: gen-commit
Version: 0.8.7
Summary: Auto-generate git commit messages
Project-URL: Homepage, https://github.com/raghavpillai/gen-commit
Project-URL: Issues, https://github.com/raghavpillai/gen-commit/issues
Author-email: Raghav Pillai <raghav@tryspeck.com>
License: MIT License
        
        Copyright (c) 2024 Raghav Pillai
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.11
Requires-Dist: aiohttp
Requires-Dist: anthropic
Requires-Dist: instructor
Requires-Dist: openai
Requires-Dist: tiktoken
Requires-Dist: tomli
Description-Content-Type: text/markdown

# Gen Commit

**Gen Commit** uses LLMs to automatically generate git commit messages. I'm lazy and don't like to write commit messages. Inspired by [scommit](https://github.com/Globe-Engineer/semantic-commit).

<p align="center">
  <img src="assets/logs.png" alt="Wow!" width="300" height="auto">
</p>

---

## Usage

**gencommit** works exactly like git commit, but it generates the commit message and description for you.

```bash
gencommit
```

is the same as

```bash
git commit -m "..." -m "..."
```

but with a generated commit message.

You can also pass in the same arguments as git commit.

```bash
gencommit -a
```

is the same as

```bash
git commit -a -m "..." -m "..."
```

I recommend aliasing it, personally I alias it to `gc`. You can do this by adding the following to your shell configuration file (`.zshrc`, `.bashrc`, etc.)

```bash
alias gc="gencommit"
```

## Installation

### Recommended: Homebrew (macOS and Linux)

```bash
brew tap raghavpillai/gen-commit
brew install gen-commit
```

### Python

#### Prerequisites:

- Python 3.11+

Install the gen-commit package using pip:

```bash
pip install gen-commit
```

If you get

```bash
error: externally-managed-environment
```

This means Python now doesn't want you to install this as a system-wide package. You can install it using `pipx` or `venv`, or be lazy and install it via:

```bash
pip3 install gen-commit --break-system-packages
```

### Initialization

Once you have it installed, initialize gencommit

```bash
gencommit --init
```

Go to `~/.gen-commit` and add your OpenAI or Anthropic API key.

### Configuration

```bash
MODEL=<provider:model (i.e. openai:gpt-4o or anthropic:claude-3-5-sonnet-20241022)>
OPENAI_API_KEY=<your openai api key>
ANTHROPIC_API_KEY=<your anthropic api key>
```

OPTIONAL:

```
MAX_LINE_LENGTH=<number>
MAX_TOKENS_ALLOWED=<number>
```

At the moment only OpenAI and Anthropic are supported.
