Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49867987ab | ||
|
|
35193909e8 | ||
|
|
5a2c95f72b |
No files matched your search
@@ -46,12 +46,13 @@
|
|||||||
|
|
||||||
- ⚡ **Git 原生极简体验**:无需改变任何工作习惯,在命令行敲 `git air` 即可秒级唤起。
|
- ⚡ **Git 原生极简体验**:无需改变任何工作习惯,在命令行敲 `git air` 即可秒级唤起。
|
||||||
- 🧠 **全模型自由接入**:开箱即用预置 **Google Gemini 3.x、Anthropic Claude、xAI Grok、DeepSeek、阿里通义千问、智谱 GLM、月之暗面 Kimi、本地 Ollama、OpenAI** 等全系列模型。
|
- 🧠 **全模型自由接入**:开箱即用预置 **Google Gemini 3.x、Anthropic Claude、xAI Grok、DeepSeek、阿里通义千问、智谱 GLM、月之暗面 Kimi、本地 Ollama、OpenAI** 等全系列模型。
|
||||||
|
- 🔒 **本地敏感信息自动脱敏**:在 Diff 发送给大模型前,自动在本地脱敏私钥证书、API Key、Bearer Token、数据库连接串等敏感数据,零泄露风险。
|
||||||
- 🛡️ **智能降噪过滤**:自动剥离 `go.sum`、`package-lock.json`、`*.pb.go`、`*.gen.go` 等锁文件与自动生成代码,省 Token、防死循环。
|
- 🛡️ **智能降噪过滤**:自动剥离 `go.sum`、`package-lock.json`、`*.pb.go`、`*.gen.go` 等锁文件与自动生成代码,省 Token、防死循环。
|
||||||
- 🎯 **严谨架构师准则**:直奔主题,聚焦并发竞态、死锁、SQL 注入、空指针、资源泄露,并直接提供修复参考代码。
|
- 🎯 **严谨架构师准则**:直奔主题,聚焦并发竞态、死锁、SQL 注入、空指针、资源泄露,并直接提供修复参考代码。
|
||||||
- 📊 **Token 消耗与费用实时估算**:实时捕获并统计输入/输出 Token 消耗,内置 2026 最新官方定价表精准核算每次审查成本(本地离线模型自动标注免费)。
|
- 📊 **Token 消耗与费用实时估算**:实时捕获并统计输入/输出 Token 消耗,内置 2026 最新官方定价表精准核算每次审查成本(本地离线模型自动标注免费)。
|
||||||
- ✨ **AI 智能 Commit Message**:一键根据代码变更生成规范的 Conventional Commits 提交说明,支持**中/英/日/韩**等多语言自适应。
|
- ✨ **AI 智能 Commit Message**:一键根据代码变更生成规范的 Conventional Commits 提交说明,支持**中/英/日/韩**等多语言自适应。
|
||||||
- 📋 **团队规范适配(`.airules`)**:在项目根目录放置 `.airules`,AI 自动加载团队专属架构规范并最高优先级执行。
|
- 📋 **团队规范适配(`.airules`)**:在项目根目录放置 `.airules`,AI 自动加载团队专属架构规范并最高优先级执行。
|
||||||
- 🪝 **一键 Pre-commit 钩子**:一行命令挂载 Git 提交前自动拦截,在代码上库前把好第一道质量关。
|
- 🪝 **一键 Pre-commit 钩子**:一行命令挂载 Git 提交前自动拦截(支持原 Hook 备份与链式调用),在代码上库前把好第一道质量关。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -149,6 +150,12 @@ git air config set --price-input 0.75 --price-output 3.75
|
|||||||
|
|
||||||
# 14. 永久设置 Commit Message 默认语言 (可选: auto, zh, en, ja, ko)
|
# 14. 永久设置 Commit Message 默认语言 (可选: auto, zh, en, ja, ko)
|
||||||
git air config set --commit-lang en
|
git air config set --commit-lang en
|
||||||
|
|
||||||
|
# 15. 配置专属代码审查自定义提示词 (可选)
|
||||||
|
git air config set --reviewer-prompt "你是一位严谨的 Go 资深专家,重点关注并发与内存"
|
||||||
|
|
||||||
|
# 16. 配置专属 Commit Message 自定义提示词 (可选)
|
||||||
|
git air config set --commit-msg-prompt "生成提交信息时,严格使用 Angular 规范"
|
||||||
```
|
```
|
||||||
|
|
||||||
查看当前配置状态(含自定义费率与脱敏 Key):
|
查看当前配置状态(含自定义费率与脱敏 Key):
|
||||||
@@ -175,6 +182,9 @@ git air internal/service/chat.go
|
|||||||
|
|
||||||
# 临时指定模型或 Key 进行评审
|
# 临时指定模型或 Key 进行评审
|
||||||
git air --provider deepseek --model deepseek-chat
|
git air --provider deepseek --model deepseek-chat
|
||||||
|
|
||||||
|
# 输出结构化 JSON 报告(便于 CI/CD 自动化流水线或脚本消费)
|
||||||
|
git air --format json
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -227,10 +237,11 @@ feat(auth): 引入 Redis 缓存并修复 Mutex 死锁隐患
|
|||||||
git air hook install
|
git air hook install
|
||||||
```
|
```
|
||||||
- **自动门禁阻断**:当审查发现 `[BLOCKER]` 严重缺陷或 `[REJECT]` 评审结论时,`git-air` 会自动以非零退出码**直接拦截并阻断本次 `git commit`**,死守代码质量底线!
|
- **自动门禁阻断**:当审查发现 `[BLOCKER]` 严重缺陷或 `[REJECT]` 评审结论时,`git-air` 会自动以非零退出码**直接拦截并阻断本次 `git commit`**,死守代码质量底线!
|
||||||
|
- **原 Hook 链式执行**:若仓库原本已有 `pre-commit`,`git-air` 会自动安全备份并在审查放行后**链式调用原有 Hook**,绝不破坏现有工程配置!
|
||||||
- **严格模式 (`--strict`)**:若希望发现 `[WARNING]` 也强制阻断提交,可使用 `git air --strict`;
|
- **严格模式 (`--strict`)**:若希望发现 `[WARNING]` 也强制阻断提交,可使用 `git air --strict`;
|
||||||
- **临时跳过阻断**:如确需强行提交,可使用 Git 原生命令 `git commit --no-verify` 或附加 `git-air --no-block`。
|
- **临时跳过阻断**:如确需强行提交,可使用 Git 原生命令 `git commit --no-verify` 或附加 `git-air --no-block`。
|
||||||
|
|
||||||
如需卸载钩子:
|
如需卸载钩子并完全恢复原 Hook:
|
||||||
```bash
|
```bash
|
||||||
git air hook uninstall
|
git air hook uninstall
|
||||||
```
|
```
|
||||||
|
|||||||
+13
-2
@@ -45,12 +45,13 @@ Completely isolated from your chat history, it acts like a **grumpy but sharp se
|
|||||||
|
|
||||||
- ⚡ **Git-Native Simplicity**: No workflow changes needed. Just run `git air` in your terminal for instant feedback.
|
- ⚡ **Git-Native Simplicity**: No workflow changes needed. Just run `git air` in your terminal for instant feedback.
|
||||||
- 🧠 **Universal Multi-Model Support**: Pre-configured support for **Google Gemini 3.x, Anthropic Claude, xAI Grok, DeepSeek, Qwen, Zhipu GLM, Moonshot Kimi, Local Ollama, OpenAI**, and any OpenAI-compatible endpoint.
|
- 🧠 **Universal Multi-Model Support**: Pre-configured support for **Google Gemini 3.x, Anthropic Claude, xAI Grok, DeepSeek, Qwen, Zhipu GLM, Moonshot Kimi, Local Ollama, OpenAI**, and any OpenAI-compatible endpoint.
|
||||||
|
- 🔒 **Local Secret Redaction**: Automatically masks private keys, API keys, Bearer tokens, and database connection strings before sending diffs to the LLM (zero leakage risk).
|
||||||
- 🛡️ **Smart Noise Reduction**: Automatically strips out `go.sum`, `package-lock.json`, `*.pb.go`, and lockfiles to save tokens and eliminate review loops.
|
- 🛡️ **Smart Noise Reduction**: Automatically strips out `go.sum`, `package-lock.json`, `*.pb.go`, and lockfiles to save tokens and eliminate review loops.
|
||||||
- 🎯 **Strict Senior Architect Persona**: Zero corporate fluff. Directly flags concurrency deadlocks, SQL injections, nil dereferences, and resource leaks with copy-paste code patches.
|
- 🎯 **Strict Senior Architect Persona**: Zero corporate fluff. Directly flags concurrency deadlocks, SQL injections, nil dereferences, and resource leaks with copy-paste code patches.
|
||||||
- 📊 **Real-time Token & Cost Estimation**: Accurately tracks prompt/completion token consumption with built-in official pricing rates (local offline models automatically marked free).
|
- 📊 **Real-time Token & Cost Estimation**: Accurately tracks prompt/completion token consumption with built-in official pricing rates (local offline models automatically marked free).
|
||||||
- ✨ **AI Commit Message Generator**: Automatically generates clean, standardized Conventional Commits messages with multi-language support (English, Japanese, Korean, Chinese).
|
- ✨ **AI Commit Message Generator**: Automatically generates clean, standardized Conventional Commits messages with multi-language support (English, Japanese, Korean, Chinese).
|
||||||
- 📋 **Team Rules Support (`.airules`)**: Drop an `.airules` file in your repo root, and the AI will prioritize your team-specific guidelines.
|
- 📋 **Team Rules Support (`.airules`)**: Drop an `.airules` file in your repo root, and the AI will prioritize your team-specific guidelines.
|
||||||
- 🪝 **One-Click Pre-commit Hook**: Mounts as a local Git hook in one command to block dangerous bugs before code is committed.
|
- 🪝 **One-Click Pre-commit Hook**: Mounts as a local Git hook in one command (with automatic backup and chain execution of existing hooks) to block bugs before code is committed.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -148,6 +149,12 @@ git air config set --price-input 0.75 --price-output 3.75
|
|||||||
|
|
||||||
# 14. Permanently Set Default Commit Message Language (auto, zh, en, ja, ko)
|
# 14. Permanently Set Default Commit Message Language (auto, zh, en, ja, ko)
|
||||||
git air config set --commit-lang en
|
git air config set --commit-lang en
|
||||||
|
|
||||||
|
# 15. Set Dedicated Custom Code Reviewer Prompt (Optional)
|
||||||
|
git air config set --reviewer-prompt "You are a principal Go architect focusing on concurrency and memory safety"
|
||||||
|
|
||||||
|
# 16. Set Dedicated Custom Commit Message Prompt (Optional)
|
||||||
|
git air config set --commit-msg-prompt "Always follow the strict Angular commit conventions"
|
||||||
```
|
```
|
||||||
|
|
||||||
Check current configuration (including masked keys and custom rates):
|
Check current configuration (including masked keys and custom rates):
|
||||||
@@ -174,6 +181,9 @@ git air internal/service/chat.go
|
|||||||
|
|
||||||
# Temporarily override provider or model
|
# Temporarily override provider or model
|
||||||
git air --provider deepseek --model deepseek-chat
|
git air --provider deepseek --model deepseek-chat
|
||||||
|
|
||||||
|
# Output structured JSON report (for CI/CD pipelines and scripts)
|
||||||
|
git air --format json
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -226,10 +236,11 @@ Install the hook inside any Git repository:
|
|||||||
git air hook install
|
git air hook install
|
||||||
```
|
```
|
||||||
- **Automated Commit Gate**: When `git-air` flags any `[BLOCKER]` issue or outputs a `[REJECT]` verdict, it automatically exits with a non-zero status code, **directly intercepting and blocking `git commit`**!
|
- **Automated Commit Gate**: When `git-air` flags any `[BLOCKER]` issue or outputs a `[REJECT]` verdict, it automatically exits with a non-zero status code, **directly intercepting and blocking `git commit`**!
|
||||||
|
- **Chain Execution of Existing Hooks**: If a `pre-commit` hook already exists, `git-air` automatically backs it up and **chains into your original hook** once review passes, without disrupting existing workflows.
|
||||||
- **Strict Mode (`--strict`)**: To block commits even on `[WARNING]` issues, use `git air --strict`;
|
- **Strict Mode (`--strict`)**: To block commits even on `[WARNING]` issues, use `git air --strict`;
|
||||||
- **Bypass Interception**: If you urgently need to bypass the check, use standard Git `git commit --no-verify` or pass `git air --no-block`.
|
- **Bypass Interception**: If you urgently need to bypass the check, use standard Git `git commit --no-verify` or pass `git air --no-block`.
|
||||||
|
|
||||||
To uninstall:
|
To uninstall and fully restore your original hook:
|
||||||
```bash
|
```bash
|
||||||
git air hook uninstall
|
git air hook uninstall
|
||||||
```
|
```
|
||||||
|
|||||||
+49
-85
@@ -45,12 +45,13 @@ GitHubなどのCI/CD上で動作するボットも優秀ですが、**`git-air`
|
|||||||
|
|
||||||
- ⚡ **Gitネイティブな極上の操作性**:いつもの作業フローを崩さず、ターミナルで `git air` と叩くだけで即座に起動。
|
- ⚡ **Gitネイティブな極上の操作性**:いつもの作業フローを崩さず、ターミナルで `git air` と叩くだけで即座に起動。
|
||||||
- 🧠 **主要モデルを完全網羅**:**Google Gemini 3.x、Anthropic Claude、xAI Grok、DeepSeek、Qwen、智譜 GLM、Kimi、ローカルOllama、OpenAI** などを設定なしで即座に切り替え可能。
|
- 🧠 **主要モデルを完全網羅**:**Google Gemini 3.x、Anthropic Claude、xAI Grok、DeepSeek、Qwen、智譜 GLM、Kimi、ローカルOllama、OpenAI** などを設定なしで即座に切り替え可能。
|
||||||
|
- 🔒 **ローカルでの機密情報自動マスキング**:LLM への送信前に秘密鍵、API Key、Bearer Token、DB接続文字列などを自動マスキング(情報漏洩リスクゼロ)。
|
||||||
- 🛡️ **スマートなノイズ除去**:`go.sum` や `package-lock.json`、自動生成された `*.pb.go` を自動除外。Token消費を抑え、思考ループを防ぎます。
|
- 🛡️ **スマートなノイズ除去**:`go.sum` や `package-lock.json`、自動生成された `*.pb.go` を自動除外。Token消費を抑え、思考ループを防ぎます。
|
||||||
- 🎯 **厳格なシニアエンジニア基準**:お世辞や無駄口は一切なし。並行処理の競合、デッドロック、SQLインジェクション、NULLポインタ、リソースリークを指摘し、具体的な修正コードを直接提示します。
|
- 🎯 **厳格なシニアエンジニア基準**:お世辞や無駄口は一切なし。並行処理の競合、デッドロック、SQLインジェクション、NULLポインタ、リソースリークを指摘し、具体的な修正コードを直接提示します。
|
||||||
- 📊 **Token消費量と費用のリアルタイム見積もり**:入出力Token数を正確に集計し、各社最新の公式料金表に基づいて実行コストを即座に計算(ローカル完全オフラインモデルは無料表示)。
|
- 📊 **Token消費量と費用のリアルタイム見積もり**:入出力Token数を正確に集計し、各社最新の公式料金表に基づいて実行コストを即座に計算(ローカル完全オフラインモデルは無料表示)。
|
||||||
- ✨ **AI コミットメッセージ自動生成**:変更差分から Conventional Commits 準拠の高品質なメッセージを生成(**日本語・英語・韓国語・中国語**に自動適応)。
|
- ✨ **AI コミットメッセージ自動生成**:変更差分から Conventional Commits 準拠の高品質なメッセージを生成(**日本語・英語・韓国語・中国語**に自動適応)。
|
||||||
- 📋 **チーム規約の読み込み(`.airules`)**:リポジトリ直下に `.airules` を配置するだけで、チーム固有のアーキテクチャ規約を最優先で適用。
|
- 📋 **チーム規約の読み込み(`.airules`)**:リポジトリ直下に `.airules` を配置するだけで、チーム固有のアーキテクチャ規約を最優先で適用。
|
||||||
- 🪝 **ワンクリックで Pre-commit フック化**:コマンド1発でGitフックとして登録。危険なコードのコミットを未然にブロックします。
|
- 🪝 **ワンクリックで Pre-commit フック化**:コマンド1発でGitフックとして登録(既存フックの自動バックアップ&チェーン実行に対応)。危険なコードのコミットを未然にブロックします。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -60,79 +61,37 @@ GitHubなどのCI/CD上で動作するボットも優秀ですが、**`git-air`
|
|||||||
$ git air
|
$ git air
|
||||||
|
|
||||||
[git-air] コードレビュー中... (Engine: gemini / gemini-3.7-flash)
|
[git-air] コードレビュー中... (Engine: gemini / gemini-3.7-flash)
|
||||||
────────────────────────────────# 13. カスタム Token 料金設定 (任意:組み込み料金表を上書き、単位: 米ドル/1M Tokens)
|
─────────────────────────────────────────────────────────────────
|
||||||
git air config set --price-input 0.75 --price-output 3.75
|
#### 変更概要
|
||||||
|
ユーザー認証ハンドラーに Redis キャッシュ層を追加し、Context のタイムアウト伝播を修正。
|
||||||
|
|
||||||
# 14. コミットメッセージのデフォルト言語を永続設定 (任意: auto, zh, en, ja, ko)
|
#### 詳細レビュー結果
|
||||||
git air config set --commit-lang ja
|
- [BLOCKER] internal/service/user.go:45 - 重大なセキュリティ脆弱性: ループ内で生SQL文字列を直接結合しています。SQLインジェクションのリスクがあります。
|
||||||
```
|
// 推奨修正コード:
|
||||||
|
db.Where("username = ?", inputName).First(&user)
|
||||||
|
|
||||||
現在の設定を確認(カスタム料金やマスク化Keyを含む):
|
- [WARNING] internal/service/user.go:82 - 潜在的リスク: Redis 接続エラーを握りつぶしています。キャッシュ障害時にDBへ負荷が集中します。
|
||||||
```bash
|
|
||||||
git air config get
|
- [WARNING] internal/service/user.go:103 - 並行処理の欠陥: 早期リターン時に Mutex の Unlock を忘れています(Mutex Leak)。デッドロックの危険性があります。
|
||||||
|
|
||||||
|
#### 結論
|
||||||
|
- 判定: [REJECT]
|
||||||
|
- スコア: 60 / 100
|
||||||
|
|
||||||
|
📊 Token: 入力 1,243 / 出力 412 | ≈ $0.0025
|
||||||
|
─────────────────────────────────────────────────────────────────
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 2. よく使うレビューコマンド
|
## 📦 インストール
|
||||||
|
|
||||||
|
### 方法 1: Go Install(推奨)
|
||||||
```bash
|
```bash
|
||||||
# 現在ステージングされた(git add済み)変更をレビュー(デフォルト)
|
go install github.com/unclesam-ly/git-air@latest
|
||||||
git air
|
|
||||||
|
|
||||||
# 直前のコミット内容をレビュー
|
|
||||||
git air HEAD~1
|
|
||||||
|
|
||||||
# ブランチ間の差分をレビュー
|
|
||||||
git air main..feature-agent
|
|
||||||
|
|
||||||
# 特定のファイルのみをレビュー
|
|
||||||
git air internal/service/chat.go
|
|
||||||
|
|
||||||
# 一時的にモデルやProviderを指定して実行
|
|
||||||
git air --provider deepseek --model deepseek-chat
|
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
### 方法 2: ソースコードからビルド
|
||||||
|
|
||||||
### 3. AI コミットメッセージ自動生成 (`git air msg`)
|
|
||||||
|
|
||||||
コミットメッセージの作成に悩む必要はもうありません。`git-air` がコードの変更差分を分析し、Conventional Commits 準拠のメッセージを**多言語自動適応**と**自動ステージング**で生成します:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 1. 基本的な使い方:差分を分析して対話型コミット
|
|
||||||
git air msg
|
|
||||||
|
|
||||||
# 2. 変更ファイルを自動ステージング(git add 不要)
|
|
||||||
git air msg -a
|
|
||||||
|
|
||||||
# 3. 単発で出力言語を指定(auto, zh, en, ja, ko)
|
|
||||||
git air msg -l en # 英語(オープンソース・国際プロジェクト向け)
|
|
||||||
git air msg -l ja # 日本語
|
|
||||||
git air msg -l ko # 韓国語
|
|
||||||
|
|
||||||
# 4. 最速ワンライナー:自動ステージング + 生成 + 即座にコミット
|
|
||||||
git air msg -a -c
|
|
||||||
|
|
||||||
# 5. グローバルデフォルト言語を永続設定(毎回 -l を付ける必要がなくなります)
|
|
||||||
git air config set --commit-lang ja # 今後常に日本語で生成
|
|
||||||
git air config set --commit-lang en # 今後常に英語で生成
|
|
||||||
git air config set --commit-lang auto # システム言語への自動追従に戻す
|
|
||||||
```
|
|
||||||
|
|
||||||
**実行イメージ:**
|
|
||||||
```text
|
|
||||||
$ git air msg -l ja
|
|
||||||
[git-air] Conventional Commit Message を生成中... (Language: 日本語 / Engine: gemini-3.7-flash)
|
|
||||||
─────────────────────────────────────────────────────────────────
|
|
||||||
feat(auth): Redisキャッシュを追加し、Mutexのデッドロックを修正
|
|
||||||
|
|
||||||
- ユーザー認証ハンドラーに Redis トークンキャッシュ層を導入
|
|
||||||
- 早期リターン時に Mutex の Unlock が漏れる並行処理のバグを修正
|
|
||||||
─────────────────────────────────────────────────────────────────
|
|
||||||
? このメッセージで直接 git commit を実行しますか?[Y/n]: y
|
|
||||||
[SUCCESS] コードのコミットに成功しました!🎉
|
|
||||||
```スコードからビルド
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/unclesam-ly/git-air.git
|
git clone https://github.com/unclesam-ly/git-air.git
|
||||||
cd git-air
|
cd git-air
|
||||||
@@ -190,6 +149,12 @@ git air config set --price-input 0.75 --price-output 3.75
|
|||||||
|
|
||||||
# 14. コミットメッセージのデフォルト言語を永続設定 (任意: auto, zh, en, ja, ko)
|
# 14. コミットメッセージのデフォルト言語を永続設定 (任意: auto, zh, en, ja, ko)
|
||||||
git air config set --commit-lang ja
|
git air config set --commit-lang ja
|
||||||
|
|
||||||
|
# 15. コードレビュー専用のカスタムプロンプトを設定 (任意)
|
||||||
|
git air config set --reviewer-prompt "並行処理とメモリ安全性を最重要視するGoシニアアーキテクトとしてレビューしてください"
|
||||||
|
|
||||||
|
# 16. コミットメッセージ専用のカスタムプロンプトを設定 (任意)
|
||||||
|
git air config set --commit-msg-prompt "AngularのConventional Commits規範に厳格に従って生成してください"
|
||||||
```
|
```
|
||||||
|
|
||||||
現在の設定を確認(カスタム料金やマスク化Keyを含む):
|
現在の設定を確認(カスタム料金やマスク化Keyを含む):
|
||||||
@@ -216,6 +181,9 @@ git air internal/service/chat.go
|
|||||||
|
|
||||||
# 一時的にモデルやProviderを指定して実行
|
# 一時的にモデルやProviderを指定して実行
|
||||||
git air --provider deepseek --model deepseek-chat
|
git air --provider deepseek --model deepseek-chat
|
||||||
|
|
||||||
|
# 構造化 JSON レポートを出力(CI/CD パイプラインや自動化スクリプト向け)
|
||||||
|
git air --format json
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -268,10 +236,11 @@ Git リポジトリ直下で以下を実行:
|
|||||||
git air hook install
|
git air hook install
|
||||||
```
|
```
|
||||||
- **コミット自動ブロック機能**:レビューで `[BLOCKER]` 重大欠陥や `[REJECT]` 判定が検出された場合、`git-air` は非ゼロの終了コードで**コミット(`git commit`)を自動的に中断・ブロック**します!
|
- **コミット自動ブロック機能**:レビューで `[BLOCKER]` 重大欠陥や `[REJECT]` 判定が検出された場合、`git-air` は非ゼロの終了コードで**コミット(`git commit`)を自動的に中断・ブロック**します!
|
||||||
|
- **既存フックのチェーン実行**:リポジトリに既存の `pre-commit` がある場合、自動的にバックアップされ、レビュー通過後に**元のフックをチェーン実行**します。
|
||||||
- **厳格モード (`--strict`)**:`[WARNING]` 警告でもコミットをブロックしたい場合は `git air --strict` を使用;
|
- **厳格モード (`--strict`)**:`[WARNING]` 警告でもコミットをブロックしたい場合は `git air --strict` を使用;
|
||||||
- **一時的なブロック解除**:緊急でコミットを強制したい場合は、Git 標準の `git commit --no-verify` または `git air --no-block` を付与します。
|
- **一時的なブロック解除**:緊急でコミットを強制したい場合は、Git 標準の `git commit --no-verify` または `git air --no-block` を付与します。
|
||||||
|
|
||||||
フックを解除する場合:
|
フックを解除し、元のフックを完全復元する場合:
|
||||||
```bash
|
```bash
|
||||||
git air hook uninstall
|
git air hook uninstall
|
||||||
```
|
```
|
||||||
@@ -294,7 +263,7 @@ git air update
|
|||||||
|
|
||||||
## ⚙️ 設定の優先順位
|
## ⚙️ 設定の優先順位
|
||||||
|
|
||||||
1. **コマンドライン引数** (`--key`, `--model`, `--provider`, `--prompt`, `--lang`, `--price-input`, `--price-output`, `--strict`, `--no-block`)
|
1. **コマンドライン引数** (`--key`, `--model`, `--provider`, `--prompt`, `--lang`, `--format`, `--price-input`, `--price-output`, `--strict`, `--no-block`)
|
||||||
2. **環境変数** (`GIT_AIR_API_KEY`, `GIT_AIR_PROVIDER`, `GIT_AIR_MODEL`, `GIT_AIR_COMMIT_LANG`)
|
2. **環境変数** (`GIT_AIR_API_KEY`, `GIT_AIR_PROVIDER`, `GIT_AIR_MODEL`, `GIT_AIR_COMMIT_LANG`)
|
||||||
3. **プロジェクト個別設定** (リポジトリ直下の `./config.yaml` または `./.git-air.yaml`)
|
3. **プロジェクト個別設定** (リポジトリ直下の `./config.yaml` または `./.git-air.yaml`)
|
||||||
4. **グローバル設定** (`~/.git-air/config.yaml`)
|
4. **グローバル設定** (`~/.git-air/config.yaml`)
|
||||||
@@ -309,10 +278,10 @@ model: "gemini-3.7-flash"
|
|||||||
# カスタム API エンドポイント (任意)
|
# カスタム API エンドポイント (任意)
|
||||||
# base_url: "https://api.deepseek.com/v1"
|
# base_url: "https://api.deepseek.com/v1"
|
||||||
|
|
||||||
# カスタム System Prompt (任意)
|
# カスタムプロンプト設定 (任意)
|
||||||
# custom_reviewer_prompt: ""
|
# custom_reviewer_prompt: ""
|
||||||
# custom_commit_msg_prompt: ""
|
# custom_commit_msg_prompt: ""
|
||||||
# 旧版互換フィールド(v1.x では引き続き使用可能)
|
# 旧版互換フィールド (v1.xで利用可能)
|
||||||
# custom_prompt: ""
|
# custom_prompt: ""
|
||||||
|
|
||||||
# カスタム Token 料金設定 (任意、単位: 米ドル / 1M Tokens)
|
# カスタム Token 料金設定 (任意、単位: 米ドル / 1M Tokens)
|
||||||
@@ -323,33 +292,28 @@ model: "gemini-3.7-flash"
|
|||||||
# commit_lang: "auto"
|
# commit_lang: "auto"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Prompt フィールドの移行について
|
### プロンプト設定フィールドの移行について
|
||||||
|
|
||||||
旧バージョンでは `custom_prompt` という共通フィールドのみを使用していました。しかし `git-air` はコード Review と AI Commit Message の両方を扱うため、同じ Prompt を共有すると指示が混在し、動作が分かりにくくなります。
|
旧バージョンでは単一の `custom_prompt` フィールドのみを提供していましたが、`git-air` がコードレビューと AI コミットメッセージ生成の両方に対応したため、2 つのシナリオでプロンプトの目的が異なります。
|
||||||
|
|
||||||
今後は、用途ごとに次のフィールドを使用してください。
|
そのため、現在のバージョン以降はそれぞれ個別のフィールドを使用することを推奨します:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
custom_reviewer_prompt: "コード Review 用 Prompt"
|
custom_reviewer_prompt: "コードレビュー用のカスタムプロンプト"
|
||||||
custom_commit_msg_prompt: "Commit Message 生成用 Prompt"
|
custom_commit_msg_prompt: "コミットメッセージ生成用のカスタムプロンプト"
|
||||||
```
|
```
|
||||||
|
|
||||||
旧 `custom_prompt` は当面互換性のためサポートされ、`custom_reviewer_prompt` として扱われます。
|
なお、旧版の `custom_prompt` は引き続き互換性が保たれ、`custom_reviewer_prompt` として自動的に扱われます。CLI からの設定方法:
|
||||||
|
|
||||||
移行コマンド:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git air config set --reviewer-prompt "Reviewer Prompt"
|
git air config set --reviewer-prompt "あなたの Reviewer Prompt"
|
||||||
git air config set --commit-msg-prompt "Commit Message Prompt"
|
git air config set --commit-msg-prompt "あなたの Commit Message Prompt"
|
||||||
```
|
```
|
||||||
|
|
||||||
廃止予定:
|
ライフサイクル方針:
|
||||||
|
- `v1.x`:`custom_prompt` を継続サポート;
|
||||||
- `v1.x`:`custom_prompt` を引き続きサポート;
|
- `v1.1.0`:非推奨(deprecated)として警告を表示;
|
||||||
- `v1.1.0`:deprecated として案内;
|
- `v2.0.0`:`custom_prompt` フィールドを完全削除。
|
||||||
- `v2.0.0`:`custom_prompt` を削除予定。
|
|
||||||
|
|
||||||
既存ユーザーの設定を壊さず、2 つの Prompt の役割を明確にするための変更です。
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user