# graftfork 中文文档

规范地址：https://npmcn.com/package/graftfork/

版本：0\.4\.2
npm 元数据更新时间：2026-11-03T17:41:43.818Z
中文译文更新时间：2026-11-03T18:56:42.353Z
软件包许可：Apache-2\.0

本文由上游 README 机器翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/graftfork
原文对照：https://npmcn.com/package/graftfork/?lang=original
项目主页：https://graftfork.com/docs/api

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：85.4 kB，4 个文件
- 模块格式：ES Module
- TypeScript 类型：未声明
- Node.js 要求：\>=22\.18
- 运行依赖：0 个
- 首次发布：2026-10-30T21:55:44.782Z
- 最新版本发布：2026-11-03T17:41:43.675Z
- 已发布版本数：8（近 12 个月 8 个）

## 中文简介

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

## 安装

```sh
npm install graftfork
```

也可以使用：`pnpm add graftfork`、`yarn add graftfork`、`bun add graftfork`

## README

# graftfork

下面的命令行 [graftfork](https://graftfork.com/) (移植)。Graft将您的更改保存在每个开源项目上 上游版本：它将您的更改移动到新版本上，运行您的测试，并为您保留移动的分支 除非每次改变都成功了，测试也通过了。否则你的副本会留在原处，格拉弗会告诉你原因。

这个包是graftfork.com的HTTP API的瘦客户端。同步在graftfork.com上运行，而不是在您的机器上。

```
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
```

也 `graft whoami`， `graft status` 和 `graft usage`； `--json` 打印API的答案，并且 `graft --help` 列出每个命令及其选项。

哪个版本有什么：0.1.0有拷贝、连接、同步、状态、为什么、拉、使用、whoami和验证记录；0.1.1 添加agent-record;0.2.0增加了check(s), upgrade(s)和upstream， upstream-status和upstream-pr；0.3.0补充道 重新连接，运行，状态和报告；0.3.1拒绝未知选项，增加——version和每命令——help，以及 清楚地说明为什么verify-record失败（——keys离线检查）。0.4.0增加了还原，设置，重新起草，重新排序和 重新断开连接，——max-usd同步和升级，JSON错误和退出码3/4/5的代理，和嫁接拉，从来没有 覆盖本地工作。0.4.2添加了 `graftfork` 命令(与 `graft`;在0.4.1中，它什么都不做)，在链接上验证-记录 GRAFTFORK\_TOKEN令牌的名称，以及命名graftfork及其版本的User-Agent。

用npx命名这个包： `npx graftfork verify-record <file>`． npm包调用 `graft` 是别人的。API文档: [https://graftfork.com/docs/api](https://graftfork.com/docs/api)． 电邮支援： [support@graftfork.com](mailto:support@graftfork.com)． apache - 2.0。

## 常见问题

### 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 和提交记录判断。

