<p align="center">
<img src="https://raw.githubusercontent.com/can1357/llm-git/main/assets/banner.png" alt="lgit">
</p>
<p align="center">
<strong>LLM 기반 Git 커밋 메시지 생성기</strong>
</p>
<p align="center">
<a href="https://github.com/can1357/llm-git/actions"><img src="https://img.shields.io/github/actions/workflow/status/can1357/llm-git/ci.yml?style=flat&colorA=222222&colorB=3FB950" alt="CI"></a>
<a href="https://pypi.org/project/lgit-cli/"><img src="https://img.shields.io/pypi/v/lgit-cli?style=flat&colorA=222222&colorB=3FB950" alt="PyPI"></a>
<a href="https://github.com/can1357/llm-git/blob/main/LICENSE"><img src="https://img.shields.io/github/license/can1357/llm-git?style=flat&colorA=222222&colorB=58A6FF" alt="License"></a>
<a href="https://www.python.org"><img src="https://img.shields.io/badge/Python-3.14%2B-3FB950?style=flat&colorA=222222&logo=python&logoColor=white" alt="Python"></a>
</p>
<p align="center">
클로드 AI 또는 모든 OpenAI 호환 API를 사용하여 git diff에서 <a href="https://www.conventionalcommits.org">conventional commits</a>를 생성합니다.<br>자동 변경 로그(changelog) 유지 관리, 다중 커밋 구성, 전체 히스토리 재작성 기능을 제공합니다.
</p>
기능 (Features)
- Conventional commits — 타입, 범위(scope), 과거 시제 요약(summary)을 갖춘 적절하게 형식화된 커밋 메시지를 생성합니다 (≤72자).
- 자동 변경 로그(Automatic changelogs) — 모노레포 지원과 함께 Keep a Changelog 형식을 따르는
CHANGELOG.md를 유지 관리합니다.
- 구성(Compose) 모드 — 대규모 스테이징된 변경 사항을 여러 논리적 원자적 커밋(atomic commits)으로 분할합니다.
- 재작성(Rewrite) 모드 — 전체 git 히스토리를 conventional commits로 변환합니다 (자동 백업 기능 포함).
- 맵리듀스 분석(Map-reduce analysis) — 잘림 없이 대규모 커밋에 대해 병렬적인 파일별 분석을 수행합니다.
- 모든 LLM 제공업체(Any LLM provider) — Anthropic, OpenAI, OpenRouter 또는 모든 OpenAI 호환 API와 함께 작동합니다.
빠른 시작 (Quick Start)
uv tool install lgit-cli
...
사용법 (Usage)
기본 명령어 (Basic Commands)
lgit
lgit --dry-run
lgit --copy
...
Compose Mode (작성 모드)
스테이징된 변경 사항을 여러 논리적 커밋으로 분할합니다:
lgit --compose
lgit --compose --compose-preview
lgit --compose --compose-max-commits 5
...
Rewrite Mode (재작성 모드)
저장소 히스토리를 컨벤셔널 커밋(Conventional Commits)으로 변환합니다:
lgit --rewrite
lgit --rewrite --rewrite-preview 10
lgit --rewrite --rewrite-dry-run
...
Profiling Trace (프로파일링 추적)
상세한 트레이싱 스팬(tracing spans) 및 HTTP 타이밍 이벤트를 JSONL 파일에 작성합니다:
lgit --trace-output /tmp/lgit-profile.jsonl --dry-run
LLM_GIT_TRACE_FILE=/tmp/lgit-profile.jsonl lgit --compose
Automatic Changelog (자동 변경 로그)
lgit은 커밋할 때 자동으로 CHANGELOG.md 파일을 유지 관리합니다:
- Auto-detection — 저장소의 모든
CHANGELOG.md 파일을 찾습니다.
- Monorepo support — 파일 경로를 기반으로 적절한 변경 로그로 변경 사항을 라우팅합니다.
- Deduplication — 기존 항목과 의미적으로 유사한 항목은 건너뜁니다.
- Category mapping — 커밋 유형을 섹션(추가됨, 수정됨, 변경됨 등)에 매핑합니다.
project/
├── CHANGELOG.md ← src/, docs/를 포함합니다
├── packages/
...
--no-changelog 또는 설정에서 changelog_enabled = false로 비활성화할 수 있습니다.
스테이징된 변경 사항에 변경 로그 경계가 있을 경우, 하나의 합성(synthesis) 호출로 커밋 분석과 적용 가능한 모든 변경 로그 업데이트를 한 번에 생성합니다. Compose는 이미 계획된 각 그룹에 대해 동일한 합성을 사용하며, 그룹화 및 스테이징 방식은 변경되지 않습니다. 대용량 입력의 경우 파일별 맵 관찰을 재사용하며, 유효한 요약은 별도의 요약 호출을 피하게 합니다.
요약 수정/재작성(Summary repair/rewrite), 작성자 항목 보호(authored-entry protection), 기존 항목 개정(existing-entry revisions), 그리고 스테이징/워크트리 격리(staged/worktree isolation) 기능은 여전히 적용됩니다. 형식이 잘못된 공유 출력은 별도의 생성 방식으로 폴백(fallback)합니다. --dry-run, 커밋/미스테이징 분석(commit/unstaged analysis), 그리고 --no-changelog 옵션들은 기존의 생성 경로를 유지합니다.
프롬프트 오버라이드(Prompt overrides)는 명시적입니다: 관련 analysis.md, fast.md, map.md, reduce.md, 또는 changelog.md 파일을 오버라이드하면, 해당 디렉터리에서 synthesis.md 파일도 제공하는 경우가 아니라면 별도의 호출이 유지됩니다.
설정 (Configuration)
~/.config/llm-git/config.toml을 생성합니다:
api_base_url = "http://localhost:4000"
api_key = "sk-..."
...
제공자 예시 (Provider Examples)
Anthropic 직접 연결:
api_base_url = "https://api.anthropic.com/v1"
api_key = "sk-ant-..."
OpenRouter:
api_base_url = "https://openrouter.ai/api/v1"
api_key = "sk-or-..."
analysis_model = "anthropic/claude-sonnet-4.5"
...
OpenAI:
api_base_url = "https://api.openai.com/v1"
api_key = "sk-..."
analysis_model = "gpt-4o"
...
판단(Judgments) (선택 사항, 위의 모든 제공자 사용 가능):
judgment_api_key = "!cat ~/.secrets/typesafe"
LLM_GIT_JUDGMENT_DISABLED=1로 설정하면 키를 제거하지 않고도 판단 기능을 끌 수 있습니다.
클라이언트는 OpenRouter, LiteLLM, Anthropic, OpenAI 엔드포인트 전반에 걸쳐 동일한 응답 형식을 사용합니다: 개별 작업에는 마크다운/일반 텍스트가, 공유 커밋/변경 로그 합성(synthesis)에는 검증된 JSON 객체가 사용됩니다.
커밋 유형 (Commit Types)
커밋 유형 분류를 사용자 정의할 수 있습니다:
[types.feat]
description = "새로운 공개 API 또는 사용자 관찰 가능한 동작 변경"
diff_indicators = ["pub fn", "pub struct", "export function"]
...
변경 로그 카테고리 (Changelog Categories)
[[categories]]
name = "Breaking"
header = "하위 호환성 깨지는 변경 사항(Breaking Changes)"
...
환경 변수 (Environment Variables)
| 변수 | 설명 | 기본값 |
|---|
LLM_GIT_API_URL | API 엔드포인트 | http://localhost:4000 |
| ... | | |
설치 (Installation)
PyPI에서 (From PyPI)
uv tool install lgit-cli
pipx install lgit-cli
pip install lgit-cli
소스 코드에서 (From source)
git clone https://github.com/can1357/llm-git.git
cd llm-git
uv tool install .
필수 조건 (Prerequisites)
- Python 3.14 이상
- Git
- API 접근 권한 (Anthropic, OpenAI, OpenRouter 또는 로컬 LiteLLM 프록시)
라이선스 (License)
MIT