Skip to main content

A CLI tool to generate commit messages using AI models

Project description

Git Commit Message Generator with AI

中文文档

PyPI version License: MIT Python 3.7+

A CLI tool that generates commit messages using AI models based on your git repository changes.

Features

  • 🤖 Wide Model Support:
    • OpenAI
    • Anthropic
    • Google
    • DeepSeek
    • Aliyun
    • iFlytek
    • Zhipu
    • Baidu
    • Moonshot
    • Tencent
    • ByteDance
    • Replicate
    • Together AI
  • 🔧 Custom API base
  • 🔧 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 acmt
pipx install acmt

# Upgrade acmt
pipx upgrade acmt

Using pip

pip install acmt

Quick Start

  1. Initialize with your preferred model and API key:
acmt init
  1. Stage your changes and generate commit message:
git add .
acmt commit
  1. Get help or version information:
# Show version
acmt --version

# Show all available commands
acmt --help

# Show help for a specific command
acmt model --help
acmt commit --help

# Show current configuration
acmt current

Configuration

Configure acmt in order of priority:

  1. Project-level .env file (highest priority)
ACMT_API_KEY=your_api_key
ACMT_API_BASE=your_api_base
ACMT_MODEL=your_model
ACMT_PROMPT=your_prompt
  1. Environment variables(Secondary priority)
export ACMT_API_KEY=your_api_key
export ACMT_API_BASE=your_api_base
export ACMT_MODEL=your_model
export ACMT_PROMPT=your_prompt
  1. Global configuration via acmt init (lowest priority, default)
acmt init

# Creates ~/.config/acmt/config.json with default settings:
# - model: your_model
# - api_base: your_api_base
# - api_key: your_api_key
# - prompt: default prompt template
# - custom_models: custom model list

Model Management

# List available models
acmt model list

# Add custom model
acmt model add my-model https://api.example.com/v1

# Remove custom model
acmt model remove my-model

Prompt Management

# Customize commit message prompt template
acmt prompt

# Reset to default prompt template
acmt reset-prompt

Default prompt template:

Based on the following git diff, generate a concise and descriptive commit message that follows conventional commits format.
Focus on the "what" and "why" of the changes.
Start with a type (feat, fix, docs, style, refactor, perf, test, build, ci, chore).
Do not include scope.
Limit the first line to 72 characters.
Add a blank line followed by a more detailed description if necessary.

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 Providers

  • OpenAI: https://api.openai.com/v1
  • Anthropic: https://api.anthropic.com/v1
  • Google: https://generativelanguage.googleapis.com/v1
  • 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
  • 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

acmt-0.3.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

acmt-0.3.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file acmt-0.3.0.tar.gz.

File metadata

  • Download URL: acmt-0.3.0.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

Hashes for acmt-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3e1e4b6826d80c464aae83c6bbc517117dd7b30b669ddd3609191dd27b4b4fc2
MD5 926742dfa6e57a74cd43786d9273941c
BLAKE2b-256 11a8af205b12a8d2832295040e5ff2a2ff5ab747bf0d369f10f2b853710543af

See more details on using hashes here.

File details

Details for the file acmt-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: acmt-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for acmt-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0277bee148658ffb5a69cce773e460063a3d1b3a35a81ad6e809a4809e8e3376
MD5 2ec8677819b1f6cf9376c2bfca39d869
BLAKE2b-256 9f6c5b8b3c53f6c281de297183d588f5c79cd21fd055521f53f661367390cf63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page