commity


Namecommity JSON
Version 0.1.11 PyPI version JSON
download
home_pageNone
SummaryGenerate intelligent Git commit messages with AI. Supports Conventional Commits, emoji, and multiple LLM providers like OpenAI, Ollama, and Gemini.
upload_time2025-08-16 05:27:07
maintainerNone
docs_urlNone
authorfreboe, skyci
requires_python>=3.12
licenseNone
keywords ai commit commity conventional-commits gemini git llm message ollama openai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🤖 commity

[![PyPI version](https://img.shields.io/pypi/v/commity.svg)](https://pypi.org/project/commity)
[![Python versions](https://img.shields.io/pypi/pyversions/commity.svg)](https://pypi.org/project/commity)
[![License](https://img.shields.io/pypi/l/commity.svg?cacheSeconds=0)](https://github.com/freboe/commity/blob/main/LICENSE)

[![English](https://img.shields.io/badge/Language-English-blue.svg)](https://github.com/freboe/commity/blob/main/README.md) | [![įŽ€äŊ“中文](https://img.shields.io/badge/Language-įŽ€äŊ“中文-blue.svg)](https://github.com/freboe/commity/blob/main/README.zh.md)

Generate intelligent Git commit messages with AI. Supports Conventional Commits, emoji, and multiple LLM providers like OpenAI, Ollama, and Gemini.

## 🤔 What is Commity?

**Commity** is an open-source, AI-powered Git commit message generation tool. It analyzes your staged code changes and automatically generates commit messages that follow the [**Conventional Commits**](https://www.conventionalcommits.org/) specification, and can even add emojis for you!

With a simple `commity --emoji` command, you can get a professional and clear commit message like this:

```
feat(api): ✨ add user authentication endpoint
```

## 🔧 Installation

Install with `pip`:

```bash
pip install commity
```

Or install with `uv`:

```bash
uv tool install commity
```

## âš™ī¸ Configuration

`commity` supports three configuration methods, with the following priority: **Command-line Arguments > Environment
Variables > Configuration File**.

Supported model providers are: `Gemini` (default), `Ollama`, `OpenAI`.

### ✨ Method 1: Specify Model Parameters via Command-line

#### OpenAI

```Bash
commity --provider openai --model gpt-3.5-turbo --api_key <your-api-key>
```

#### Ollama

```Bash
commity --provider ollama --model llama2 --base_url http://localhost:11434
```

#### Gemini

```Bash
commity --provider gemini --model gemini-2.5-flash --base_url https://generativelanguage.googleapis.com --api_key <your-api-key> --timeout 30
```

or

```Bash
commity \
--provider gemini \
--model gemini-2.5-flash \
--base_url https://generativelanguage.googleapis.com \
--api_key <your-api-key> \
--timeout 30 \
```

### 🌱 Method 2: Set Environment Variables as Defaults

You can add the following to your `.bashrc`, `.zshrc`, or `.env` file:

#### OpenAI

```Bash
export COMMITY_PROVIDER=openai
export COMMITY_MODEL=gpt-3.5-turbo
export COMMITY_API_KEY=your-api-key
```

#### Ollama

```Bash
export COMMITY_PROVIDER=ollama
export COMMITY_MODEL=llama2
export COMMITY_BASE_URL=http://localhost:11434
```

#### Gemini

```Bash
export COMMITY_PROVIDER=gemini
export COMMITY_MODEL=gemini-2.5-flash
export COMMITY_BASE_URL=https://generativelanguage.googleapis.com
export COMMITY_API_KEY=your-api-key
export COMMITY_TEMPERATURE=0.5
```

### 📝 Method 3: Use a Configuration File (Recommended)

For easier configuration management, you can create a `~/.commity/config.json` file in your user's home directory.

1. Create the directory:

   ```bash
   mkdir -p ~/.commity
   ```

2. Create and edit the `config.json` file:

   ```bash
   touch ~/.commity/config.json
   ```

3. Add your configuration to `config.json`, for example:

   ```json
   {
     "PROVIDER": "ollama",
     "MODEL": "llama3",
     "BASE_URL": "http://localhost:11434"
   }
   ```

   Or using Gemini:

   ```json
   {
     "PROVIDER": "gemini",
     "MODEL": "gemini-1.5-flash",
     "BASE_URL": "https://generativelanguage.googleapis.com",
     "API_KEY": "your-gemini-api-key"
   }
   ```

   Or using OpenAI:

   ```json
   {
     "PROVIDER": "openai",
     "MODEL": "gpt-3.5-turbo",
     "API_KEY": "your-openai-api-key"
   }
   ```

## 🚀 Usage

```Bash
# Run
commity

# View help
commity --help

# Use Chinese
commity --lang zh

# Include emojis
commity --emoji

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "commity",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "ai, commit, commity, conventional-commits, gemini, git, llm, message, ollama, openai",
    "author": "freboe, skyci",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/e1/ef/f76370776653433f44cd2d433e54a9c6e968a58207584677ff20b8550bd2/commity-0.1.11.tar.gz",
    "platform": null,
    "description": "# \ud83e\udd16 commity\n\n[![PyPI version](https://img.shields.io/pypi/v/commity.svg)](https://pypi.org/project/commity)\n[![Python versions](https://img.shields.io/pypi/pyversions/commity.svg)](https://pypi.org/project/commity)\n[![License](https://img.shields.io/pypi/l/commity.svg?cacheSeconds=0)](https://github.com/freboe/commity/blob/main/LICENSE)\n\n[![English](https://img.shields.io/badge/Language-English-blue.svg)](https://github.com/freboe/commity/blob/main/README.md) | [![\u7b80\u4f53\u4e2d\u6587](https://img.shields.io/badge/Language-\u7b80\u4f53\u4e2d\u6587-blue.svg)](https://github.com/freboe/commity/blob/main/README.zh.md)\n\nGenerate intelligent Git commit messages with AI. Supports Conventional Commits, emoji, and multiple LLM providers like OpenAI, Ollama, and Gemini.\n\n## \ud83e\udd14 What is Commity?\n\n**Commity** is an open-source, AI-powered Git commit message generation tool. It analyzes your staged code changes and automatically generates commit messages that follow the [**Conventional Commits**](https://www.conventionalcommits.org/) specification, and can even add emojis for you!\n\nWith a simple `commity --emoji` command, you can get a professional and clear commit message like this:\n\n```\nfeat(api): \u2728 add user authentication endpoint\n```\n\n## \ud83d\udd27 Installation\n\nInstall with `pip`:\n\n```bash\npip install commity\n```\n\nOr install with `uv`:\n\n```bash\nuv tool install commity\n```\n\n## \u2699\ufe0f Configuration\n\n`commity` supports three configuration methods, with the following priority: **Command-line Arguments > Environment\nVariables > Configuration File**.\n\nSupported model providers are: `Gemini` (default), `Ollama`, `OpenAI`.\n\n### \u2728 Method 1: Specify Model Parameters via Command-line\n\n#### OpenAI\n\n```Bash\ncommity --provider openai --model gpt-3.5-turbo --api_key <your-api-key>\n```\n\n#### Ollama\n\n```Bash\ncommity --provider ollama --model llama2 --base_url http://localhost:11434\n```\n\n#### Gemini\n\n```Bash\ncommity --provider gemini --model gemini-2.5-flash --base_url https://generativelanguage.googleapis.com --api_key <your-api-key> --timeout 30\n```\n\nor\n\n```Bash\ncommity \\\n--provider gemini \\\n--model gemini-2.5-flash \\\n--base_url https://generativelanguage.googleapis.com \\\n--api_key <your-api-key> \\\n--timeout 30 \\\n```\n\n### \ud83c\udf31 Method 2: Set Environment Variables as Defaults\n\nYou can add the following to your `.bashrc`, `.zshrc`, or `.env` file:\n\n#### OpenAI\n\n```Bash\nexport COMMITY_PROVIDER=openai\nexport COMMITY_MODEL=gpt-3.5-turbo\nexport COMMITY_API_KEY=your-api-key\n```\n\n#### Ollama\n\n```Bash\nexport COMMITY_PROVIDER=ollama\nexport COMMITY_MODEL=llama2\nexport COMMITY_BASE_URL=http://localhost:11434\n```\n\n#### Gemini\n\n```Bash\nexport COMMITY_PROVIDER=gemini\nexport COMMITY_MODEL=gemini-2.5-flash\nexport COMMITY_BASE_URL=https://generativelanguage.googleapis.com\nexport COMMITY_API_KEY=your-api-key\nexport COMMITY_TEMPERATURE=0.5\n```\n\n### \ud83d\udcdd Method 3: Use a Configuration File (Recommended)\n\nFor easier configuration management, you can create a `~/.commity/config.json` file in your user's home directory.\n\n1. Create the directory:\n\n   ```bash\n   mkdir -p ~/.commity\n   ```\n\n2. Create and edit the `config.json` file:\n\n   ```bash\n   touch ~/.commity/config.json\n   ```\n\n3. Add your configuration to `config.json`, for example:\n\n   ```json\n   {\n     \"PROVIDER\": \"ollama\",\n     \"MODEL\": \"llama3\",\n     \"BASE_URL\": \"http://localhost:11434\"\n   }\n   ```\n\n   Or using Gemini:\n\n   ```json\n   {\n     \"PROVIDER\": \"gemini\",\n     \"MODEL\": \"gemini-1.5-flash\",\n     \"BASE_URL\": \"https://generativelanguage.googleapis.com\",\n     \"API_KEY\": \"your-gemini-api-key\"\n   }\n   ```\n\n   Or using OpenAI:\n\n   ```json\n   {\n     \"PROVIDER\": \"openai\",\n     \"MODEL\": \"gpt-3.5-turbo\",\n     \"API_KEY\": \"your-openai-api-key\"\n   }\n   ```\n\n## \ud83d\ude80 Usage\n\n```Bash\n# Run\ncommity\n\n# View help\ncommity --help\n\n# Use Chinese\ncommity --lang zh\n\n# Include emojis\ncommity --emoji\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Generate intelligent Git commit messages with AI. Supports Conventional Commits, emoji, and multiple LLM providers like OpenAI, Ollama, and Gemini.",
    "version": "0.1.11",
    "project_urls": {
        "Documentation": "https://github.com/freboe/commity/blob/main/README.md",
        "Homepage": "https://github.com/freboe/commity",
        "Source": "https://github.com/freboe/commity",
        "Tracker": "https://github.com/freboe/commity/issues"
    },
    "split_keywords": [
        "ai",
        " commit",
        " commity",
        " conventional-commits",
        " gemini",
        " git",
        " llm",
        " message",
        " ollama",
        " openai"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b4af509aee687a0a2d1f4d5cd471a45ce4913855e15e5d0d493ce42bca603616",
                "md5": "970b8579eba9d0a15195055c042d5332",
                "sha256": "9b998c7addb1ef1047638dabb20286951dda969ba06a04c80d1f08f3d3a3f434"
            },
            "downloads": -1,
            "filename": "commity-0.1.11-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "970b8579eba9d0a15195055c042d5332",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 22430,
            "upload_time": "2025-08-16T05:27:06",
            "upload_time_iso_8601": "2025-08-16T05:27:06.129521Z",
            "url": "https://files.pythonhosted.org/packages/b4/af/509aee687a0a2d1f4d5cd471a45ce4913855e15e5d0d493ce42bca603616/commity-0.1.11-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e1eff76370776653433f44cd2d433e54a9c6e968a58207584677ff20b8550bd2",
                "md5": "206db9fa9c8ec49b2385fc74d47a1c72",
                "sha256": "2fe19f452f4aa7f789518001d3126a5960fea7d5c346c8c11a270e85ea4f8492"
            },
            "downloads": -1,
            "filename": "commity-0.1.11.tar.gz",
            "has_sig": false,
            "md5_digest": "206db9fa9c8ec49b2385fc74d47a1c72",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 64526,
            "upload_time": "2025-08-16T05:27:07",
            "upload_time_iso_8601": "2025-08-16T05:27:07.645660Z",
            "url": "https://files.pythonhosted.org/packages/e1/ef/f76370776653433f44cd2d433e54a9c6e968a58207584677ff20b8550bd2/commity-0.1.11.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-16 05:27:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "freboe",
    "github_project": "commity",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "commity"
}
        
Elapsed time: 1.06663s