@shelken/pi-co-authored-by
agent 执行 git commit 时自动追加 Co-Authored-By / Generated-By trailer
Package details
Install @shelken/pi-co-authored-by from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@shelken/pi-co-authored-by- Package
@shelken/pi-co-authored-by- Version
0.2.14- Published
- Sep 4, 2026
- Downloads
- 561/mo · 52/wk
- Author
- shelken
- License
- MIT
- Types
- extension
- Size
- 15.3 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-co-authored-by
agent 用 bash 跑 git commit 时,自动追加 trailer:
Co-Authored-By: <model> <noreply@pi.dev>
Generated-By: pi <version>
实现:识别 bash 命令中直接执行的 git commit(支持常见前缀与组合,脚本内间接 commit 不算),将命令交给外部 runner 在真实 hooks 目录临时安装 prepare-commit-msg(不改 core.hooksPath);pid 引用计数,shell 退出时最后一个引用卸装并恢复原 hook。非 commit 命令原样放行,不影响其他扩展。
初始 fork 自 bruno-garcia/pi-co-authored-by。
功能
- 只挂钩
bash工具调用 - 只处理直接执行的
git commit;printf、git status、脚本内 commit 等一律不改 - 模型名取当前 session;没有则
unknown - 与仓库已有 hook 兼容(先跑临时 hook,再链式原 hook)
安装
pi install npm:@shelken/pi-co-authored-by
装好后 /reload。之后 agent 提交即可,无需额外命令。
配置
无配置文件。
验证
bun --filter @shelken/pi-co-authored-by test