@fluid-app/fluid-cli-pages

中文文档
0.1.682发布于 2026/11/15TypeScriptES Module近 30 天下载 13.3万

Fluid CLI plugin for storefront Pages — create a Page with its own theme template, then list, update, publish, and delete Pages

原始使用文档
文档目录3 节
  1. How create works
  2. Walk through it
  3. Editing the template

@fluid-app/fluid-cli-pages

Fluid CLI plugin for storefront Pages. fluid pages create creates a Page together with its own page template in a theme and links the two, the same operation as Mist's create-page tool.

npm install -g @fluid-app/fluid-cli @fluid-app/fluid-cli-pages
fluid login
fluid pages walk                                                   # answer questions in the terminal instead
fluid pages create --title "Spring Wellness Guide" --yes          # Page + template, linked, as a draft
fluid pages create --title "Spring Wellness Guide" --theme "Maple" \
  --template-from landing --publish --yes                          # copy another page template's Liquid, then publish
fluid pages list --status draft                                    # --cursor pages through
fluid pages show spring-wellness-guide                             # id or slug
fluid pages template spring-wellness-guide                         # the template and its Liquid
fluid pages template spring-wellness-guide --content-file page.liquid --publish --yes
fluid pages update spring-wellness-guide --title "Spring Guide" --yes
fluid pages publish spring-wellness-guide --yes
fluid pages unpublish spring-wellness-guide --yes
fluid pages delete spring-wellness-guide --yes                     # keeps the template; prints its id

How create works

A Page holds the metadata (title, slug, description, status). What it looks like comes from a page template, a Liquid file in a theme. create makes both and links them:

  1. creates a page template in the theme (--theme, or the active theme), named after the title unless you pass --template-name. It starts from --content-file, --template-from, or a minimal title-and-description layout. Unless you pass --blank, the Page also loads the theme's stylesheets (its brand style);
  2. creates the Page as a draft, with the slug pinned;
  3. assigns the template to the Page;
  4. reads both back to confirm the link;
  5. publishes the Page when you pass --publish.

If a step after the template fails, the draft Page and the template are removed and the error says so. They are kept, with their ids in the error, when your session expired mid-way or when the link couldn't be read back.

assignment in the result is direct-page when the template is in the active theme. A template in another theme is theme-scoped: the Page uses it once that theme is active, and previewPath carries ?theme_template_id= so you can preview it now.

Walk through it

fluid pages walk asks for the same things as create, one question at a time: the title, the slug (suggested from the title), the template (new with the theme's brand style, new and blank, or a copy of an existing page template, picked from a searchable list), and the theme (the active one, or pick another). Type < to go back, > to skip and take the default, or ? for a menu that jumps to any question; Ctrl-C stops. Nothing changes until you confirm the summary. Then it creates the page as a draft through the same steps as create, offers to publish it, prints its URL, and offers to replace the template's Liquid from a file. It needs a terminal; in a script, use create.

Editing the template

fluid pages template <page> --content-file <file> replaces the Liquid as a new draft version; add --publish to make it live. For sections, settings, and the rest of the theme, use fluid themes and the theme development docs at https://docs.fluid.app/themes/overview.

Every command prints JSON; failures print a JSON error on stderr and exit non-zero. Commands that change the live storefront ask for confirmation unless you pass --yes.

版本与发布记录

@fluid-app/fluid-cli-pages 共发布 683 个版本,首次发布于 2026/10/02;过去 12 个月发布了 683 个版本。

版本发布日期距今
0.1.682latest2026/11/15今天
0.1.6812026/11/15今天
0.1.6802026/11/15今天
0.1.6792026/11/141 天前
0.1.6782026/11/141 天前
0.1.6772026/11/141 天前

关于 @fluid-app/fluid-cli-pages 的常见问题

@fluid-app/fluid-cli-pages 是什么?

Fluid CLI plugin for storefront Pages — create a Page with its own theme template, then list, update, publish, and delete Pages

如何安装 @fluid-app/fluid-cli-pages?

在项目目录运行 npm install @fluid-app/fluid-cli-pages,或使用 pnpm add / yarn add / bun add。

@fluid-app/fluid-cli-pages 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@fluid-app/fluid-cli-pages 支持 ESM 还是 CommonJS?

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

@fluid-app/fluid-cli-pages 需要什么版本的 Node.js?

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

@fluid-app/fluid-cli-pages 可以商用吗?

@fluid-app/fluid-cli-pages 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@fluid-app/fluid-cli-pages 的下载量有多少?

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

@fluid-app/fluid-cli-pages 还在维护吗?

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