diff --git a/README.md b/README.md index 19fc6e9..1f6e2a0 100644 --- a/README.md +++ b/README.md @@ -178,21 +178,36 @@ git air --provider deepseek --model deepseek-chat ### 3. AI 智能生成规范 Commit Message (`git air msg`) -写代码一时爽,写 Commit 抓耳挠腮?`git-air` 会根据你的暂存区改动,自动生成符合国际 Conventional Commits 规范的提交说明,并支持**多语言智能自适应**: +写代码一时爽,写 Commit 抓耳挠腮?`git-air` 会根据你的代码改动,自动生成符合国际 Conventional Commits 规范的精炼提交说明,并支持**中/英/日/韩多语言智能自适应**与**自动暂存**: ```bash -# 1. 自动根据系统语言生成并交互式确认提交 +# 1. 基础用法:分析暂存区代码并交互式确认提交 git air msg -# 2. 生成英文提交说明(适合开源或国际化项目) -git air msg -l en +# 2. 自动暂存所有改动并生成提交(无需手动 git add) +git air msg -a -# 3. 生成日语 / 韩语提交说明 -git air msg -l ja -git air msg -l ko +# 3. 指定输出自然语言(支持 auto, zh, en, ja, ko) +git air msg -l en # 生成英文说明(适合 GitHub 开源项目) +git air msg -l ja # 生成日语说明 +git air msg -l ko # 生成韩语说明 -# 4. 生成后无需确认直接执行 git commit -git air msg -c +# 4. 极速一条龙:自动暂存 + 生成 + 免确认直接提交 +git air msg -a -c +``` + +**效果演示:** +```text +$ git air msg -l zh +[git-air] 正在生成 Conventional Commit Message... (Language: 简体中文 / Engine: gemini-3.7-flash) +───────────────────────────────────────────────────────────────── +feat(auth): 引入 Redis 缓存并修复 Mutex 死锁隐患 + +- 在用户认证模块新增 Redis Token 缓存机制 +- 修复提前 return 时未释放互斥锁的并发隐患 +───────────────────────────────────────────────────────────────── +? 是否直接以此信息执行 git commit?[Y/n]: y +[SUCCESS] 代码提交成功!🎉 ``` --- diff --git a/README_EN.md b/README_EN.md index 7bd17ae..8d94d16 100644 --- a/README_EN.md +++ b/README_EN.md @@ -177,19 +177,36 @@ git air --provider deepseek --model deepseek-chat ### 3. AI-Powered Commit Message Generation (`git air msg`) -Struggling to write concise commit messages? `git-air` inspects your staged changes and crafts a clean Conventional Commits message with **automatic language detection**: +Struggling to write concise commit messages? `git-air` inspects your code changes and automatically crafts a clean Conventional Commits message with **auto-language adaptation** and **auto-staging**: ```bash -# 1. Generate based on your system locale & interactively commit +# 1. Basic usage: analyze staged changes & interactively commit git air msg -# 2. Explicitly specify target language (e.g. English, Japanese, Korean) -git air msg -l en -git air msg -l ja -git air msg -l ko +# 2. Auto-stage all modified files (no need for manual git add) +git air msg -a -# 3. Generate and directly commit without confirmation -git air msg -c +# 3. Explicitly specify natural language (auto, zh, en, ja, ko) +git air msg -l en # English (ideal for open-source repos) +git air msg -l ja # Japanese +git air msg -l ko # Korean + +# 4. Instant one-liner: auto-stage + generate + direct commit +git air msg -a -c +``` + +**Terminal Preview:** +```text +$ git air msg -l en +[git-air] Generating Conventional Commit Message... (Language: English / Engine: gemini-3.7-flash) +───────────────────────────────────────────────────────────────── +feat(auth): add Redis token caching and fix mutex deadlock + +- Introduce Redis caching layer for user authentication +- Fix concurrency bug where mutex was not unlocked on early return +───────────────────────────────────────────────────────────────── +? Execute git commit with this message? [Y/n]: y +[SUCCESS] Code committed successfully! 🎉 ``` --- diff --git a/README_JA.md b/README_JA.md index 6cc4f0a..d8435cf 100644 --- a/README_JA.md +++ b/README_JA.md @@ -177,21 +177,36 @@ git air --provider deepseek --model deepseek-chat ### 3. AI コミットメッセージ自動生成 (`git air msg`) -コミットメッセージの作成に悩む必要はもうありません。`git-air` がステージングされた差分を分析し、Conventional Commits 準拠のメッセージを**多言語自動適応**で生成します: +コミットメッセージの作成に悩む必要はもうありません。`git-air` がコードの変更差分を分析し、Conventional Commits 準拠のメッセージを**多言語自動適応**と**自動ステージング**で生成します: ```bash -# 1. システム言語を自動検出して生成 & 対話型コミット +# 1. 基本的な使い方:差分を分析して対話型コミット git air msg -# 2. 英語で生成(オープンソース・国際プロジェクト向け) -git air msg -l en +# 2. 変更ファイルを自動ステージング(git add 不要) +git air msg -a -# 3. 日本語 / 韓国語で生成 -git air msg -l ja -git air msg -l ko +# 3. 出力言語を明示的に指定(auto, zh, en, ja, ko) +git air msg -l en # 英語(オープンソース・国際プロジェクト向け) +git air msg -l ja # 日本語 +git air msg -l ko # 韓国語 -# 4. 確認なしで直接 git commit を実行 -git air msg -c +# 4. 最速ワンライナー:自動ステージング + 生成 + 即座にコミット +git air msg -a -c +``` + +**実行イメージ:** +```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] コードのコミットに成功しました!🎉 ``` ---