npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-attribution

v0.2.0

Published

OpenCode plugin: a commit tool that attributes commits by who launched the shell

Downloads

397

Readme

opencode-attribution

An OpenCode plugin that adds a commit tool: every commit an agent makes carries the right attribution automatically.

[!WARNING] Requires OpenCode 2 or newer. This plugin is built on the V2 plugin API (tool transforms, session context, permission hooks). It will not load on OpenCode 1.

Quick start

opencode plugin add opencode-attribution

Optional — who the co-author is (a repository may override it locally; the default is OpenCode <[email protected]>):

git config --global opencode.coauthor "aivi-agent[bot] <331678708+aivi-agent[bot]@users.noreply.github.com>"

Optional — hide the Harness: debug line (attribution is not affected):

// opencode.json(c)
{
  "plugins": [
    {
      "package": "opencode-attribution",
      "options": { "harness": false }
    }
  ]
}

That is all. No permission configuration: the plugin denies git commit in the shell tool itself.

The rule

Attribution follows who launched the shell, never what a prompt said:

| Launched by | Commit | | --- | --- | | An unattended agent (an aivi worker) | the agent is the sole author and committer — no trailers | | An agent with a person attending | the person is the author; the agent gets a Co-authored-by and a Harness: line | | A person in their own terminal | untouched |

What it does

  • Registers the commit tool — thin over git commit: stage with git add, call the tool with a message (plus optional extra git commit arguments).

  • An attended commit gets two trailers via git commit --trailer (git ≥ 2.22):

    Co-authored-by: aivi-agent[bot] <331678708+aivi-agent[bot]@users.noreply.github.com>
    Harness: OpenCode v2.0.11, mlx-serve/Qwen3.8-Flash-Next

    Harness: is one line of debug metadata: the OpenCode version and the session's providerID/modelID. GitHub renders it as plain text; only Co-authored-by links to a profile. It can be turned off with the harness plugin option — the co-author trailer is always added.

  • Denies git commit through the shell tool, with the commit tool named as the reason — agents are redirected, never stuck. OpenCode's permission scanner splits chained commands, so git add x && git commit is denied too. The deny follows the plugin: a global install covers every session on the machine; don't install it globally where you don't want it. A person's own terminal is never affected — permission evaluation only exists for tool calls.

aivi and agent.autonomous

The plugin reads git config --get agent.autonomous in the session's working directory. This is the default in aivi worker worktrees: when aivi launches an unattended worker it sets user.name and user.email to the bot and agent.autonomous = true per worktree. With the flag set, the commit tool adds no trailers — the bot is already the author and committer, and a co-author trailer on the bot's own work would be wrong.

Known gaps, stated not hidden

  • bash -c 'git commit' and env-prefixed forms can slip past the deny; the plugin only sees what goes through the permission system.
  • A machine without the plugin gets no attribution — correct: nothing there launched an agent either.
  • An attended session inside an autonomous worktree gets no trailers, even though a person is attending.

Development

Node ≥ 26 (the source is type-stripped TypeScript, executed directly), git ≥ 2.22.

npm install
npm run agentic:verify

License

MIT