ai-gen-commit


Nameai-gen-commit JSON
Version 0.0.10 PyPI version JSON
download
home_pageNone
SummaryAI generated commit messages!
upload_time2025-02-17 04:15:47
maintainerNone
docs_urlNone
authorYankee Maharjan
requires_python>=3.10
licenseNone
keywords ai commit commit ai ai generated commit llm commit generative ai commit
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## 🐙 AI Commit Generator

Use AI to generate commit message for your staged changes.

<a href="https://youtu.be/1y2TohQdNbo">
<img src="https://i.imgur.com/cwdzCUw.gif" width="800">
</a>


## ⚡️ Features

- Use local models (via Ollama) or remote models (with OpenAI API compatible providers like:  `openai`, `groq`, `gemini`, `togetherai`, `deepseek`, `qwen`) or your [custom provider](#-bring-your-own-provider).
- Regenerate commit messages until you find the perfect one
- In-place editing of generated commit
- Define your custom commit message format
- Simple CLI interface with debug mode

## ⚡️ Install

```sh
pip install ai-gen-commit
```

## ✨ Generate Commit messages

In any git directory with staged changes, run:

```sh
aic
```

### 🔍 Run in debug mode

```sh
aic -d
```
### 🦙 Local Mode [Specify model to use]

```sh
aic -m <model-name>

aic -m "llama3.2:3b"

# OR

export OLLAMA_MODEL="llama3.2:3b"
```

### 🛜 Remote Mode

To run in remote mode, export your API keys as:

```sh
export OPENAI_API_KEY=<your-api-key>
```

Specify which remote provider to use:

```sh
export AI_COMMIT_PROVIDER="gemini" or "openai" or "togetherai" or "groq" or "deepseek"
```

then enable remote mode:

```sh
aic -r
```

Specify the model to use based on the provider:

```sh
export AI_COMMIT_PROVIDER="groq"
export AI_COMMIT_MODEL="qwen-2.5-32b" # pass the model as env var
aic -r

# ---

export AI_COMMIT_PROVIDER="openai"
aic -r -m "gpt-4o-2024-11-20" # pass the model as flag

# ---

export AI_COMMIT_PROVIDER="gemini"
aic -r -m "gemini-1.5-flash"
```

### ✨ Bring your own Provider

You can use any OPEN AI compatible provider/server for commit generation.

```sh
export AI_COMMIT_PROVIDER=custom # should be set to custom
export AI_COMMIT_MODEL=llama3.2:3b # example
export AI_COMMIT_PROVIDER_BASE_URL=http://localhost:11434/v1 # example
export OPENAI_API_KEY=<your-api-key> # if your custom provider requires one
```

### 📝 In-place Editing

[🎥 Watch the Demo](https://www.linkedin.com/feed/update/urn:li:activity:7293488744391675905/)

Set your editor environment variable:

```sh
export EDITOR=vim
export EDITOR=nvim

# For VSCode
export EDITOR='code --wait'
```

After commit message is generated, press `e` to edit using the defined `$EDITOR`.

Defaults to using `vi`.

### 🤖 Custom commit message format

Users can generate commit messages based on the format and instructions defined in the system prompt.

**To define system prompt on project level**

1. Create a `.ai-commit` file in your git repository's root directory (same location as the `.git` folder)
2. Add your system prompt to this file

**To define a global system prompt**

1. Create a file on `~/.$HOME/.ai-commit`
2. Add your system prompt to this file

| Project-level System Prompt > Global System Prompt >  [Built-in system prompt](https://github.com/yankeexe/ai-gen-commit/blob/5c8b6374752a84046d8ce5d5a78fe0481ce1362d/ai_commit/prompts.py#L3-L29).

## Getting Help

```sh
aic -h
```

## 🔨 Development

### 👀 Prerequisites Local mode [default]

- [ollama](https://ollama.dev/download)


### 🚀 Setting up

```sh
make setup
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ai-gen-commit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "ai commit, commit ai, ai generated commit, llm commit, generative ai commit",
    "author": "Yankee Maharjan",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/47/57/e2b06237e3f6ce381a0edd05295ea7bc8f19fd2b020758eb485b65510216/ai_gen_commit-0.0.10.tar.gz",
    "platform": null,
    "description": "## \ud83d\udc19 AI Commit Generator\n\nUse AI to generate commit message for your staged changes.\n\n<a href=\"https://youtu.be/1y2TohQdNbo\">\n<img src=\"https://i.imgur.com/cwdzCUw.gif\" width=\"800\">\n</a>\n\n\n## \u26a1\ufe0f Features\n\n- Use local models (via Ollama) or remote models (with OpenAI API compatible providers like:  `openai`, `groq`, `gemini`, `togetherai`, `deepseek`, `qwen`) or your [custom provider](#-bring-your-own-provider).\n- Regenerate commit messages until you find the perfect one\n- In-place editing of generated commit\n- Define your custom commit message format\n- Simple CLI interface with debug mode\n\n## \u26a1\ufe0f Install\n\n```sh\npip install ai-gen-commit\n```\n\n## \u2728 Generate Commit messages\n\nIn any git directory with staged changes, run:\n\n```sh\naic\n```\n\n### \ud83d\udd0d Run in debug mode\n\n```sh\naic -d\n```\n### \ud83e\udd99 Local Mode [Specify model to use]\n\n```sh\naic -m <model-name>\n\naic -m \"llama3.2:3b\"\n\n# OR\n\nexport OLLAMA_MODEL=\"llama3.2:3b\"\n```\n\n### \ud83d\udedc Remote Mode\n\nTo run in remote mode, export your API keys as:\n\n```sh\nexport OPENAI_API_KEY=<your-api-key>\n```\n\nSpecify which remote provider to use:\n\n```sh\nexport AI_COMMIT_PROVIDER=\"gemini\" or \"openai\" or \"togetherai\" or \"groq\" or \"deepseek\"\n```\n\nthen enable remote mode:\n\n```sh\naic -r\n```\n\nSpecify the model to use based on the provider:\n\n```sh\nexport AI_COMMIT_PROVIDER=\"groq\"\nexport AI_COMMIT_MODEL=\"qwen-2.5-32b\" # pass the model as env var\naic -r\n\n# ---\n\nexport AI_COMMIT_PROVIDER=\"openai\"\naic -r -m \"gpt-4o-2024-11-20\" # pass the model as flag\n\n# ---\n\nexport AI_COMMIT_PROVIDER=\"gemini\"\naic -r -m \"gemini-1.5-flash\"\n```\n\n### \u2728 Bring your own Provider\n\nYou can use any OPEN AI compatible provider/server for commit generation.\n\n```sh\nexport AI_COMMIT_PROVIDER=custom # should be set to custom\nexport AI_COMMIT_MODEL=llama3.2:3b # example\nexport AI_COMMIT_PROVIDER_BASE_URL=http://localhost:11434/v1 # example\nexport OPENAI_API_KEY=<your-api-key> # if your custom provider requires one\n```\n\n### \ud83d\udcdd In-place Editing\n\n[\ud83c\udfa5 Watch the Demo](https://www.linkedin.com/feed/update/urn:li:activity:7293488744391675905/)\n\nSet your editor environment variable:\n\n```sh\nexport EDITOR=vim\nexport EDITOR=nvim\n\n# For VSCode\nexport EDITOR='code --wait'\n```\n\nAfter commit message is generated, press `e` to edit using the defined `$EDITOR`.\n\nDefaults to using `vi`.\n\n### \ud83e\udd16 Custom commit message format\n\nUsers can generate commit messages based on the format and instructions defined in the system prompt.\n\n**To define system prompt on project level**\n\n1. Create a `.ai-commit` file in your git repository's root directory (same location as the `.git` folder)\n2. Add your system prompt to this file\n\n**To define a global system prompt**\n\n1. Create a file on `~/.$HOME/.ai-commit`\n2. Add your system prompt to this file\n\n| Project-level System Prompt > Global System Prompt >  [Built-in system prompt](https://github.com/yankeexe/ai-gen-commit/blob/5c8b6374752a84046d8ce5d5a78fe0481ce1362d/ai_commit/prompts.py#L3-L29).\n\n## Getting Help\n\n```sh\naic -h\n```\n\n## \ud83d\udd28 Development\n\n### \ud83d\udc40 Prerequisites Local mode [default]\n\n- [ollama](https://ollama.dev/download)\n\n\n### \ud83d\ude80 Setting up\n\n```sh\nmake setup\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "AI generated commit messages!",
    "version": "0.0.10",
    "project_urls": {
        "Repository": "https://github.com/yankeexe/ai-gen-commit"
    },
    "split_keywords": [
        "ai commit",
        " commit ai",
        " ai generated commit",
        " llm commit",
        " generative ai commit"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8be1665dc5a7e05d15a5d58520b3fb9ecfce752cc41ab10905be2751f82a4b96",
                "md5": "3b3d5005ec78cf892536611cce0e1c07",
                "sha256": "509b41f6d1c5058e8caca1e796305cb4063fcc7f848531dd7a6b6ef712d2db83"
            },
            "downloads": -1,
            "filename": "ai_gen_commit-0.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3b3d5005ec78cf892536611cce0e1c07",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 10291,
            "upload_time": "2025-02-17T04:15:46",
            "upload_time_iso_8601": "2025-02-17T04:15:46.244952Z",
            "url": "https://files.pythonhosted.org/packages/8b/e1/665dc5a7e05d15a5d58520b3fb9ecfce752cc41ab10905be2751f82a4b96/ai_gen_commit-0.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4757e2b06237e3f6ce381a0edd05295ea7bc8f19fd2b020758eb485b65510216",
                "md5": "1a3189c36bd866905bd588aaf228c630",
                "sha256": "1b6e7af7f14efc1ce6a6d8afa1cc34df73084d6e7f7d341566bdbebdd09f76f9"
            },
            "downloads": -1,
            "filename": "ai_gen_commit-0.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "1a3189c36bd866905bd588aaf228c630",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 8781,
            "upload_time": "2025-02-17T04:15:47",
            "upload_time_iso_8601": "2025-02-17T04:15:47.906330Z",
            "url": "https://files.pythonhosted.org/packages/47/57/e2b06237e3f6ce381a0edd05295ea7bc8f19fd2b020758eb485b65510216/ai_gen_commit-0.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-17 04:15:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yankeexe",
    "github_project": "ai-gen-commit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ai-gen-commit"
}
        
Elapsed time: 0.56119s