@fluid-app/fluid-cli-genealogy

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

Fluid CLI plugin for genealogy trees — parents, children, legs, placements and moves

原始使用文档

@fluid-app/fluid-cli-genealogy

Fluid CLI plugin for genealogy trees: parents, children, legs, placements and moves, over the company genealogy API (v2026-10).

npm install -g @fluid-app/fluid-cli @fluid-app/fluid-cli-genealogy
fluid login
fluid genealogy trees
fluid genealogy show --member <member-id>            # seat in the placement tree, with counts
fluid genealogy ancestors <node> --as-of 2026-09-01T00:00:00Z
fluid genealogy children <node> --limit 50           # prints next_cursor if more remain
fluid genealogy grandchildren <node>
fluid genealogy legs <node>                          # legs ranked by headcount
fluid genealogy strong-leg <node>
fluid genealogy tree <node> --depth 3                # indented text downline
fluid genealogy move <node> --to <parent> --dry-run  # preview only
fluid genealogy move <node> --to <parent> --yes

A node is a member's seat in one tree. Commands take a node UUID, or --member <member-id> with --tree <key-or-id> (default placement) to use that member's seat. A member with no seat, or several, in the tree is an error.

Reads: show, counts, parent, root, ancestors, sponsor, enroller, children, siblings, frontline, personally-enrolled, grandchildren, level --depth N, descendants --depth N, subtree --depth N, level-counts --depth N, relation <node> <other> [--kind], placements, holding-tank, trees. Deeper reads take depths 1-7. Lists follow every page; --limit caps the total and the output's next_cursor resumes with --cursor.

Legs are measured by headcount only: each leg counts the child's seat plus its downline_count. The API has no leg volume. Counts include retained seats of discarded members. The API has no per-leg count endpoint, so legs, strong-leg and weak-leg read each direct child's counts with its own request. They refuse a node with more than 200 direct children; pass --limit <n> to count up to n. The children read leaves out a direct child whose member was discarded, while the node's own counts keep it. There is no single read of a node's children with their counts, so legs reads the node's counts, then the children and each child's counts twice, then the node's counts again, and uses them only when every read agrees; otherwise it reads again (up to three times). When the node has more children than were listed, the output carries unlisted (children, seats, ranked, unknown_empty_legs). A single unlisted child is ranked with its exact size and unlisted: true, in the named leg left free when there is only one. Empty named legs are not listed when they cannot be told from an unlisted child's leg. strong-leg and weak-leg name a leg only when the unlisted children cannot change it; a strong leg that has more seats than all of them together still holds. Otherwise they return leg: null with best_listed, the pick among the listed legs.

Reads need a company admin with members.view (or the legacy users.view); a company API token (C-...) with that permission works too. Naming a tree by key, including the default placement, looks it up with GET /api/company/v2026-10/genealogy/tree-keys, which lists only each tree's id, key and name and needs the same members.view; without it, the key is looked up in the tree definitions, which need developer.view. An API without the tree-keys endpoint (it answers 404) falls back the same way. Only fluid genealogy trees, which prints the full tree definitions, needs developer.view, because those definitions carry company configuration. legs reads a tree's leg names from those definitions too: without developer.view it still ranks the occupied legs but cannot list empty named legs, so weak-leg returns leg: null with best_listed (an unseen empty leg may be the weak one) and the report carries leg_names_known: false.

Writes: place, move, move-requests approve|reject. They need an admin user's login: run fluid login as a company admin with members.manage (for place and move) or team_moves.approve (for move-requests approve|reject). A company API token (C-...) is refused with 403 "A company admin identity is required ...". Writes change the live tree, so they ask for confirmation unless you pass --yes. move --validate (or --dry-run) previews without writing. move-requests list|show and move-jobs list|show read move receipts.

Tree definitions: trees create, trees update <tree> and trees delete <tree> (a key or UUID) write the company's tree registry. They need an admin login with developer.update (a company API token works only if its role grants it). Every writable field is a flag: --key, --name, --kind unilevel|binary|matrix, --role, --leg-names left,right, --placement-rule, --movement-approval immediate|require_approval, --holding-tank-days, --max-depth, --max-movement-levels, --movement-window-days, --volume-on-move, --volume-key, --allow-multiple-positions true|false, --authority authoritative|replica|unconfigured, --owning-company-integration-id, --upstream-tree-ref and --external-integration-market-id; none clears a nullable field. Create needs --key, --name, --kind and --authority; binary and matrix trees also need --volume-on-move. Binary and matrix trees accept the default rules exact, first_empty, left, right and defer; unilevel trees exact, under_enroller and mirror_enrollment (other rules are refused with a typed error). place --parent with neither --leg nor --rule uses the tree's default rule. Only an authoritative tree takes placements, and placing in a binary or matrix tree also needs the company's GENEALOGY_LEGGED_TREES flag. Update sends only the flags given, at the tree's current lock_version unless --lock-version pins one; an occupied tree can only be renamed. Delete fails with tree_has_nodes while the tree holds any seat, and the default enrollment and placement trees can't be deleted. Each write shows the request and asks first unless --yes; --dry-run prints it and sends nothing.

fluid genealogy trees create --key team-binary --name "Team Binary" --kind binary \
  --authority authoritative --volume-on-move follows_structure --dry-run
fluid genealogy trees update team-binary --movement-approval require_approval --yes
fluid genealogy trees delete team-binary --yes

trees mirror [tree] (default placement) backfills the placement tree from the enrollment tree for a company whose placement tree uses mirror_enrollment and has no legacy placement tree: every enrolled member without a placement seat is seated under their enroller's seat, roots first, and unpinned seats that no longer match are re-parented. Pinned seats stay. It is idempotent and needs an admin login with members.manage. Member writes keep the trees mirrored afterwards.

--dry-run reports the counts at once and writes nothing (up to 5,000 enrollment seats). A real run asks first unless --yes, then queues a background run with no seat limit and prints it (mirror_run, plus started: false when the company already had a run queued or running; there is one at a time). --wait follows the run, printing a progress line per reading on stderr (every --interval seconds, default 2), then prints the finished run and exits non-zero if it failed or halted. A halted run kept the batches it wrote; run the mirror again to finish.

fluid genealogy trees mirror --dry-run
fluid genealogy trees mirror --yes --wait
fluid genealogy trees mirror-runs list --status running
fluid genealogy trees mirror-runs show <run-id>

Every command except tree prints JSON. Failures print a JSON error (with the API's type when there is one) on stderr and exit non-zero.

版本与发布记录

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

版本发布日期距今
0.1.674latest2026/11/15今天
0.1.6732026/11/15今天
0.1.6722026/11/15今天
0.1.6712026/11/141 天前
0.1.6702026/11/141 天前
0.1.6692026/11/141 天前

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

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

Fluid CLI plugin for genealogy trees — parents, children, legs, placements and moves

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

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

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

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

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

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

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

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

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

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

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

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

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

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