# AI Message Generator for Git
[![PyPI version](https://badge.fury.io/py/aimsg.svg)](https://badge.fury.io/py/aimsg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.7+](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/)
A CLI tool that generates commit messages using AI models based on your git repository changes.
## Features
- 🤖 Wide Model Support: OpenAI, Anthropic, Google, Chinese models, and more
- 🔧 Custom Model Integration
- 📝 Conventional Commits Format
- 🎯 Customizable Prompt Templates
- 🔑 Secure Configuration Management
## Installation
### Using pipx (Recommended)
```bash
# Install pipx if you haven't
brew install pipx
pipx ensurepath
# Install aimsg
pipx install aimsg
```
### Using pip
```bash
pip install aimsg
```
## Quick Start
1. Initialize with your preferred model and API key:
```bash
aimsg init
```
2. Stage your changes and generate commit message:
```bash
git add .
aimsg commit
```
3. Get help or version information:
```bash
# Show version
aimsg --version
# Show all available commands
aimsg --help
# Show help for a specific command
aimsg model --help
aimsg commit --help
```
## Configuration
Configure `aimsg` in order of priority:
1. Project-level `.env` file (highest priority)
```bash
AIMSG_API_KEY=your_api_key
AIMSG_API_BASE=your_api_base
AIMSG_MODEL=your_model
```
2. Environment variables
```bash
export AIMSG_API_KEY=your_api_key
export AIMSG_API_BASE=your_api_base
export AIMSG_MODEL=your_model
```
3. Global configuration via `aimsg init` (lowest priority, default)
```bash
# Creates ~/.config/aimsg/config.json with default settings:
# - model: gpt-3.5-turbo
# - api_base: https://api.openai.com/v1
aimsg init
```
## Model Management
```bash
# List available models
aimsg model list
# Add custom model
aimsg model add my-model model-id https://api.example.com/v1
# Remove custom model
aimsg model remove my-model
```
## Prompt Management
```bash
# Customize commit message prompt template
aimsg prompt
# Reset to default prompt template
aimsg reset-prompt
```
The default prompt template guides the AI to:
- Follow conventional commits format
- Focus on the "what" and "why" of changes
- Keep the first line under 72 characters
- Add detailed description when necessary
## Default API Endpoints
### Major Providers
- OpenAI: `https://api.openai.com/v1`
- Anthropic: `https://api.anthropic.com/v1`
- Google: `https://generativelanguage.googleapis.com/v1`
### Chinese Providers
- DeepSeek: `https://api.deepseek.com/v1`
- Aliyun: `https://dashscope.aliyuncs.com/api/v1`
- iFlytek: `https://spark-api.xf-yun.com/v3.1`
- Zhipu: `https://open.bigmodel.cn/api/v1`
- Baidu: `https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop`
- Moonshot: `https://api.moonshot.cn/v1`
- Tencent: `https://hunyuan.cloud.tencent.com/hyllm/v1`
- ByteDance: `https://api.doubao.com/v1`
### Hosted Services
- Replicate: `https://api.replicate.com/v1`
- Together AI: `https://api.together.xyz/v1`
## License
MIT
Raw data
{
"_id": null,
"home_page": "https://github.com/yurentle/aimsg",
"name": "aimsg",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "git, commit, message, openai, gpt, cli, ai, deepseek",
"author": "yurentle",
"author_email": "yurentle <yurentle@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/de/bb/bd5dfbf4c489244a257322d3b6937f4460ae05e3ed8d46911e00ba4765f5/aimsg-0.2.0.tar.gz",
"platform": null,
"description": "# AI Message Generator for Git\n\n[![PyPI version](https://badge.fury.io/py/aimsg.svg)](https://badge.fury.io/py/aimsg)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.7+](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/)\n\nA CLI tool that generates commit messages using AI models based on your git repository changes.\n\n## Features\n\n- \ud83e\udd16 Wide Model Support: OpenAI, Anthropic, Google, Chinese models, and more\n- \ud83d\udd27 Custom Model Integration\n- \ud83d\udcdd Conventional Commits Format\n- \ud83c\udfaf Customizable Prompt Templates\n- \ud83d\udd11 Secure Configuration Management\n\n## Installation\n\n### Using pipx (Recommended)\n```bash\n# Install pipx if you haven't\nbrew install pipx\npipx ensurepath\n\n# Install aimsg\npipx install aimsg\n```\n\n### Using pip\n```bash\npip install aimsg\n```\n\n## Quick Start\n\n1. Initialize with your preferred model and API key:\n```bash\naimsg init\n```\n\n2. Stage your changes and generate commit message:\n```bash\ngit add .\naimsg commit\n```\n\n3. Get help or version information:\n```bash\n# Show version\naimsg --version\n\n# Show all available commands\naimsg --help\n\n# Show help for a specific command\naimsg model --help\naimsg commit --help\n```\n\n## Configuration\n\nConfigure `aimsg` in order of priority:\n\n1. Project-level `.env` file (highest priority)\n```bash\nAIMSG_API_KEY=your_api_key\nAIMSG_API_BASE=your_api_base\nAIMSG_MODEL=your_model\n```\n\n2. Environment variables\n```bash\nexport AIMSG_API_KEY=your_api_key\nexport AIMSG_API_BASE=your_api_base\nexport AIMSG_MODEL=your_model\n```\n\n3. Global configuration via `aimsg init` (lowest priority, default)\n```bash\n# Creates ~/.config/aimsg/config.json with default settings:\n# - model: gpt-3.5-turbo\n# - api_base: https://api.openai.com/v1\naimsg init\n```\n\n## Model Management\n\n```bash\n# List available models\naimsg model list\n\n# Add custom model\naimsg model add my-model model-id https://api.example.com/v1\n\n# Remove custom model\naimsg model remove my-model\n```\n\n## Prompt Management\n\n```bash\n# Customize commit message prompt template\naimsg prompt\n\n# Reset to default prompt template\naimsg reset-prompt\n```\n\nThe default prompt template guides the AI to:\n- Follow conventional commits format\n- Focus on the \"what\" and \"why\" of changes\n- Keep the first line under 72 characters\n- Add detailed description when necessary\n\n## Default API Endpoints\n\n### Major Providers\n- OpenAI: `https://api.openai.com/v1`\n- Anthropic: `https://api.anthropic.com/v1`\n- Google: `https://generativelanguage.googleapis.com/v1`\n\n### Chinese Providers\n- DeepSeek: `https://api.deepseek.com/v1`\n- Aliyun: `https://dashscope.aliyuncs.com/api/v1`\n- iFlytek: `https://spark-api.xf-yun.com/v3.1`\n- Zhipu: `https://open.bigmodel.cn/api/v1`\n- Baidu: `https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop`\n- Moonshot: `https://api.moonshot.cn/v1`\n- Tencent: `https://hunyuan.cloud.tencent.com/hyllm/v1`\n- ByteDance: `https://api.doubao.com/v1`\n\n### Hosted Services\n- Replicate: `https://api.replicate.com/v1`\n- Together AI: `https://api.together.xyz/v1`\n\n## License\n\nMIT\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A CLI tool to generate commit messages using AI models",
"version": "0.2.0",
"project_urls": {
"Bug Tracker": "https://github.com/yurentle/aimsg/issues",
"Homepage": "https://github.com/yurentle/aimsg",
"Repository": "https://github.com/yurentle/aimsg.git"
},
"split_keywords": [
"git",
" commit",
" message",
" openai",
" gpt",
" cli",
" ai",
" deepseek"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d91eba0e5fa5f78e2da45eb9c1541396e5c7cb7ea14d8615014047d0562b0c6e",
"md5": "c179177a1322ef53e6c63e2fc2858035",
"sha256": "4ab963169b05ac194849c658a6aa6e0186649214c2ed49ad4091ff95b3c12197"
},
"downloads": -1,
"filename": "aimsg-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c179177a1322ef53e6c63e2fc2858035",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 14418,
"upload_time": "2025-01-10T10:19:36",
"upload_time_iso_8601": "2025-01-10T10:19:36.864681Z",
"url": "https://files.pythonhosted.org/packages/d9/1e/ba0e5fa5f78e2da45eb9c1541396e5c7cb7ea14d8615014047d0562b0c6e/aimsg-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "debbbd5dfbf4c489244a257322d3b6937f4460ae05e3ed8d46911e00ba4765f5",
"md5": "59a2da065a58ab5243bbd286bd5de32a",
"sha256": "8245d61c2688ee1c2fae4eb2d5db66bef276e2336af8eaaa12f8e39d290b09fe"
},
"downloads": -1,
"filename": "aimsg-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "59a2da065a58ab5243bbd286bd5de32a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 13844,
"upload_time": "2025-01-10T10:19:38",
"upload_time_iso_8601": "2025-01-10T10:19:38.496437Z",
"url": "https://files.pythonhosted.org/packages/de/bb/bd5dfbf4c489244a257322d3b6937f4460ae05e3ed8d46911e00ba4765f5/aimsg-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-10 10:19:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yurentle",
"github_project": "aimsg",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "openai",
"specs": [
[
">=",
"1.0.0"
]
]
},
{
"name": "gitpython",
"specs": [
[
">=",
"3.1.40"
]
]
},
{
"name": "python-dotenv",
"specs": [
[
">=",
"1.0.0"
]
]
},
{
"name": "click",
"specs": [
[
">=",
"8.1.7"
]
]
}
],
"lcname": "aimsg"
}