@contentstack/cli-cm-import-setup

中文文档
2.0.2发布于 2026/10/06MITTypeScriptCommonJS近 30 天下载 4.4万

为导入命令设置映射器和配置的内存 CLI 插件

中文使用文档

@contentstack/cli-cm-import- setup (中文(简体) )

Contack 的 CLI 插件导入堆栈中的内容 。 为了了解如何在Contack中出口和进口内容,请参考 移徙指南。 。 。 .

License

使用 csdx config:set:region 设置您的区域。 运行 csdx config:set:region --help 用于现有区域.

使用量

$ npm install -g @contentstack/cli-cm-import-setup
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-import-setup/2.0.2 linux-x64 node-v22.23.3
$ csdx --help [COMMAND]
USAGE
  $ csdx COMMAND
...

图标

csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--module <value,value>]

帮助生成用于导入(覆盖)特定模块的映射器和备份文件夹

USAGE
  $ csdx cm:stacks:import-setup [-k <value>] [-d <value>] [-a <value>] [--module <value,value>]

FLAGS
  -a, --alias=<value>          The management token of the destination stack where you will import the content.
  -d, --data-dir=<value>       The path or the location in your file system where the content, you intend to import, is
                               stored. For example, -d "C:\Users\Name\Desktop\cli\content". If the export folder has
                               branches involved, then the path should point till the particular branch. For example,
                               “-d "C:\Users\Name\Desktop\cli\content\branch_name"
  -k, --stack-api-key=<value>  API key of the target stack
      --branch=<value>         The name of the branch where you want to import your content. If you don't mention the
                               branch name, then by default the content will be imported to the main branch.
      --branch-alias=<value>   Specify the branch alias where you want to import your content. If not specified, the
                               content is imported into the main branch by default.
      --module=<option>...     [optional] Specify the modules/module to import into the target stack. currently options
                               are global-fields, content-types, entries
                               <options: global-fields|content-types|entries>

DESCRIPTION
  Helps to generate mappers and backup folder for importing (overwriting) specific modules

EXAMPLES
  $ csdx cm:stacks:import-setup --stack-api-key <target_stack_api_key> --data-dir <path/of/export/destination/dir> --module <module_name, module_name> --branch <branch_name>

参见代码 : src/commands/cm/stacks/进口设置.ts

版本与发布记录

@contentstack/cli-cm-import-setup 共发布 53 个版本,首次发布于 2024/12/12;过去 12 个月发布了 39 个版本。

版本发布日期距今
2.0.2latest2026/10/061 个月前
1.8.10v1-x2026/10/061 个月前
2.0.12026/09/151 个月前
1.8.92026/08/132 个月前
2.0.02026/08/122 个月前
1.8.82026/08/053 个月前

其他发布通道:beta → 2.0.0-beta.19,v1-x → 1.8.10。

关于 @contentstack/cli-cm-import-setup 的常见问题

@contentstack/cli-cm-import-setup 是什么?

为导入命令设置映射器和配置的内存 CLI 插件

如何安装 @contentstack/cli-cm-import-setup?

在项目目录运行 npm install @contentstack/cli-cm-import-setup,或使用 pnpm add / yarn add / bun add。

@contentstack/cli-cm-import-setup 支持 TypeScript 吗?

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

@contentstack/cli-cm-import-setup 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@contentstack/cli-cm-import-setup 需要什么版本的 Node.js?

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

@contentstack/cli-cm-import-setup 可以商用吗?

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

@contentstack/cli-cm-import-setup 的下载量有多少?

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

@contentstack/cli-cm-import-setup 还在维护吗?

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