Skip to main content

The CLI tool for generating AI commit messages from git changes

Project description

ACW (Auto Commit Wizard)

AI를 활용해 Git 커밋 메시지를 생성하는 CLI 도구입니다.

litellm 기반으로 OpenAI, Anthropic, Google Gemini, Ollama, LM Studio 등 다양한 provider를 사용할 수 있습니다.

주요 기능

  • 설정 마법사(acw config)로 provider/model/API 키 환경변수/기본 옵션 설정
  • staged diff(기본), stash, ref 기준 커밋 메시지 생성
  • 프롬프트 템플릿 관리(acw prompt) 및 포맷별 기본 프롬프트 제공
  • 로컬 LLM 서버 연결 진단(acw doctor)
  • 후보 여러 개 생성 후 선택, JSON 출력, 파일 저장, 클립보드 복사 지원

요구 사항

  • Python 3.11+
  • Git
  • uv 권장

설치

PyPI 배포 버전을 uv로 설치:

uv tool install acw

개발용(소스에서 실행):

git clone https://github.com/auto-commit-wizard/acw.git
cd acw
uv sync

빠른 시작

처음에는 설정 마법사를 실행하세요.

acw config

가장 기본적인 실행은 다음과 같습니다.

acw generate

참고:

  • acw에 서브커맨드를 생략하면 내부적으로 generate로 동작합니다.
  • 기본 생성 대상은 staged 변경사항입니다. (git add가 먼저 필요)

명령어

acw generate

Git diff를 수집해 커밋 메시지를 생성합니다.

  • -p, --provider: provider 지정
  • -m, --model: 모델명 지정
  • -P, --profile: profile 지정
  • -t, --prompt: 프롬프트 이름 지정
  • -F, --prompt-file: 프롬프트 파일 경로 지정
  • --print-prompt: 최종 프롬프트 출력
  • -l, --language {ko,en}: 출력 언어
  • -f, --format {plain,conventional,gitmoji}: 메시지 포맷
  • -g, --generate: 후보 개수
  • --from-stash: stash 기준 diff 사용
  • --from-ref: ref 기준 diff 사용
  • -x, --exclude: 제외 패턴(반복 가능)
  • -s, --max-diff-size: diff 최대 바이트
  • -y, --yes: 확인 프롬프트 생략
  • -d, --dry-run: 실제 커밋 없이 메시지 생성
  • -j, --json: JSON 출력
  • -o, --output: 메시지를 파일로 저장
  • -c, --clipboard: 메시지를 클립보드로 복사
  • -n, --no-verify: git commit --no-verify 사용
  • -a, --all: 커밋 시 git commit -a 사용

예시:

# 메시지만 생성
uv run acw generate --dry-run

# 후보 3개 생성
uv run acw generate --generate 3

# 특정 브랜치 기준 diff
uv run acw generate --from-ref origin/master --dry-run

# stash 기준 diff
uv run acw generate --from-stash stash@{0} --dry-run

# JSON 출력
uv run acw generate --json --dry-run

[!CAUTION] 원격 provider를 사용하면 수집된 Git diff가 외부 LLM API로 전송됩니다. secret, 고객 정보, 비공개 코드가 포함된 변경사항은 커밋 전에 제거하거나 --exclude로 제외하세요. 외부 전송을 원하지 않으면 Ollama/LM Studio 같은 로컬 provider를 사용하세요.

acw config

설정 마법사 실행 또는 설정 삭제

uv run acw config
uv run acw config --delete

acw prompt

프롬프트 템플릿 조회/관리

기본 사용:

uv run acw prompt --list
uv run acw prompt --name conventional --show
uv run acw prompt --name team --set "팀 규칙을 반영해 작성"
uv run acw prompt --name team --file ./prompt.md

고급 옵션:

  • -l, --language {ko,en}: 프롬프트 언어 variant 지정
  • --sync: builtin 기본 프롬프트 템플릿을 최신 기본값으로 덮어쓰기

acw doctor

로컬 provider(ollama, lmstudio) 연결 및 모델 가용성 점검

기본 사용:

uv run acw doctor --provider ollama
uv run acw doctor --provider lmstudio --timeout 60

고급 옵션:

  • -m, --model: 진단할 모델명 override
  • -P, --profile: 저장된 profile 설정으로 진단

설정 위치

기본 설정 디렉터리:

  • ~/.config/acw

환경변수로 변경 가능:

  • ACW_CONFIG_DIR

생성되는 주요 파일/디렉터리:

  • config.toml
  • prompts/*.md
  • profiles/*.toml

환경 변수

기본 API 키 환경 변수 매핑:

  • OPENAI_API_KEY
  • ANTHROPIC_API_KEY
  • GEMINI_API_KEY
  • OPENROUTER_API_KEY
  • XAI_API_KEY
  • GROQ_API_KEY
  • DEEPSEEK_API_KEY
  • COHERE_API_KEY

개발

테스트:

uv run pytest

타입 체크:

uv run pyright

배포 (Publish)

새로운 버전을 배포하려면 scripts/publish.sh를 사용하세요.

./scripts/publish.sh v0.x.x

이 스크립트는 다음 항목을 처리합니다:

  1. master 브랜치 여부 및 git 상태 확인
  2. pyproject.toml의 버전과 태그 일치 여부 확인
  3. 태그 생성 및 푸시(git tag & git push)
  4. uv build를 통한 빌드
  5. uv publish를 통한 PyPI 배포

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

acw-0.4.0.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

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

acw-0.4.0-py3-none-any.whl (46.9 kB view details)

Uploaded Python 3

File details

Details for the file acw-0.4.0.tar.gz.

File metadata

  • Download URL: acw-0.4.0.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for acw-0.4.0.tar.gz
Algorithm Hash digest
SHA256 166c0c3d2682a1fc05df222e8707dabba86496e606f85256aae6f63f0699d819
MD5 d0a17eff58070f7d3234b6aab7a6a829
BLAKE2b-256 d701688c6d303cf4d578c23c712e641d0190966bfc2ca6a75aaf6c6ae86bd9c5

See more details on using hashes here.

File details

Details for the file acw-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: acw-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 46.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for acw-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f208c801ee2f0971063f99e4876079102140ddef014f188a218245ee26b3e2d3
MD5 b913c9d82af61ce8d63339d790732dba
BLAKE2b-256 5c7ac167bcf4d22e9093d40550fcb1751bd2afd75100649f61dc9bbd691f4a59

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