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

@mirego/opencode-forra-attribution

v0.1.3

Published

OpenCode plugin that attaches Forra usage attribution headers from local git context

Readme

@mirego/opencode-forra-attribution

OpenCode plugin that attaches Forra usage-attribution headers from the local git context on every outbound LLM request. With this installed, compatible-API usage is attributed to the current repository and branch without per-session configuration.

Requirements

  • OpenCode with plugin support (@opencode-ai/plugin ≥ 1.18.0)
  • git available on PATH
  • A Forra-compatible provider configured in your OpenCode config

Installation (local development)

From the monorepo root:

./tools/opencode-forra-attribution/install.sh

This symlinks the plugin into .opencode/plugins/ so OpenCode auto-loads it at startup. Restart OpenCode after installing.

For all projects (global install during development):

mkdir -p ~/.config/opencode/plugins
ln -sfn "$(pwd)/tools/opencode-forra-attribution/src/index.ts" \
  ~/.config/opencode/plugins/forra-attribution.ts

Soon: publish as @mirego/opencode-forra-attribution on npm. After that, add the package name to the plugin array in ~/.config/opencode/opencode.json and OpenCode will install it automatically.

Headers sent

| Header | Source | |--------|--------| | x-git-project | Normalized owner/repo from git remote get-url origin | | x-git-branch | Current branch from git branch --show-current | | x-opencode-session-id | OpenCode session ID | | x-api-agent-id | OpenCode agent name |

Headers are only attached when the provider baseURL looks like Forra — the URL contains mirego.com, forra-ai.com, or localhost:8000. Other providers (e.g. public OpenAI/Anthropic) are left untouched.

Git context is read on every matching request, so branch switches within a session are reflected immediately.

Project label normalization

Remote URLs are normalized to a stable owner/repo label (lowercased, .git stripped) so SSH and HTTPS clones of the same repository share one report entry:

| Remote | Label | |--------|-------| | [email protected]:mirego/mirego-scout.git | mirego/mirego-scout | | https://github.com/mirego/mirego-scout.git | mirego/mirego-scout | | https://gitlab.com/mirego/mirego-scout.git | mirego/mirego-scout |

Override and disable

| Variable | Effect | |----------|--------| | FORRA_GIT_PROJECT | Override the git-project header value | | FORRA_GIT_BRANCH | Override the git-branch header value | | FORRA_GIT_ATTRIBUTION=off (or 0 / false / no) | Skip all header injection |

Environment variables are read at request time.

Graceful degradation

Outside a git repository, or when origin is missing, git headers are omitted and the session continues normally. Session and agent headers are still sent when available. The plugin never throws from the request path.

Development

cd tools/opencode-forra-attribution
npm install
npm test
npm run type-check