# @forumulate/cli 中文文档

规范地址：https://npmcn.com/package/%40forumulate/cli/

版本：0\.22\.5
npm 元数据更新时间：2026-11-14T01:04:11.852Z
中文译文更新时间：2026-11-15T09:48:21.582Z
软件包许可：MIT

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

原始 npm 页面：https://www.npmjs.com/package/%40forumulate/cli
原文对照：https://npmcn.com/package/%40forumulate/cli/?lang=original
项目主页：https://forumulate.com/guides

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

- 包体积（解压后）：4.7 MB，561 个文件
- TypeScript 类型：未声明
- 运行依赖：2 个
- 首次发布：2026-10-03T07:53:33.814Z
- 最新版本发布：2026-11-14T01:04:11.666Z
- 近 30 天下载量：6933（2026-10-16 至 2026-11-14，npm 官方下载统计）
- 已发布版本数：47（近 12 个月 47 个）

## 中文简介

Forumulate 的命令行界面 — 管理 Orgs, 空格, Docs, 从您的终端搜索 .

## 安装

```sh
npm install @forumulate/cli
```

也可以使用：`pnpm add @forumulate/cli`、`yarn add @forumulate/cli`、`bun add @forumulate/cli`

## README

# @ forumulate/ cli (英语)

这个 `forumulate` 命令: 管理 [论坛](https://forumulate.com/) 组织、空间和来自终端或CI的页面,公布下标的目录,并检查读者和爬行者看到它的方式。 建造在 [`@forumulate/sdk`](https://www.npmjs.com/package/@forumulate/sdk)。 。 。 .

## 安装

```sh
npm install -g @forumulate/cli
# or, without installing:
npx -y @forumulate/cli help
```

节点20或更新.

## 认证

Mint 个人访问 **账户 —— 托肯斯** (单位:千美元)[论坛.com/账户/托肯](https://forumulate.com/account/tokens)) (中文(简体) ). 给我 `read` + 键 `write` 将出版. [API 令牌和范围](https://forumulate.com/guides/api-tokens-and-scopes) 解释两道门是象征性的.

```sh
forumulate login            # prompts for the token (not echoed), checks it, stores it
forumulate whoami
```

符号按 API 存储 `~/.config/forumulate/credentials.json`只有你才能读 在CI中,设置 `FORUMULATE_TOKEN` 相反,它胜过一个存储的标志。 跑一次,每个命令也都要 `--token <pat>`,它胜过两者: `--token`,则 `FORUMULATE_TOKEN`,则 `credentials.json` (单位:千美元)`forumulate whoami` 印出它用过的指纹). 关于少数行动 `token` 区域`sdks registries set`, (中文(简体) ), `github connect`, (中文(简体) ), `domains acme-challenge`(中文(简体) ) `--token` 就是那个球场.

| 变量 | 默认 | 含义 |
| --- | --- | --- |
| `FORUMULATE_TOKEN` | 存储的符号 | 个人访问Token. |
| `FORUMULATE_URL` | `https://forumulate.com` | 遗址. API是它的 API是它的 API是它的 `/api`。一个已经结束于 `/api` 用于当前. |
| `FORUMULATE_API_URL` | 无 | 准确的 API 基础,用于本地 API 没有 `/api` 前缀( e)`http://localhost:4000`) (中文(简体) ). |

