The problem with vendoring is what happens after you edit your copy: upstream keeps improving, but their changes have nowhere to land, so your copy slowly goes stale. regraft remembers what it gave you — and why you changed it.
$ curl -fsSL https://raw.githubusercontent.com/treadiehq/regraft/main/scripts/install.sh | bashadd → edit → note → pull → resolve. That's it.
┌──────────────────┐ regraft add ┌─────────────────────┐
│ upstream repo │───────────────────▶│ your repo │
│ (any git host) │ │ lib/components/ │
└────────┬─────────┘ │ regraft.json ✓ │
│ │ PATCH.md ✓ │
│ new commits └──────────┬──────────┘
▼ │ edit + note
┌──────────────────┐ regraft pull │
│ three-way merge │◀──────────────────────────────┘
│ (diff3) │
└────────┬─────────┘
│
┌────┴─────────────────┐
▼ ▼
no overlap conflict
merges on its own markers + brief ──▶ regraft resolveregraft add vendors the files and pins the source to a commit in regraft.json, with a hash of every file it wroteregraft note — one sentence, committed in PATCH.mdregraft pull compares stored, disk, and upstream state — non-overlapping changes merge silently with a real three-way mergeregraft resolveA committed manifest (regraft.json) pins each source to a commit and hashes every file it wrote. It always knows whether you changed a file, upstream did, or both.
After editing, write one sentence with regraft note. Notes collect in a committed PATCH.md — so conflicts arrive with your reasons, not just a diff.
Merges use git merge-file --diff3. regraft knows the version your edits started from, and conflict markers include it, so you can see what both sides changed.
When a merge needs judgment, regraft stops and writes a reconciliation brief: the conflicts, your intent notes, and the upstream commit log. You or your agent makes the call.
Sources are fetched with your own git. If git clone works — GitHub, GitLab, self-hosted, private — regraft works. No tokens, no rate limits.
regraft status exits 1 when anything needs attention. Every command takes --json with stable output shapes agents can pattern-match on.
Whole repos, directories, single files, branches, tags — even a PR head, which is a moving branch, so pull keeps following it.
Fetching uses your own git and your existing credentials — GitHub, GitLab, self-hosted, private. No tokens, no rate limits.
A few habits that pay off once vendored code is part of your codebase.
regraft does the deterministic work: fetch, hash, merge. When a merge needs judgment, it stops and writes a brief instead of guessing — and whoever picks up the brief, you or a coding agent, makes the call.
If an agent works in your repo, point it at skills/regraft/SKILL.md.
Vendoring, merging, and where regraft draws the line.
Open source under FSL-1.1-MIT. Install it and vendor your first source in a minute.