A CLI tool to generate commit messages using AI models
Project description
AI Message Generator for Git
A CLI tool that generates commit messages using AI models based on your git repository changes. It analyzes the staged changes in your git repository and uses AI models to generate meaningful and descriptive commit messages.
Features
- 🤖 Supports multiple AI models:
- DeepSeek Chat
- OpenAI GPT-3.5 Turbo
- OpenAI GPT-4
- Anthropic Claude-2
- Google PaLM 2
- Alibaba Qwen
- iFlytek Spark
- Baichuan
- Zhipu ChatGLM
- Baidu ERNIE
- Moonshot AI KIMI
- Tencent Hunyuan
- ByteDance Doubao
- Third-party Hosted Models:
- Llama 2 (by Replicate)
- Mistral (by Together AI)
- Mixtral (by Together AI)
- CodeLlama (by Replicate)
- 🔧 Supports custom models and API endpoints
- 📝 Follows conventional commits format
- 🔄 Handles dependency updates gracefully
- 🎯 Customizable prompt templates
- 🔑 Secure API key storage
- 🌐 Smart API endpoint management
- 📝 Clear and concise commit messages
Installation
pip install aimsg
Setup
Initialize the tool with your API key and preferred model:
aimsg init
This will guide you through:
- Selecting an AI model
- Entering your API key
- Configuring the API endpoint (if needed)
Each model has its default API endpoint:
OpenAI Models
- OpenAI GPT Models:
https://api.openai.com/v1
Anthropic Models
- Claude Models:
https://api.anthropic.com/v1
Google Models
- PaLM & Gemini:
https://generativelanguage.googleapis.com/v1
Chinese Models
- DeepSeek:
https://api.deepseek.com/v1 - Aliyun Qwen:
https://dashscope.aliyuncs.com/api/v1 - iFlytek Spark:
https://spark-api.xf-yun.com/v3.1 - Zhipu GLM:
https://open.bigmodel.cn/api/v1 - Baidu ERNIE:
https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop - Moonshot KIMI:
https://api.moonshot.cn/v1 - Tencent Hunyuan:
https://hunyuan.cloud.tencent.com/hyllm/v1 - ByteDance Doubao:
https://api.doubao.com/v1
Third-party Hosted Models
- Replicate:
https://api.replicate.com/v1 - Together AI:
https://api.together.xyz/v1
You can customize these endpoints during initialization or by using environment variables.
Usage
- Stage your changes:
git add .
- Generate commit message:
# Using default model (GPT-3.5)
aimsg commit
# Using a specific model
aimsg commit --model gpt4
aimsg commit --model claude2
aimsg commit --model qwen-turbo
# Using custom API base URL
aimsg commit --api-base https://your-api-endpoint.com/v1
# List all available models
aimsg model list
Model Management
- List all available models:
aimsg model list
- Add a custom model:
aimsg model add my-model model-id https://api.example.com/v1
- Remove a custom model:
aimsg model remove my-model
Examples of Custom Model Configuration
- Self-hosted Llama 2:
aimsg model add my-llama llama-2-70b-chat http://localhost:8000/v1
aimsg init # Then select my-llama from the list
- Alternative OpenAI endpoint:
aimsg model add azure-gpt gpt-35-turbo https://your-azure-endpoint.com/v1
aimsg init # Then select azure-gpt from the list
- Other provider's model:
aimsg model add claude-3 claude-3 https://api.anthropic.com/v1
aimsg init # Then select claude-3 from the list
Supported Models
Here are all the pre-configured models you can use:
OpenAI Models
gpt-3.5-turbogpt-3.5-turbo-16kgpt-4gpt-4-32kgpt-4-1106-preview
Anthropic Models
claude-2claude-instant-1
Google Models
palm-2gemini-pro
Chinese Models
- Aliyun
qwen-turboqwen-plus
- iFlytek
spark-v3spark-v2
- Zhipu
chatglm-4chatglm-turbo
- Baidu
ernie-4.0ernie-turbo
- Moonshot
kimi-v1
- Tencent
hunyuanhunyuan-lite
- ByteDance
doubao-v1doubao-turbo
Open Source Models (Hosted)
- DeepSeek
deepseek-chat
- Replicate (提供托管服务)
meta-llama/llama-2-70b-chatmeta-llama/codellama-34b-instruct
- Together AI (提供托管服务)
mistralai/mistral-7b-instructmistralai/mixtral-8x7b-instruct
Environment Variables
The following environment variables can be used to configure the tool:
AIMSG_API_KEY: Your API key for the AI serviceAIMSG_API_BASE: Base URL for the API service (optional)
You can set these in your shell:
export AIMSG_API_KEY=your-api-key
export AIMSG_API_BASE=https://api.example.com/v1
Or use a .env file in your project:
AIMSG_API_KEY=your-api-key
AIMSG_API_BASE=https://api.example.com/v1
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aimsg-0.1.2.tar.gz.
File metadata
- Download URL: aimsg-0.1.2.tar.gz
- Upload date:
- Size: 14.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da4ae9ab643ca4274c8a3833968652c6c7f3e1cb4f4855baa6b40233a9ddfb33
|
|
| MD5 |
a60a20f8bd45b59feab3ee6dbee90ab5
|
|
| BLAKE2b-256 |
22de362c973d6a354e8a0f01bfa9cc7c1c278287aa07b84597eaf1dbd30d6a51
|
File details
Details for the file aimsg-0.1.2-py3-none-any.whl.
File metadata
- Download URL: aimsg-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
badae626dd4d9af907ba0a66b35629752cbc21498d0143c7ba250bbc0f63c4ae
|
|
| MD5 |
d2bd5f1f1d04d83a1672a06f610afebe
|
|
| BLAKE2b-256 |
b7f99362d373759df376b24af2309eaf038a300574b89acfeb58bb0e8bc7f7a8
|