SDK (英语:`ForumulateClient.fromEnv()`)和MCP服务器([`@forumulate/mcp`](https://www.npmjs.com/package/@forumulate/mcp))读取相同的变量,所以一个环境配置了所有三个.

## 快速启动

```sh
forumulate config set org acme       # the default for every --org
forumulate orgs list                 # id  slug  name
forumulate spaces list               # the spaces in acme
forumulate items list --space docs   # what is in a space, and where its content lives
forumulate api list --search webhook # every API operation, by summary
```

## 资源命令

每个组都采用相同的动词(`list`, (中文(简体) ), `get`, (中文(简体) ), `create`, (中文(简体) ), `update`, (中文(简体) ), `delete`,以及 `publish` 如果某物有草案,则使用相同的范围旗帜(`--org`, (中文(简体) ), `--space`, (中文(简体) ), `--library`,每个id或一发子弹 `--json` aPI的答案没有改变. `forumulate <group> --help` 列出一个组的动词和每个组调用的操作.

| 组 | 动词 |
| --- | --- |
| `orgs list|get|create|update|delete`, (中文(简体) ), `orgs deepl status|set|clear`, (中文(简体) ), `orgs strings list|set|remove` | 您的组织,他们的 DeepL 密钥, 和他们自己的界面字符串措辞 . |
| `members list|update|remove|sign-out|reassign` | 人入一兽. |
| `invites list|create|bulk|revoke|pending|accept|redeem|join`, (中文(简体) ), `invites links list|create|revoke` | 邀请你们和等待你们的人. |
| `groups …`, (中文(简体) ), `roles …`, (中文(简体) ), `service-accounts` 编号 : `bots` `… tokens list|create|revoke` | 组合和加入请求,定制角色,以及非人类成员用他们的代号. |
| `tokens` 编号 : `pats` `list|scopes|create|rotate|rename|revoke` | 您的个人访问标志, 通过身份或名称. |
| `webhooks list|events|create|update|delete|test|rotate-secret|deliveries|replay` | 终点,他们的交付,和回放. |
| `extensions …`, (中文(简体) ), `audit list|actions|export` | 已安装的扩展和市场;审计日志(作为CSV出口). |
| `spaces list|overview|get|create|update|delete|restore|purge|duplicate|move|rename|access|preview`, (中文(简体) ), `spaces slugs list|forget` | 圆形的空格:弹道,动作,复制和垃圾. |
| `snapshots list|create|restore|delete`, (中文(简体) ), `shape get|set|patch|preset|kinds …` | 空间快照 和空间的形状覆盖. |
| `items` 编号 : `pages` `list|get|content|create|update|write|section|fields|chunks|verify|publish|delete` | 任何一块在空间. `--file page.md` 填充正文; 前事项集 `title` 财务报告和审定财务报表 `slug`。 。 。 . |
| `docs list|get|save|publish|unpublish|history|diff|rollback|move|duplicate|…`, (中文(简体) ), `docs schedule get|set|cancel`, (中文(简体) ), `docs checkpoints …`, (中文(简体) ), `docs trash …`, (中文(简体) ), `docs import zip|docx|url|files`, (中文(简体) ), `docs locales …`, (中文(简体) ), `docs search` | 文件空间的一页:草稿、修订、预定出版、回滚、垃圾、进口和语文. |
| `collections …`, (中文(简体) ), `versions list|create|update|default|delete|settings|configure` | 收藏及其页面顺序; docs版本. |
| `change-requests` 编号 : `crs` `list|open|review|approve|merge|close|rebase|comment|…`, (中文(简体) ), `crs reviewers …`, (中文(简体) ), `crs rules get|set` | 拟议文件修改、审查和合并规则. |
| `openapi list|register|resync|lint|import|generate|…`, (中文(简体) ), `openapi sdk languages|get|download` | 参考页后方的 OpenAPI specs, 以及它们产生的 SDK. |
| `sdks packages|register|publish|publishes`, (中文(简体) ), `sdks registries list|set|test|remove` | 发布这些 SDKs 到包注册. |
| `blog`, (中文(简体) ), `forum`, (中文(简体) ), `changelog` `list|get|create|update|publish|delete|…` | 文章、专题和发布;时间安排、定位、设置、旗帜、民意测验、答复. `create --file post.md --publish`。 。 。 . |
| `changelog from-github --space <s> --tag <tag> [--name] [--file notes.md] [--url] [--publish true] [--post '{"space":"blog"}']` | 1个 GitHub 作为更改日志草稿发布, 用于 CI : `release: published`;或 ;或 `--data @payload.json` 与Webhook有效载荷。 需求 `blog:write`; 没有 GitHub 符号 。 见 [cLI 指南](https://forumulate.com/guides/cli#release-notes-from-github-changelog-from-github)。 。 。 . |
| `blog` 编号 : `forum` 编号 : `changelog` 编号 : `status` `translations list|get|put|remove|auto` | 一部自出门译出. `translations` (下)是整个空间的工作流程. |
| `roadmap board|get|submit|update|status|vote|comment|merge|proxy-votes …` | 地图空间. |
| `status board`, (中文(简体) ), `status incidents …`, (中文(简体) ), `status components …`, (中文(简体) ), `status channels …`, (中文(简体) ), `status groups get|set` | 状态空间:事件,组件,在其中公布. |
| `events …`, (中文(简体) ), `course outline|enrol|complete`, (中文(简体) ), `careers …`, (中文(简体) ), `forms …` | 事件和RSVP,课程进展,工作申请,表格和提交(CSV导出). |
| `libraries list|get|create|update|delete`, (中文(简体) ), `libraries members|locales|model|keys …` | 无头 CMS 库:赠款,语言,模型,交付密钥. |
| `entries list|types|get|create|update|fields|patch|publish|bulk|trash|restore|lock …|locale get|set` | 图书馆的条目. |
| `media …`, (中文(简体) ), `releases list|create|add|schedule|publish|rollback|…`, (中文(简体) ), `environments` 编号 : `envs list|fork|compare|promote` | 图书馆媒体,内容发布,和沙盒环境. |
| `domains list|add|setup|verify|activate|www|allow-ips|redirect|remove|…`, (中文(简体) ), `assets list|all|upload|download|delete` | 在空格上自定义域( 通过 id 或 主机名), 及其上传的文件 . |
| `theme get|set|patch|export|import`, (中文(简体) ), `theme draft get|set|patch|apply|discard|publish` | 空间主题: 与 `export`编号 :`import`,作为草稿上演,然后出版. |
| `sites …`, (中文(简体) ), `sites domains …`, (中文(简体) ), `sites theme export|import`, (中文(简体) ), `sites draft …` | 站点:一个域和主题下的几个空间. |
| `github status|connect|import|export|pull-request` | 用仓库同步文件空间 . |
| `reader page|markdown|pdf|version`, (中文(简体) ), `reader blog index|article|rss|json-feed|…` | 当公众API回应时`--out` 用于PDF或种子). |
| `space-types list|get|presets|slots` | 每一种空间是什么. |
| `search <query…>`, (中文(简体) ), `search semantic|recent|tags|tag|gaps|reindex` | 统一搜索文件、论坛和博客. |

旗帜来源于API本身:操作的每个查询参数(`--limit`, (中文(简体) ), `--state`)和每个上层体外(`--name`, (中文(简体) ), `--visibility`有旗帜,而且 `--data`编号 :`--field` 工作情况 `forumulate api`。带有前题的 Markdown 文件会填充项目、 文章、 话题或发布 : `title` 财务报告和审定财务报表 `slug` 由头等大事而来,除非你通过.

```sh
forumulate spaces create Guides --slug guides --type DOCS --visibility PUBLIC
forumulate items create --space guides --file getting-started.md --publish
forumulate webhooks create https://hooks.example.com/f --events page.published,post.created
forumulate webhooks deliveries <webhookId> && forumulate webhooks replay <webhookId> <deliveryId>
forumulate tokens rotate ci-deploy --graceMinutes 60
forumulate status incidents create "API latency" --space status --severity minor
```

`delete`, (中文(简体) ), `remove` 财务报告和审定财务报表 `revoke` 先问; `--yes` 跳过问题, 没有终端( CI) `--yes` 需要时间. `--dry-run` 打印请求,而不是发送。 回答为文件的命令( SDK 归档、 PDF 、 CSV 导出) 写到 `--out <file>`上传的`assets upload`, (中文(简体) ), `media upload`, (中文(简体) ), `docs import zip`) 以地道为论据.

```sh
forumulate docs schedule set <pageId> 2026-11-01T09:00:00Z --space guides
forumulate docs rollback <pageId> <revisionId> --mode draft --space guides
forumulate crs open "Rate limits rewrite" --space guides && forumulate crs merge <crId> --space guides
forumulate openapi resync <specId> --space reference --background true
forumulate releases create "Spring launch" && forumulate releases schedule <releaseId> 2026-03-01T08:00:00Z
forumulate theme export --space docs --json > theme.json && forumulate theme import --space docs --data @theme.json
forumulate blog translations auto <postId> es --space blog
forumulate audit export --from 2026-10-01 --out audit.csv
```

## `forumulate api`: 每个操作

资源指令覆盖了日常工作. `forumulate api` 涵盖其余部分——API中的每一个操作,取自与CLI捆绑的OpenAPI文件副本.

```sh
forumulate api list --tag Webhook                 # operationId, method, path, summary
forumulate api describe Space_create              # parameters as flags, the body as fields
forumulate api Space_list acme --limit 20         # path params positionally…
forumulate api Space_get --orgId acme --spaceId <id>   # …or by name (--org-id works too)
forumulate api GET /orgs/{orgId}/members --paginate --json
forumulate api POST /orgs/acme/spaces --data @space.json
cat body.json | forumulate api Item_putContent acme <spaceId> <itemId> --data -
forumulate api Space_update acme <spaceId> --field settings.overview="Start here"
```

-   **参数**数字 : `--<name> value` 用于路径、查询和页眉参数; 重复的旗帜与逗号相接(此处每个阵列参数是如何拼写)。 路径参数可以是位置,按路径顺序; `orgId` 默认为 `--org`, (中文(简体) ), `FORUMULATE_ORG`,则 `forumulate config`。 。 。 . `-p name=value` 设置一个名称与 CLI 旗相撞.
-   **体质**数字 : `--data '{…}'`, (中文(简体) ), `--data @file.json` 或者说 `--data -` (stdin),然后,(sdin),然后 `--field a.b=value` (由体相机打出; `a:=<json>` 生JSON),然后是任意 `--<field>` 身体宣布。 多部分行动 `--form name=value` 财务报告和审定财务报表 `--form file=@path`。 。 。 .
-   **产出**:列表打印为有页脚的表格,表示是否有更多(`--cursor <next>`),单一资源为 `key value` 线条; `--json` 按收到时打印尸体; `--paginate` 如下 `page.nextCursor` 至尾并打印一个合并列表; `--columns a,b` 选择表格列; `-i` 添加状态和页眉.
-   **运输**数字 : `Forumulate-Version` (SDK的当前版本,2027-02-01) 每一次请求(`--api-version` 或者说 `forumulate config set api-version` 针入另一个),a `Idempotency-Key` 每张纸上写着一张(同样的密钥),每张纸上写着一张(同样的密钥),每张纸上写着一张(429张),每张纸上写着一张(429张),每张(429张) `Retry-After`并按安全可重复的请求提供502/503/504.
-   **退出状态** 0在2xx和1在任何其它, 包括一个使用错误, 所以它工作在一个管道.

比你的CLI副本更新的路线仍然有效 `forumulate api <METHOD> <path>`原文照发.

## 配置和完成

```sh
forumulate config set org acme            # also: space, library, api-version
forumulate config list                    # value and where it came from
eval "$(forumulate completion zsh)"       # or bash; fish: forumulate completion fish > ~/.config/fish/completions/forumulate.fish
```

旗帜打出环境`FORUMULATE_ORG`, (中文(简体) ), `FORUMULATE_SPACE`, (中文(简体) ), `FORUMULATE_LIBRARY`, (中文(简体) ), `FORUMULATE_API_VERSION`),而环境则比 `~/.config/forumulate/config.json`。完成覆盖命令、动词、操作 日记和每个行动的旗帜.

## 共同任务

**1\. 出版Markdown文件夹(文件编号).** 每集一个文件夹,以嵌入式文件夹为主页,标题前题,switter,描述,图标,标记,顺序和任何其他页面字段,上传的图像,链接重写. 博客和更改日志成为帖子。 重新运行只改变改变什么; `--prune` 删除文件夹中不再包含的内容; 之后读取空格 。 可选 `forumulate.yaml` 设置空间的设置和主题、网址、OpenAPI参考和状态显示器。 见 [从 git 发布 Markdown 文件夹](https://forumulate.com/guides/publish-from-git) 财务报告和审定财务报表 `examples/publish-docs.yml` gitHub 动作.

```sh
forumulate publish ./docs --org acme --space docs --dry-run   # the plan (no token needed for a public space)
forumulate publish ./docs --org acme --space docs --prune
forumulate publish . --only getting-started,theme             # just these
```

**1b. 同步文件夹(内容为代码).** `forumulate sync <folder>` 默认为与计划相同的引擎 : `--apply` 写下来, `--diff` 显示每个文章或页面中的变化, `--prune` 删除没有文件的内容。 A 类 `forumulate.yml` 将文件夹映射到空格:博客文章、docs页面、FAQ问题(与 `short-answer:` 财务报告和审定财务报表 `related:` 插槽、更改日志发布和博客类别(`tags:` 在表内或 `_tags.yml`:标签,颜色,封面,图标,父. 用相片相匹配,图像一次上传 内容散列, `README`编号 :`LICENSE`编号 :`_drafts/`/ dotfiles 跳过——第二跑则没有写出什么. 见 [作为代码的内容](https://forumulate.com/guides/content-as-code)。 。 。 .

```sh
forumulate sync .                   # the plan
forumulate sync . --diff            # the plan, with paragraph and field diffs
forumulate sync . --apply --prune   # do it, read it back
```

**2\. 由id出版一页.**

```sh
forumulate items publish <pageId> --org acme --space docs
```

**3\. 共同搜索文件、论坛和博客.**

```sh
forumulate search rate limits --org acme   # or, older form: forumulate search acme rate limits
```

**4\. 在大变化前拍摄空间.**

```sh
forumulate snapshot acme <spaceId> "Before the v2 migration"
```

**5\. 检查自定义域.**

```sh
forumulate domains acme <spaceId>                         # each domain and its state
forumulate domains verify acme <spaceId> docs.acme.dev   # re-check, and print the DNS still missing
```

**6\. 管理翻译.** 使用 `forumulate translations`,或其别名 `forumulate i18n`。它涵盖每种翻译能力:空间语言或库语言、覆盖、文件往返、带有自己钥匙的机器翻译、铬标签、界面覆盖、名称和切换器。 见 [各地翻译](https://forumulate.com/guides/translations-everywhere)。 。 。 .

```sh
forumulate translations locales set es=Español fr --space docs     # declare exactly these
forumulate translations status --space docs --fail-on missing,outdated   # CI gate (exit 1)
forumulate translations pull --space docs --include-missing        # translations/<locale>/<slug>.md
forumulate translations push --space docs --dry-run                # the diff; drop --dry-run to apply
forumulate translations auto --space docs --locale es              # your DeepL key; missing + outdated
forumulate translations labels pull --space docs --format xliff    # for your TMS
forumulate translations overrides push overrides.json --prune
```

添加 `--json` 给任何生JSON的命令, `--version` 该版本,以及 `forumulate help` 完整名单。 每一个指令在故障时都会输出出非零,所以在管道中工作. 更古老的立场形式—— `spaces <orgId>`, (中文(简体) ), `items <orgId> <spaceId>`, (中文(简体) ), `search <orgId> <query…>`, (中文(简体) ), `domains [verify] <orgId> <spaceId>` ——仍然在工作,并准确印出他们的所作所为.

### 在CI语中

```yaml
# GitHub Actions
- run: npx -y @forumulate/cli publish ./docs --org acme --space ${{ vars.DOCS_SPACE_ID }}
  env:
    FORUMULATE_TOKEN: ${{ secrets.FORUMULATE_TOKEN }}
- run: npx -y @forumulate/cli translations status --org acme --space docs --fail-on missing,outdated
  env:
    FORUMULATE_TOKEN: ${{ secrets.FORUMULATE_TOKEN }}
```

## `forumulate conformance`

运行内容同步协议套件对齐一个收藏端点,我们的或任何其他平台的:

```sh
forumulate conformance https://forumulate.com/api/orgs/acme/spaces/<spaceId>/items
```

## `forumulate doctor`

请检查access-date=中的日期值 (帮助) 外出现场,读者和爬行者看的方式:

```sh
forumulate doctor https://your-domain.example.com/docs
```

它不需要任何象征,因为这一切都不是私人的。 每张支票都不错 顾客在读者发现后发现:

| 检查 | 失败意味着什么 |
| --- | --- |
| `health` | 健康端点回答JSON以外的问题. 部署时的平正文字500读取为永久错误,因此谨慎的客户端停止重试几分钟出局. 在自己的领域 `/api` 月台的挂载是属于你的 `<section>/_api/health` 以带路的一节发誓, `/_api/health` 对于一个属于整个网站的域,只有一个不回答的挂载被报告为跳过. |
| `public-read` | 登录的读取器被重定向到登录。 登录背后的公开文件对读者和爬行者来说是看不见的——在签名的会话内也是看不见的,这就是为什么这值得一个命令. |
| `canonical` | 这个 `rel=canonical` 命名另一个主机。 搜索引擎会把权限交给这个平台. |
| `html-untouched` | 路上的东西正在重写你的标记。 Cloudflare的电子邮件 Obfuscation是常用的:它注入一个解码脚本,没有CSP nonce,所以脚本被拒绝,页面上的每个地址都变成: `[email protected]` 与一个死链接. |
| `cache-headers` | 文件已送达 `no-store` 或无 `Cache-Control`,所以每个读者支付 完全的起源时间 和CDN 在它的前. |
| `robots` 编号 : `sitemap` | `robots.txt` 不允许路径, 或者没有站点图的名称 。 A 类 `Disallow` 这里表示页面从未被索引, 不管它有多好。 只有 `User-agent: *` 团体计数——针对一个被命名为"爬行者"的规则是故意的选择. |
| `crawler-access` | 爬行者从读者那里得到不同的地位. WAF规则或bot挑战回答爬行者不同方式将网站从搜索中移除,任何日志中没有任何内容可以这么说. |
| `feeds` | 页面旁没有种子 。 阅读器和聚合器查看内容旁边,而不是一个API URL. |

出站代码是非零 当任何故障, 所以它在部署管道. `--json` 提供完整的报告。 支票会说普通的HTTP 假设什么也没有 关于服务器,所以将其指向一个中转站-或竞争者- 出具同样的报告:一名医生只通过提交人的部署 是带有额外步骤的核对表.

## 相关

-   [`@forumulate/sdk`](https://www.npmjs.com/package/@forumulate/sdk): 此 CLI 所创建的已输入的 TypeScript 客户端 .
-   [`@forumulate/mcp`](https://www.npmjs.com/package/@forumulate/mcp): 连接克劳德, Cursor 或 VS 代码到您的组织.
-   [API 参考](https://forumulate.com/reference) • 妇女 [指南](https://forumulate.com/guides) • 妇女 [社区](https://forumulate.com/community)

## 许可证

麻省理工学院

## 常见问题

### @forumulate/cli 是什么？

Forumulate 的命令行界面 — 管理 Orgs, 空格, Docs, 从您的终端搜索 \.

### 如何安装 @forumulate/cli？

在项目目录运行 npm install @forumulate/cli，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 forumulate，可以用 npx forumulate 直接运行。

### @forumulate/cli 支持 TypeScript 吗？

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

### @forumulate/cli 可以商用吗？

@forumulate/cli 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @forumulate/cli 的下载量有多少？

根据 npm 官方下载统计，@forumulate/cli 在 2026/10/16 – 2026/11/14 这 30 天内被下载 6,933 次，日均约 231 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @forumulate/cli 还在维护吗？

最新版本 0\.22\.5 发布于 2026/11/14（1 天前）；至今共发布 47 个版本，其中过去 12 个月发布了 47 个；首次发布于 2026/10/03。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

