| Crates.io | auto-commit |
| lib.rs | auto-commit |
| version | 2.0.0 |
| created_at | 2025-12-10 13:20:46.16154+00 |
| updated_at | 2025-12-10 13:20:46.16154+00 |
| description | AI-powered Git commit message generator - supports OpenAI, DeepSeek, and Gemini |
| homepage | https://github.com/clearclown/auto-commit |
| repository | https://github.com/clearclown/auto-commit |
| max_upload_size | |
| id | 1977983 |
| size | 258,635 |
AI搭載Git自動コミットメッセージ生成ツール - OpenAI / DeepSeek / Gemini 対応
🌐 Languages: English | 简体中文 | Русский | العربية | فارسی
auto-commitは、ステージされた変更を分析し、適切なコミットメッセージを自動生成するCLIツールです。本プロジェクトはm1guelpf/auto-commitのフォークで、複数のLLMプロバイダー(OpenAI、DeepSeek、Gemini)に対応し、カスタマイズ可能なコミットメッセージフォーマット機能を追加しています。
--formatオプションで自由にメッセージ形式を設定可能.envファイルでの設定管理準備中: Homebrew tapは現在準備中です。ソースビルドまたはバイナリダウンロードをご利用ください。
brew tap clearclown/tap
brew install auto-commit
# crates.io から(公開後)
cargo install auto-commit
# GitHubリポジトリから直接
cargo install --git https://github.com/clearclown/auto-commit.git
GitHub Releasesから、お使いのプラットフォーム向けのバイナリをダウンロード:
| プラットフォーム | ファイル |
|---|---|
| macOS (Apple Silicon) | auto-commit-darwin-aarch64 |
| macOS (Intel) | auto-commit-darwin-x86_64 |
| Linux (x86_64) | auto-commit-linux-x86_64 |
| Linux (deb) | auto-commit-linux-x86_64.deb |
| Windows (x86_64) | auto-commit-win-x86_64.exe |
# 例: macOS (Apple Silicon)
curl -LO https://github.com/clearclown/auto-commit/releases/latest/download/auto-commit-darwin-aarch64
chmod +x auto-commit-darwin-aarch64
sudo mv auto-commit-darwin-aarch64 /usr/local/bin/auto-commit
注意: 現在AURの
auto-commitパッケージはオリジナルの m1guelpf/auto-commit 用です。このフォーク版をインストールするには、Cargo (GitHub) またはソースビルドをご利用ください。
# オリジナル版をインストールする場合
yay -S auto-commit
# または
paru -S auto-commit
# リポジトリをクローン
git clone https://github.com/clearclown/auto-commit.git
cd auto-commit
# ビルド
cargo build --release
# バイナリをパスに移動
sudo mv target/release/auto-commit /usr/local/bin/
お使いのLLMプロバイダーのAPIキーを環境変数に設定します。複数設定されている場合は、優先順位に従って自動選択されます。
優先順位: OPENAI_API_KEY > DEEPSEEK_API_KEY > GEMINI_API_KEY
# OpenAI を使用
export OPENAI_API_KEY='sk-...'
# DeepSeek を使用
export DEEPSEEK_API_KEY='sk-...'
# Google Gemini を使用
export GEMINI_API_KEY='AIza...'
または、プロジェクトルートに.envファイルを作成:
# .env ファイル(いずれか1つを設定)
OPENAI_API_KEY='sk-...'
# DEEPSEEK_API_KEY='sk-...'
# GEMINI_API_KEY='AIza...'
# バージョン確認
auto-commit --version
# ヘルプ表示
auto-commit --help
# 変更をステージ
git add .
# コミットメッセージを自動生成して実行
auto-commit
実行時に使用されるプロバイダーが表示されます:
⠋ Generating commit message using OpenAI...
✓ Commit message generated (OpenAI)
# ドライラン(実際にはコミットしない)
auto-commit --dry-run
# 生成されたメッセージを確認してから決定
auto-commit --review
# 強制実行(確認なし)
auto-commit --force
# カスタムフォーマット指定
auto-commit --format "{emoji} {prefix}: {title}"
# 詳細なログ出力
auto-commit -v
カスタムフォーマットで使用可能なプレースホルダー:
| プレースホルダー | 説明 | 例 |
|---|---|---|
{title} |
コミットの要約(1行目) | Add user authentication |
{description} |
詳細な説明 | Implemented JWT-based auth... |
{emoji} |
GitMojiスタイルの絵文字 | ✨, 🐛, 📝 |
{prefix} |
Conventional Commitsプレフィックス | feat, fix, docs |
{scope} |
変更スコープ(optional) | api, cli, config |
# Conventional Commits形式
auto-commit --format "{prefix}({scope}): {title}\n\n{description}"
# GitMoji形式
auto-commit --format "{emoji} {title}\n\n{description}"
# シンプル形式
auto-commit --format "{title}"
プロジェクト固有のコミットルールを設定できます。以下の優先順位で読み込まれます:
~/.gitmessage - ユーザーカスタム(最優先)./.gitmessage - プロジェクトルートテンプレートファイルには、コミットメッセージのフォーマットルール、使用可能なプレフィックス、絵文字ガイドラインなどを記述できます。
| プロバイダー | デフォルトモデル | 環境変数 |
|---|---|---|
| OpenAI | gpt-4o-mini |
OPENAI_API_KEY |
| DeepSeek | deepseek-chat |
DEEPSEEK_API_KEY |
| Google Gemini | gemini-2.0-flash |
GEMINI_API_KEY |
# 開発ビルド
cargo build
# リリースビルド
cargo build --release
# テスト実行
cargo test -- --test-threads=1
# フォーマット
cargo fmt
# Lint
cargo clippy
src/
├── main.rs # エントリーポイント
├── lib.rs # モジュールエクスポート
├── api/
│ ├── mod.rs # クライアントファクトリ
│ ├── client.rs # LlmClient trait
│ ├── provider.rs # Provider enum(自動検出)
│ ├── openai_compatible.rs # OpenAI/DeepSeek クライアント
│ └── gemini.rs # Gemini クライアント
├── cli/ # CLIインターフェース
├── config/ # 設定管理
├── formatter/ # メッセージフォーマッター
└── git/ # Git操作
# 環境変数の確認
echo $OPENAI_API_KEY
echo $DEEPSEEK_API_KEY
echo $GEMINI_API_KEY
# .envファイルの確認
cat .env
-v オプションで詳細ログを出力すると、どのプロバイダーが選択されたか確認できます:
auto-commit -v --dry-run
# ステージされた変更があるか確認
git status
# Gitの設定確認
git config user.name
git config user.email
# Rustのバージョン確認
rustc --version
# 依存関係の更新
cargo update
git checkout -b feature/amazing-feature)auto-commitを使用!)git push origin feature/amazing-feature)MITライセンス - 詳細はLICENSEファイルを参照してください。