@e4779/co-author0.2.0
pi extension: auto-append Co-authored-by trailers with the model's identity
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
co-author
Adds a Co-authored-by: trailer to git commit commands the agent runs
through the bash tool, naming the model that wrote the change.
What it does
On tool_call for bash, a command that runs the commit subcommand —
git commit …, also behind global options such as git -c x=y commit —
gets
--trailer "Co-authored-by: <Name> <email>"
inserted right after the commit token. Everything else is left alone:
git log --grep commit, git commit-tree, dry runs, --help, and
commits that already carry a --trailer.
The identity is looked up for the current model:
~/.pi/agent/coauthors.json—model.id→{ "name", "email" }.- Without a usable entry, one derived from the model id:
zai/glm-5.4→glm-5.4 <glm-5.4@ai.local>.
The map lives in the home directory
~/.pi/agent/coauthors.json is per user and per machine: it never ships
with the package and is never read from the repository being committed.
Format, one entry per model id:
{
"zai/glm-5.4": { "name": "GLM-5.4", "email": "glm@example.invalid" }
}
Fail-open: a missing or invalid file, a model without an entry, or an
entry that is not two plain strings falls back to the derived identity —
a quote, a backtick, a $ or a backslash in either field would end the
quoted trailer early on the command line. A model id that yields no
identity leaves the command untouched.
Limits
A regex finds the commit, not a shell parser: git commit text inside an
earlier quoted string or heredoc is matched first.