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.
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)
# Install pipx if you haven't
brew install pipx
pipx ensurepath
# Install aimsg
pipx install aimsg
Using pip
pip install aimsg
Quick Start
- Initialize with your preferred model and API key:
aimsg init
- Stage your changes and generate commit message:
git add .
aimsg commit
- Get help or version information:
# Show version
aimsg --version
# Show all available commands
aimsg --help
# Show help for a specific command
aimsg model --help
aimsg commit --help
# Show current configuration
aimsg current
Configuration
Configure aimsg in order of priority:
- Project-level
.envfile (highest priority)
AIMSG_API_KEY=your_api_key
AIMSG_API_BASE=your_api_base
AIMSG_MODEL=your_model
AIMSG_PROMPT=your_prompt
- Environment variables
export AIMSG_API_KEY=your_api_key
export AIMSG_API_BASE=your_api_base
export AIMSG_MODEL=your_model
export AIMSG_PROMPT=your_prompt
- Global configuration via
aimsg init(lowest priority, default)
# Creates ~/.config/aimsg/config.json with default settings:
# - model: gpt-3.5-turbo
# - api_base: https://api.openai.com/v1
# - api_key: your_api_key
# - prompt: default prompt template
# - custom_models: custom model list
aimsg init
Model Management
# 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
# 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
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
aimsg-0.2.2.tar.gz
(13.6 kB
view details)
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
aimsg-0.2.2-py3-none-any.whl
(14.0 kB
view details)
File details
Details for the file aimsg-0.2.2.tar.gz.
File metadata
- Download URL: aimsg-0.2.2.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcaea070847937377dfd912b4a49ec8fed5195441f3662e1b24a123bda455b26
|
|
| MD5 |
748f24b34a299fec8285e89f7e0c38d3
|
|
| BLAKE2b-256 |
ca51e18fa1acff985ce6a7b6075a8b9dcdbc8ba8b1ef83fcbf15174f154ae90c
|
File details
Details for the file aimsg-0.2.2-py3-none-any.whl.
File metadata
- Download URL: aimsg-0.2.2-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
feef1028566300ae7c83b01b41ac7e8bda2369fa1d258ee23f9760e1ff9bdf23
|
|
| MD5 |
f5f25af920435062d7546d1977d5025d
|
|
| BLAKE2b-256 |
934b851f769a429fdcda65a4f6f651b6bff96bd6a8ca0c02c784226ec1a5bcc5
|