@contentstack/cli-cm-clone

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

Contentstack stack clone plugin

原始使用文档

@contentstack/cli-cm-clone

It is Contentstack’s CLI plugin to clone a stack. Using this command, you can export a stack’s content/schema to a new or existing stack. Refer to the Clone a Stack documentation to learn more.

Usage

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

Commands

csdx cm:stacks:clone [--source-branch <value>] [--target-branch <value>] [--source-management-token-alias <value>] [--destination-management-token-alias <value>] [-n <value>] [--type a|b] [--source-stack-api-key <value>] [--destination-stack-api-key <value>] [--import-webhook-status disable|current]

Clone data (structure/content or both) of a stack into another stack

USAGE
  $ csdx cm:stack-clone cm:stacks:clone [--source-branch <value>] [--target-branch <value>]
    [--source-management-token-alias <value>] [--destination-management-token-alias <value>] [-n <value>] [--type a|b]
    [--source-stack-api-key <value>] [--destination-stack-api-key <value>] [--import-webhook-status disable|current]

FLAGS
  -c, --config=<value>                              Path for the external configuration
  -n, --stack-name=<value>                          Provide a name for the new stack to store the cloned content.
  -y, --yes                                         Force override all Marketplace prompts.
      --destination-management-token-alias=<value>  Destination management token alias.
      --destination-stack-api-key=<value>           Destination stack API key
      --import-webhook-status=<option>              [default: disable] [default: disable] (optional) The status of the
                                                    import webhook. <options: disable|current>
                                                    <options: disable|current>
      --skip-audit                                  (optional) Skips the audit fix that occurs during an import
                                                    operation.
      --source-branch=<value>                       Branch of the source stack.
      --source-branch-alias=<value>                 Alias of Branch of the source stack.
      --source-management-token-alias=<value>       Source management token alias.
      --source-stack-api-key=<value>                Source stack API key
      --target-branch=<value>                       Branch of the target stack.
      --target-branch-alias=<value>                 Alias of Branch of the target stack.
      --type=<option>                               Type of data to clone. You can select option a or b.
                                                    a) Structure (all modules except entries & assets).
                                                    b) Structure with content (all modules including entries & assets).

                                                    <options: a|b>

DESCRIPTION
  Clone data (structure/content or both) of a stack into another stack
  Use this plugin to automate the process of cloning a stack in few steps.


ALIASES
  $ csdx cm:stack-clone

EXAMPLES
  $ csdx cm:stacks:clone

  $ csdx cm:stacks:clone --source-branch <source-branch-name> --target-branch <target-branch-name> --yes

  $ csdx cm:stacks:clone --source-stack-api-key <apiKey> --destination-stack-api-key <apiKey>

  $ csdx cm:stacks:clone --source-management-token-alias <management token alias> --destination-management-token-alias <management token alias>

  $ csdx cm:stacks:clone --source-branch --target-branch --source-management-token-alias <management token alias> --destination-management-token-alias <management token alias>

  $ csdx cm:stacks:clone --source-branch --target-branch --source-management-token-alias <management token alias> --destination-management-token-alias <management token alias> --type <value a or b>

csdx cm:stacks:clone [--source-branch <value>] [--target-branch <value>] [--source-management-token-alias <value>] [--destination-management-token-alias <value>] [-n <value>] [--type a|b] [--source-stack-api-key <value>] [--destination-stack-api-key <value>] [--import-webhook-status disable|current]

Clone data (structure/content or both) of a stack into another stack

USAGE
  $ csdx cm:stacks:clone [--source-branch <value>] [--target-branch <value>] [--source-management-token-alias
    <value>] [--destination-management-token-alias <value>] [-n <value>] [--type a|b] [--source-stack-api-key <value>]
    [--destination-stack-api-key <value>] [--import-webhook-status disable|current]

FLAGS
  -c, --config=<value>                              Path for the external configuration
  -n, --stack-name=<value>                          Provide a name for the new stack to store the cloned content.
  -y, --yes                                         Force override all Marketplace prompts.
      --destination-management-token-alias=<value>  Destination management token alias.
      --destination-stack-api-key=<value>           Destination stack API key
      --import-webhook-status=<option>              [default: disable] [default: disable] (optional) The status of the
                                                    import webhook. <options: disable|current>
                                                    <options: disable|current>
      --skip-audit                                  (optional) Skips the audit fix that occurs during an import
                                                    operation.
      --source-branch=<value>                       Branch of the source stack.
      --source-branch-alias=<value>                 Alias of Branch of the source stack.
      --source-management-token-alias=<value>       Source management token alias.
      --source-stack-api-key=<value>                Source stack API key
      --target-branch=<value>                       Branch of the target stack.
      --target-branch-alias=<value>                 Alias of Branch of the target stack.
      --type=<option>                               Type of data to clone. You can select option a or b.
                                                    a) Structure (all modules except entries & assets).
                                                    b) Structure with content (all modules including entries & assets).

                                                    <options: a|b>

DESCRIPTION
  Clone data (structure/content or both) of a stack into another stack
  Use this plugin to automate the process of cloning a stack in few steps.


ALIASES
  $ csdx cm:stack-clone

EXAMPLES
  $ csdx cm:stacks:clone

  $ csdx cm:stacks:clone --source-branch <source-branch-name> --target-branch <target-branch-name> --yes

  $ csdx cm:stacks:clone --source-stack-api-key <apiKey> --destination-stack-api-key <apiKey>

  $ csdx cm:stacks:clone --source-management-token-alias <management token alias> --destination-management-token-alias <management token alias>

  $ csdx cm:stacks:clone --source-branch --target-branch --source-management-token-alias <management token alias> --destination-management-token-alias <management token alias>

  $ csdx cm:stacks:clone --source-branch --target-branch --source-management-token-alias <management token alias> --destination-management-token-alias <management token alias> --type <value a or b>

See code: src/commands/cm/stacks/clone.ts

版本与发布记录

@contentstack/cli-cm-clone 共发布 118 个版本,首次发布于 2021/03/26;过去 12 个月发布了 50 个版本。

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

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

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

@contentstack/cli-cm-clone 是什么?

Contentstack stack clone plugin

如何安装 @contentstack/cli-cm-clone?

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

@contentstack/cli-cm-clone 支持 TypeScript 吗?

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

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

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

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

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

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

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

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

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

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

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