利用 Git 標註 AI 生成的程式碼

利用 Git 標註 AI 生成的程式碼

Hacker News·

本文介紹了 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.

Image

Image

Image

Quick Start | CLI Reference | Squash & Merge Support

Image

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.

Image

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.

Image

Image

4. View Attribution

Make AI edits, commit, then view attribution in CLI or GitHub PRs:

Image

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

Image

Image

Languages

Footer

Footer navigation

Hacker News

相關文章

  1. Show HN:用於追蹤 AI 程式碼與提示的 Git 擴充功能

    3 個月前

  2. GitHub 瀏覽器插件:用於 PR 中的 AI 貢獻歸因

    3 個月前

  3. 利用 Git Submodules 實現 AI / LLM 代理指令的集中化方法

    3 個月前

  4. 用於追蹤AI程式碼的開源Git擴充功能

    3 個月前

  5. 運用 Git Worktrees 平行化 AI 編碼

    4 個月前