graftfork
The command line for graftfork (Graft). Graft keeps your changes to an open-source project on each upstream release: it moves your changes onto the new release, runs your tests, and keeps the moved branch for you only if every change lands and the tests pass. Otherwise your copy stays where it was and Graft says why.
This package is a thin client for graftfork.com's HTTP API. Syncs run on graftfork.com, not on your machine.
npm install -g graftfork # Node 22.18 or newer; the command is `graft` (or `graftfork`)
export GRAFT_TOKEN=graft_... # make a token at https://graftfork.com/app#settings (GRAFTFORK_TOKEN works too)
graft copies # your copies and where each one is
graft connect you/project # connect a repository Graft's GitHub app is installed on
graft sync # start a sync now (inside the clone, or pass the copy)
graft why # why the copy stayed, and what to do next
graft pull # fetch the latest move as graft/<release>; your branch is untouched
graft upstream "fix the parser" # Graft builds that one change alone on your release and runs your tests;
# this fetches graft/upstream/<change>. Nothing is pushed: you open the PR
graft upstream-status <build> # an upstream build's status, tests and links
graft upstream-pr <build> <url> # the pull request you opened; Graft tells you when it's merged
graft upgrade <dependency> # upgrade one dependency (npm or Python), delivered only if the tests pass
graft upgrades # your upgrades and what their tests said
graft check <base> <head> --wait # check a change against the project's own tests: exit 0 pass, 1 fail, 2 couldn't run
graft checks # your recent change checks
graft verify-record <file> # check a signed run record or agent change record; no token needed.
# A link works too: a raw file, a GitHub file, or a GitHub folder
graft agent-record <org> # an organization's signed agent change record, as JSON
graft regen connect <repo> ... # connect a spec (a duramen record); Graft rebuilds its implementation blind
graft regen run <spec> # rebuild it now
graft regen status [id] # your specs, a spec's rebuilds, or one rebuild and how to take it
graft regen report <spec> # the spec's grade and why, before anything is spent
Also graft whoami, graft status and graft usage; --json prints the API's answers as they are, and
graft --help lists every command with its options.
Which version has what: 0.1.0 had copies, connect, sync, status, why, pull, usage, whoami and verify-record; 0.1.1
added agent-record; 0.2.0 added check(s), upgrade(s) and upstream, upstream-status and upstream-pr; 0.3.0 added
regen connect, run, status and report; 0.3.1 refuses unknown options, adds --version and per-command --help, and
says plainly why verify-record failed (--keys checks offline). 0.4.0 adds revert, set, regen draft, regen order and
regen disconnect, --max-usd on sync and upgrade, JSON errors and exit codes 3/4/5 for agents, and a graft pull that never
overwrites local work. 0.4.2 adds the graftfork command (the same program as graft; in 0.4.1 it did nothing), verify-record on a link, the
GRAFTFORK_TOKEN name for the token, and a User-Agent naming graftfork and its version.
With npx, name the package: npx graftfork verify-record <file>. The npm package called graft is someone else's. API docs:
https://graftfork.com/docs/api. Support by email: [email protected]. Apache-2.0.