@fluid-app/fluid-cli-mist

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

Fluid CLI plugin for managing Mist hosted extensions

原始使用文档
文档目录7 节
  1. Commands
  2. Pushing an approved commit
  3. Generating a secret
  4. Reaching Exigo through the egress proxy
  5. Repairing the attached Droplet
  6. Reinstalling the attached Droplet (irreversible)
  7. Development

@fluid-app/fluid-cli-mist

Fluid CLI plugin for Mist hosted extensions. The fluid CLI discovers it through the fluid-cli-* naming convention and adds the fluid mist commands. The full command surface is specified in features/mist/cli-spec.md.

Each command takes an optional mist slug. Without one, it reads the .mist file in the current directory, which fluid mist clone writes.

Commands

CommandPurpose
list, show, create, update, delete, restoreManage mists
clone, push, pull, openWork with the code and the deployed app
attach, attach-dropletWire a surface (such as a Droplet) to a mist
deployments, logsSee builds and runtime output
env list|set|unset|pullManage production env vars
droplet repair|reinstall|egress-proxyRepair, reinstall or ask for egress for the attached Droplet

Pushing an approved commit

fluid mist push --expect-commit <full-sha> [--watch]

Pushes exactly that commit to refs/heads/<branch>. It refuses with exit code 5, before any network call, unless the sha is a full 40-character hex id (64 for sha256 repos; a 64-hex value in a sha1 repo is refused as head_mismatch), equals HEAD, the branch is a plain name (no refs/ prefix or :), and the working tree has no changes, untracked files or dirty submodules. It never auto-commits, pulls, or stashes, and it cannot be combined with -m. --watch matches the deployment for that sha.

Generating a secret

fluid mist env set WEBHOOK_AUTH_TOKEN --generate             # 32 bytes
fluid mist env set my-mist SESSION_SECRET --generate --bytes 64

--generate mints a cryptographically strong base64url secret (16 to 128 bytes, default 32), writes it to the key, and prints it once. Fluid stores env values encrypted and env list never shows them, so copy the secret immediately if you also need it in .env.local. It uses the same generator as Mist's set_mist_env_var tool. It refuses Mist-managed keys before generating anything. Redeploy with fluid mist push for the change to take effect.

Reaching Exigo through the egress proxy

fluid mist create --droplet --egress-proxy    # new mist + droplet, asking for egress
fluid mist attach-droplet --egress-proxy      # attach (or reuse) a droplet, asking for egress
fluid mist droplet egress-proxy on            # ask for egress for the attached Droplet
fluid mist droplet egress-proxy off           # withdraw the request (and any grant)

Fluid's egress proxy lets a Droplet's installations reach external systems such as Exigo from Fluid's fixed outbound IPs. These commands set the Droplet's egress_proxy_requested, and the proxy then admits the Droplet with no further approval, wherever the proxy honours Fluid's answer. Withdrawing the request also clears any grant a Fluid admin recorded (egress_proxy_enabled).

--egress-proxy works on create --droplet, create --kind droplet, create --hostable, attach --kind droplet and attach-droplet. On a Droplet that already exists it updates the request rather than ignoring the flag. Fluid accepts an egress request only from a company admin, for their own company's droplets. Otherwise it refuses the request: --egress-proxy then sets the droplet up without it and warns, and droplet egress-proxy fails with Fluid's reason without writing. A Fluid that predates the fields ignores them, and the commands warn or fail the same way. droplet egress-proxy off also clears a grant a Fluid admin gave without a request. Mist Desktop's Safe Mode treats droplet egress-proxy as a write.

Repairing the attached Droplet

fluid mist droplet repair --dry-run   # show the planned change
fluid mist droplet repair             # prompt, then apply
fluid mist droplet repair --yes       # apply without a prompt

This sets the Droplet's embed_url, install_webhook_url and uninstall_webhook_url from the mist's public_url as Fluid reports it. The local .mist file's copy of the URL is never used. The webhook paths come from dropletLifecycle in fluid.capabilities.json when you run it inside the project. Otherwise it uses /api/webhooks/installed and /api/webhooks/uninstalled. Only those three fields change, and the command re-reads the Droplet to verify them. Without a terminal to prompt in, it needs --yes.

A repair fixes future lifecycle delivery. It does not replay droplet.installed for an existing installation; for that, use reinstall.

Reinstalling the attached Droplet (irreversible)

fluid mist droplet reinstall --dry-run    # 1. show the exact plan
fluid mist droplet reinstall --confirm    # 2. execute it

reinstall repairs the lifecycle URLs and asks Fluid to replace the mist's own Droplet installation in one durable operation. In that operation Fluid revokes the installation, delivers the uninstall, terminalizes it and creates the replacement. The CLI never deletes and re-creates an installation itself. The rules match Mist's repair_and_reinstall_droplet tool:

  • Plan first. --dry-run changes nothing. It prints the Mist, the Droplet, the installation and the replacement endpoint.

  • Explicit approval. --confirm executes only when a --dry-run ran in the last 15 minutes for the same Droplet, installation and lifecycle URLs. --yes never approves a reinstall. --confirm uses up the plan whether or not it goes ahead, and two --confirm runs can't share one plan, so a retry needs a new --dry-run.

  • Own Droplet only. The Droplet is always the one attached to the mist, and Fluid rejects installations of any other Droplet.

  • Resumable watching. The CLI watches for 120 seconds by default (--watch-timeout <seconds>). A slower replacement returns "status": "still_running" together with the command that continues watching it:

    fluid mist droplet reinstall --resume <operationId> --installation <installationUuid>
    

    A resume starts nothing and needs no new plan, but it requires --installation and doesn't accept --dry-run. The reinstall is done only when status is "succeeded".

  • Recovery. A failed attempt may already have terminalized the source installation, so it no longer appears in the list. In that case, plan and confirm with --installation <uuid>, using the uuid from the earlier plan. A named installation always takes precedence over the active one.

reinstall always prints JSON. A refusal prints {"status": "refused", "code": …} and exits 1. A failed replacement exits 1, and API errors use the CLI's usual codes: 2 for a 4xx, 3 for a 5xx and 4 for a network error. Plan receipts hold only ids, the planned URLs and a timestamp. They are stored in ~/.fluid/mist/reinstall-plans/.

Development

pnpm nx run-many -t test,typecheck,lint,build -p @fluid-app/fluid-cli-mist

Shared Mist logic (lifecycle URLs, Droplet repair planning, replacement rules, polling, secret generation) lives in the private @fluid-app/mist-core package. The build bundles it into this plugin.

版本与发布记录

@fluid-app/fluid-cli-mist 共发布 744 个版本,首次发布于 2026/07/03;过去 12 个月发布了 744 个版本。

版本发布日期距今
0.1.743latest2026/11/15今天
0.1.7422026/11/15今天
0.1.7412026/11/15今天
0.1.7402026/11/141 天前
0.1.7392026/11/141 天前
0.1.7382026/11/141 天前

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

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

Fluid CLI plugin for managing Mist hosted extensions

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

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

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

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

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

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

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

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

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

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

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

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

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

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