graftfork

中文文档
0.4.2发布于 2026/11/04Apache-2.0ES Module零依赖

The command line for graftfork.com: connect a copy, sync it, see why it stayed, and take each move. A thin client; syncs run on graftfork.com.

原始使用文档

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.

版本与发布记录

graftfork 共发布 8 个版本,首次发布于 2026/10/31;过去 12 个月发布了 8 个版本。

版本发布日期距今
0.4.2latest2026/11/04今天
0.4.12026/11/04今天
0.4.02026/11/03今天
0.3.12026/11/022 天前
0.3.02026/11/012 天前
0.2.02026/10/313 天前

关于 graftfork 的常见问题

graftfork 是什么?

graftfork.com的命令行:连接一个副本,同步它,看看为什么它保留,并采取每一个移动。瘦客户机;同步运行在graftfork.com。

如何安装 graftfork?

在项目目录运行 npm install graftfork,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 graft、graftfork,可以用 npx graft 直接运行。

graftfork 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/graftfork 是否存在。

graftfork 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

graftfork 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

graftfork 可以商用吗?

graftfork 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

graftfork 还在维护吗?

最新版本 0.4.2 发布于 2026/11/04(今天);至今共发布 8 个版本,其中过去 12 个月发布了 8 个;首次发布于 2026/10/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。