Skip to main content

인공지능을 활용하여 Git 커밋 메시지를 자동으로 생성하는 도구

Project description

AI-Commiter

인공지능을 활용하여 Git 커밋 메시지를 자동으로 생성하는 도구입니다. 파일 변경 내역을 분석하고 OpenAI API를 통해 명확하고 구조화된 커밋 메시지를 생성합니다.

PyPI version

주요 기능

  • 자동 커밋 메시지 생성: Git diff를 분석하여 의미 있는 커밋 메시지 생성
  • Conventional Commits 지원: 표준화된 커밋 메시지 형식 사용
  • 파일 분류 및 요약: 여러 파일 변경 시 카테고리별로 분류하여 요약 정보 제공
  • 커스텀 프롬프트: 사용자 정의 프롬프트 템플릿 지원
  • 자동 커밋: 생성된 메시지로 자동 커밋 옵션
  • 다양한 모델 지원: OpenAI의 다양한 GPT 모델 선택 가능

설치 방법

pipx로 설치 (권장)

pipx는 애플리케이션을 격리된 환경에 설치하여 의존성 충돌 없이 사용할 수 있게 해줍니다.

# 1. pipx 설치 (처음 사용시)
pip install pipx
pipx ensurepath

# 2. 환경 변수 적용 (하나를 선택)
# macOS 사용자 (기본 zsh)
source ~/.zshrc
# Linux 또는 기타 bash 사용자
source ~/.bashrc

# 3. ai-commiter 설치
pipx install ai-commiter

# 4. OpenAI API 키 설정
# macOS/Linux
export OPENAI_API_KEY=your-api-key-here
# Windows
# set OPENAI_API_KEY=your-api-key-here

문제해결: 설치 후 ai-commit 명령어를 찾을 수 없는 경우:

  1. pipx ensurepath 실행
  2. source ~/.zshrc (macOS) 또는 source ~/.bashrc (Linux) 실행
  3. 새로운 터미널을 열어 시도

pip로 설치

pip install ai-commiter

# OpenAI API 키 설정
export OPENAI_API_KEY=your-api-key-here
# Windows에서는
# set OPENAI_API_KEY=your-api-key-here

저장소에서 직접 설치

# 저장소 클론
git clone https://github.com/your-username/ai-commiter.git
cd ai-commiter

# 패키지로 설치
pip install -e .

# OpenAI API 키 설정
echo "OPENAI_API_KEY=your-api-key-here" > .env

사용 방법

기본 사용법

# 스테이지된 변경 사항에 대한 커밋 메시지 생성
ai-commit

# 생성된 메시지로 바로 커밋
ai-commit --commit

# 패키지 설치 없이 직접 실행할 경우
python -m ai_commiter.git_commit_ai

추가 옵션

# 특정 저장소 경로 지정
ai-commit --repo /path/to/repo --model gpt-4 --commit

# 파일 분류 기능 비활성화
ai-commit --no-categorize

# 스테이지되지 않은 모든 변경 사항 포함
ai-commit --all

# 다른 OpenAI 모델 사용
ai-commit --model gpt-4

# 커스텀 프롬프트 템플릿 사용
ai-commit --prompt my_custom_prompt.txt

커스텀 프롬프트 템플릿

커스텀 프롬프트 템플릿 파일을 만들어 AI가 생성하는 커밋 메시지의 스타일과 형식을 조정할 수 있습니다. 템플릿에는 {diff}{files} 변수를 사용할 수 있습니다.

예시 템플릿:

다음 변경 사항을 분석하여 한국어로 커밋 메시지만 출력해주세요:
커밋 메시지 형식: [타입] 내용

요구 사항

  • Python 3.7 이상
  • Git
  • OpenAI API 키

라이센스

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

ai_commiter-0.1.2.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

ai_commiter-0.1.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file ai_commiter-0.1.2.tar.gz.

File metadata

  • Download URL: ai_commiter-0.1.2.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for ai_commiter-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5c7ecbeb094f244b041eaa4298d14c30011e37069f911dd4a81ed97207966e50
MD5 8563d66361fbe24044e7dd2b2d027775
BLAKE2b-256 c9ebef22375d1158700698f190228f316fbb76a59f31707245991a9a6a3a58ba

See more details on using hashes here.

File details

Details for the file ai_commiter-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ai_commiter-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for ai_commiter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bcbacef7c7841e423aa3eebc06ebead9a3d22d02f68c86c6d6d74b5937d609fe
MD5 167bff42a79454319d4b805f815eab38
BLAKE2b-256 3dac612ac2adf1baf772ef6cb5af01c402fcd66c1df456fe828aff5c1428eea7

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