利用 Git 標註 AI 生成的程式碼
本文介紹了 Agent Blame 工具,該工具可與 Git 整合,追蹤和標註由 AI 生成的程式碼與人類編寫的程式碼,旨在提升程式碼審查的重點。
Navigation Menu
Search code, repositories, users, issues, pull requests...
Provide feedback
We read every piece of feedback, and take your input very seriously.
Saved searches
Use saved searches to filter your results more quickly
To see all available qualifiers, see our documentation.
AI code attribution for git. Track which lines were written by AI vs humans.
License
Uh oh!
There was an error while loading. Please reload this page.
mesa-dot-dev/agentblame
Folders and files
Latest commit
History
Repository files navigation
Agent Blame
Know what the AI wrote. Focus your code reviews where it matters.
Quick Start | CLI Reference | Squash & Merge Support

Orange markers highlight AI-generated lines in GitHub PRs
What It Does
Agent Blame tracks AI-generated code in your Git history:
Prerequisites
Quick Start
1. Install & Set Up
Install the CLI globally
Then in a git repository run
This sets up everything automatically for your repository:
Important: Restart Cursor/Claude Code after installation.

2. Commit the Workflow
In order preserve attribution across when squash merging you need a custom GitHub Actions workflow.
You can either copy + paste that into your own repo or rely on the init command to do it for you.
When you merge a PR with squash/rebase, the original commits are replaced with new ones. The GitHub Actions workflow automatically:
If you do not want to use a workflow you can manually sync attribution after pulling a squash merge locally:
3. Install Chrome Extension
See AI attribution directly on GitHub Pull Requests.
Option A: Chrome Web Store (Recommended)
Option B: Manual Install
GitHub Token
You can use either GitHub's Fine Grained Tokens (recommended) or the classic tokens.


4. View Attribution
Make AI edits, commit, then view attribution in CLI or GitHub PRs:

Chrome Extension Features
CLI Reference
How It Works
Troubleshooting
Contributing
Prerequisites
Setup
Commands
Project Structure
Publishing
npm:
Chrome: Automatically built on GitHub releases.
Roadmap
Contributions welcome! Here's what we'd love help with:
License
Apache 2.0
Made by Mesa.dev
About
AI code attribution for git. Track which lines were written by AI vs humans.
Resources
License
Contributing
Uh oh!
There was an error while loading. Please reload this page.
Stars
Watchers
Forks
Releases
1
Packages
0
Contributors
2
Languages
Footer
Footer navigation
相關文章