HexmosTech/git-lrc
GitHub: HexmosTech/git-lrc
一个在 Git 提交时自动触发 AI 代码审查的工具,防止 AI 生成代码引入未发现的缺陷。
Stars: 710 | Forks: 100
| [🇩🇰 Dansk](readme/README.da.md) | [🇪🇸 Español](readme/README.es.md) | [🇮🇷 Farsi](readme/README.fa.md) | [🇫🇮 Suomi](readme/README.fi.md) | [🇯🇵 日本語](readme/README.ja.md) | [🇳🇴 Norsk](readme/README.nn.md) | [🇵🇹 Português](readme/README.pt.md) | [🇷🇺 Русский](readme/README.ru.md) | [🇦🇱 Shqip](readme/README.sq.md) | [🇨🇳 中文](readme/README.zh.md) |
git-lrc
Free, Unlimited AI Code Reviews That Run on Commit
AI agents write code fast. They also _silently remove logic_, change behavior, and introduce bugs -- without telling you. You often find out in production. **`git-lrc` fixes this.** It hooks into `git commit` and reviews every diff _before_ it lands. 60-second setup. Completely free. ## See It In Action https://github.com/user-attachments/assets/cc4aa598-a7e3-4a1d-998c-9f2ba4b4c66e ## 为什么 - 🤖 **AI agents silently break things.** Code removed. Logic changed. Edge cases gone. You won't notice until production. - 🔍 **Catch it before it ships.** AI-powered inline comments show you _exactly_ what changed and what looks wrong. - 🔁 **Build a habit, ship better code.** Regular review → fewer bugs → more robust code → better results in your team. - 🔗 **Why git?** Git is universal. Every editor, every IDE, every AI toolkit uses it. Committing is mandatory. So there's _almost no chance of missing a review_ — regardless of your stack. ## 开始使用 ### 安装 #### 通过 IPM(推荐): ``` # Linux/macOS curl -L https://hexmos.com/ipm-install | bash && ipm i HexmosTech/git-lrc # Windows iwr https://hexmos.com/ipm-install-ps | iex; ipm i HexmosTech/git-lrc ``` #### 替代(直接安装): **Linux / macOS:** ``` curl -fsSL https://hexmos.com/lrc-install.sh | bash ``` **Windows (PowerShell):** ``` iwr -useb https://hexmos.com/lrc-install.ps1 | iex ``` Binary installed. Hooks set up globally. Done. ### 设置 ``` git lrc setup ``` Here's a quick video of how setup works: https://github.com/user-attachments/assets/392a4605-6e45-42ad-b2d9-6435312444b5 Two steps, both open in your browser: 1. **LiveReview API key** — sign in with Hexmos 2. **Free Gemini API key** — grab one from Google AI Studio **~1 minute. One-time setup, machine-wide.** After this, _every git repo_ on your machine triggers review on commit. No per-repo config needed. ## 它是如何工作的 ### 选项 A:提交时审查(自动) ``` git add . git commit -m "add payment validation" # 审查在提交通过前自动启动 ``` ### 选项 B:提交前审查(手动) ``` git add . git lrc review # run AI review first # 或:git lrc review --vouch # 个人担保,跳过 AI # 或:git lrc review --skip # 完全跳过审查 git commit -m "add payment validation" ``` Either way, a web UI opens in your browser. https://github.com/user-attachments/assets/ae063e39-379f-4815-9954-f0e2ab5b9cde ### 审查界面 - 📄 **GitHub-style diff** — color-coded additions/deletions - 💬 **Inline AI comments** — at the exact lines that matter, with severity badges - 📝 **Review summary** — high-level overview of what the AI found - 📁 **Staged file list** — see all staged files at a glance, jump between them - 📊 **Diff summary** — lines added/removed per file for a quick sense of change scope - 📋 **Copy issues** — one click to copy all AI-flagged issues, ready to paste back into your AI agent - 🔄 **Cycle through issues** — navigate between comments one by one without scrolling - 📜 **Event log** — track review events, iterations, and status changes in one place https://github.com/user-attachments/assets/b579d7c6-bdf6-458b-b446-006ca41fe47d ### 决定 | Action | What happens | | -------------------- | -------------------------------------- | | ✅ **Commit** | Accept and commit the reviewed changes | | 🚀 **Commit & Push** | Commit and push to remote in one step | | ⏭️ **Skip** | Abort the commit — go fix issues first | ``` 📎 Screenshot: Pre-commit bar showing Commit / Commit & Push / Skip buttons ``` ## 审查周期 Typical workflow with AI-generated code: 1. **Generate code** with your AI agent 2. **`git add .` → `git lrc review`** — AI flags issues 3. **Copy issues, feed them back** to your agent to fix 4. **`git add .` → `git lrc review`** — AI reviews again 5. Repeat until satisfied 6. **`git lrc review --vouch`** → **`git commit`** — you vouch and commit Each `git lrc review` is an **iteration**. The tool tracks how many iterations you did and what percentage of the diff was AI-reviewed (**coverage**). ### 担保 Once you've iterated enough and you're satisfied with the code: ``` git lrc review --vouch ``` This says: _"I've reviewed this — through AI iterations or personally — and I take responsibility."_ No AI review runs, but coverage stats from prior iterations are recorded. ### 跳过 Just want to commit without review or responsibility attestation? ``` git lrc review --skip ``` No AI review. No personal attestation. The git log will record `skipped`. ## Git 日志跟踪 Every commit gets a **review status line** appended to its git log message: ``` LiveReview Pre-Commit Check: ran (iter:3, coverage:85%) ``` ``` LiveReview Pre-Commit Check: vouched (iter:2, coverage:50%) ``` ``` LiveReview Pre-Commit Check: skipped ``` - **`iter`** — number of review cycles before committing. `iter:3` = three rounds of review → fix → review. - **`coverage`** — percentage of the final diff already AI-reviewed in prior iterations. `coverage:85%` = only 15% of the code is unreviewed. Your team sees _exactly_ which commits were reviewed, vouched, or skipped — right in `git log`. ## 自带 AI 连接器(BYOK) In addition to the default Gemini setup, you can bring your own API keys for: - OpenAI - Claude - DeepSeek - OpenRouter Use: ``` lrc ui ``` From the UI, you can: - Re-authenticate your account - Add or update AI connectors - Reorder connectors to set priority By default, the **first connector in the list** is used for reviews.  ## 可信赖的安全 - Security is treated as a core product requirement in git-lrc. - We document reporting channels, response commitments, and operational safeguards clearly. - Automated security checks and SBOM workflows support transparent verification. - For complete details, see [SECURITY.md](SECURITY.md). ## 常见问题 ### 审查与担保、跳过有何不同? | |Review** | **Vouch** | **Skip** | | --------------------- | --------------------------- | ------------------------------- | ------------------------- | | AI reviews the diff? | ✅ Yes | ❌ No | ❌ No | | Takes responsibility? | ✅ Yes | ✅ Yes, explicitly | ⚠️ No | | Tracks iterations? | ✅ Yes | ✅ Records prior coverage | ❌ No | | Git log message | `ran (iter:N, coverage:X%)` | `vouched (iter:N, coverage:X%)` | `skipped` | | When to use | Each review cycle | Done iterating, ready to commit | Not reviewing this commit | **Review** is the default. AI analyzes your staged diff and gives inline feedback. Each review is one iteration in the change–review cycle. **Vouch** means you're _explicitly taking responsibility_ for this commit. Typically used after multiple review iterations — you've gone back and forth, fixed issues, and are now satisfied. The AI doesn't run again, but your prior iteration and coverage stats are recorded. **Skip** means you're not reviewing this particular commit. Maybe it's trivial, maybe it's not critical — the reason is yours. The git log simply records `skipped`. ### 它为何免费? `git-lrc` uses **Google's Gemini API** by default for AI reviews, and also supports BYOK connectors (OpenAI, Claude, DeepSeek, OpenRouter) — see [Bring Your Own AI Connector (BYOK)](#bring-your-own-ai-connector-byok). Gemini offers a generous free tier. You bring your own API key(s) — there's no middleman billing. The LiveReview cloud service that coordinates reviews is free for individual developers. ### 我可以使用哪些 AI 提供商进行 BYOK? You can connect Gemini (default), OpenAI, Claude, DeepSeek, and OpenRouter. Manage connectors from: ``` lrc ui ``` ### 如何选择用于审查的连接器? Open: ``` lrc ui ``` Then reorder your connector list. The first connector is used by default when a review runs. ### 我可以稍后重新认证或更改连接器吗? Yes. Run `lrc ui` anytime to re-authenticate, add/remove connectors, and update connector priority. ### 发送了什么数据? Only the **staged diff** is analyzed. No full repository context is uploaded, and diffs are not stored after review. ### 我可以为特定仓库禁用它吗? ``` git lrc hooks disable # disable for current repo git lrc hooks enable # re-enable later ``` ### 我可以审查旧的提交吗? ``` git lrc review --commit HEAD # review the last commit git lrc review --commit HEAD~3..HEAD # review a range ``` ## 快速参考 | Command | Description | | --------------------------------------- | -------------------------------------------------------- | | `lrc setup` | Guided onboarding and initial auth/config | | `lrc ui` | Open local UI to re-auth, manage BYOK connectors, priority | | `lrc` or `lrc review` | Run a review with sensible defaults | | `lrc review --staged` | Review staged changes only | | `lrc review --commit HEAD` | Review a specific commit | | `lrc review --commit HEAD~3..HEAD` | Review a commit range | | `lrc review --range HEAD~1..HEAD` | Review a git diff range (working/staged override) | | `lrc review --vouch` | Vouch — skip AI, take personal responsibility | | `lrc review --skip` | Skip review for this commit | | `lrc hooks install` | Install global hook dispatcher | | `lrc hooks uninstall` | Remove global hook dispatcher and managed scripts | | `lrc hooks enable` | Enable hooks for current repo | | `lrc hooks disable` | Disable hooks for current repo | | `lrc hooks status` | Show hook status for current repo | | `lrc self-update` | Update to latest version | | `lrc version` | Show version info | ## 它是免费的。与朋友和同事分享。 `git-lrc` is **completely free.** No credit card. No trial. No catch. If it helps you — **share it with your developer friends.** The more people review AI-generated code, the fewer bugs make it to production. ⭐ **[Star this repo](https://github.com/HexmosTech/git-lrc)** to help others discover it. ## 社区 Pick the right place based on what you need: - **Discord**: [discord.gg/sGdnKwB3qq](https://discord.gg/sGdnKwB3qq) - Best for joining the community, asking general Q&A, and having quick back-and-forth with the team. - **GitHub Discussions**: [github.com/HexmosTech/git-lrc/discussions](https://github.com/HexmosTech/git-lrc/discussions) - For in-depth idea proposals, scoping, design discussions, modification proposals, and constructive criticism. - **GitHub Issues**: [github.com/HexmosTech/git-lrc/issues](https://github.com/HexmosTech/git-lrc/issues) - For concrete, scoped tasks such as bugs, focused feature requests, and actionable implementation work. ## 许可证 `git-lrc` is distributed under a modified variant of **Sustainable Use License (SUL)**. For detailed terms, examples of permitted and prohibited uses, and definitions, see the full [LICENSE.md](LICENSE.md). ## 团队版:LiveReview
标签:AI, AI代码审查, AI编程, DevOps工具, EVTX分析, GitHub Actions, Go语言, Product Hunt, 二进制发布, 云安全监控, 云端工具, 代码审查工具, 代码审查平台, 免费工具, 即时反馈, 多语言支持, 威胁情报, 安全测试框架, 开发者工具, 开源工具, 开源框架, 技术社区, 持续集成, 提交触发, 无限制AI, 日志审计, 程序破解, 网络安全研究, 自动化代码审查, 自动笔记, 静态分析