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

업그레이드

새 버전이 출시되면 다음 명령어를 사용하여 업그레이드할 수 있습니다:

pipx로 설치한 경우

pipx upgrade ai-commiter

pip로 설치한 경우

pip install --upgrade ai-commiter

현재 설치된 버전을 확인하려면:

ai-commit --version

저장소에서 직접 설치

# 저장소 클론
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.3.tar.gz (8.3 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.3-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ai_commiter-0.1.3.tar.gz
  • Upload date:
  • Size: 8.3 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.3.tar.gz
Algorithm Hash digest
SHA256 b8ce262f3095d01f9af58196942760809116757da24adcdc1758f8780c4b0abc
MD5 a1f881073f181fe787eabed0ff6a921e
BLAKE2b-256 5b165d70e52487c106b3474558e0e617dbf7f54846598ddf0c282bce076f39ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ai_commiter-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.8 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c65e6e8269ca9b95f6a7c09dc8065bf1f42fc0ec5eba35c939ee3d928d750bd9
MD5 062d8854ca46f8cb4120766b4d05437c
BLAKE2b-256 3295e39ba12406afec721c448672b371434c787207b9cfbd787612d695601718

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