--- createdAt: 2024-08-11 updatedAt: 2026-10-08 priority: 5 title: "intlayer live:运行时同步 CMS 内容" description: "使用 Intlayer Live Sync,将 CMS 中的内容修改应用到运行中的应用,无需重新构建或部署。" keywords: - 实时同步 - CMS - 运行时 - CLI - Intlayer slugs: - doc - concept - cli - live author: aymericzip --- # 实时同步命令 实时同步让您的应用在运行时反映 CMS 内容的更改。无需重新构建或重新部署。启用后,更新会被流式传输到实时同步服务器,该服务器会刷新您的应用读取的字典。详情请参见 [Intlayer CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_CMS.md)。 - [Intlayer CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/intlayer_CMS.md) ```json fileName="package.json" "scripts": { "intlayer:live:start": "npx intlayer live start --with 'next dev --turbopack'" } ``` ## 参数: **配置选项:** - **`--base-dir`**:指定项目的基础目录。命令将在该基础目录中查找 `intlayer.config.{ts,js,json,cjs,mjs}` 文件以获取 intlayer 配置。 - **`--no-cache`**:禁用缓存。 > 示例:`npx intlayer dictionary push --env-file .env.production.local` - **`--ci`**:在 monorepo 的每个 Intlayer 项目中执行该命令(在项目目录内运行时仅处理当前项目)。可通过 `INTLAYER_PROJECT_CREDENTIALS`(将项目路径映射到 `{ "clientId", "clientSecret" }` 的 JSON 对象)为每个项目注入凭据。 > 示例:`npx intlayer live --ci` **日志选项:** - **`--verbose`**:启用详细日志以便调试。(CLI 默认启用)