@contentstack/cli-cm-seed

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

create a Stack from existing content types, entries, assets, etc.

原始使用文档
文档目录5 节
  1. Description
  2. Commands
  3. csdx cm:stacks:seed [--repo <value>] [--org <value>] [--sta…
  4. Advanced Flags
  5. Documentation

Description

The “seed” command in Contentstack CLI allows users to import content to your stack, from Github repositories. It's an effective command that can help you to migrate content to your stack with minimal steps.

To import content to your stack, you can use either of the following:

Curated official stacks: When you run the seed command without a full owner/repo on --repo, the CLI offers a fixed list of official Contentstack seed repositories on GitHub (no GitHub search API).

Any GitHub repository: You can also import content from another GitHub repository by passing --repo in owner/repository form (organization, user, or enterprise account).

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

Commands

csdx cm:stacks:seed [--repo <value>] [--org <value>] [--stack-api-key <value>] [--stack-name <value>] [-y] [--alias <value>]

Create a stack from existing content types, entries, assets, etc

USAGE
  $ csdx cm:stacks:seed [--repo <value>] [--org <value>] [--stack-api-key <value>] [--stack-name <value>] [-y]
    [--alias <value>]

FLAGS
  -a, --alias=<value>          Alias of the management token
  -k, --stack-api-key=<value>  Provide stack API key to seed content to
  -n, --stack-name=<value>     Name of a new stack that needs to be created.
  -y, --yes                    [Optional] Skip the stack confirmation.
      --org=<value>            Provide Organization UID to create a new stack
      --repo=<value>           GitHub organization name or GitHub user name/repository name.

DESCRIPTION
  Create a stack from existing content types, entries, assets, etc

EXAMPLES
  $ csdx cm:stacks:seed

  $ csdx cm:stacks:seed --repo "account"

  $ csdx cm:stacks:seed --repo "account/repository"

  $ csdx cm:stacks:seed --repo "account/repository" --stack-api-key "stack-api-key" //seed content into specific stack

  $ csdx cm:stacks:seed --repo "account/repository" --org "your-org-uid" --stack-name "stack-name" //create a new stack in given org uid

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

Advanced Flags

The following flags allow you to host and import Stacks from your own GitHub repository. The account name can be a personal user account, organization account, or enterprise account.

  $ csdx cm:stacks:seed --repo "account/repository"

Step 1. Export a Stack

Identify a Stack that you would like to export. This stack might be used in conjunction with a sample web site or mobile app you have created.

Now, run csdx cm:stacks:export against it. The following documentation explains the Export Plugin.

In most cases, running csdx cm:stacks:export -A or csdx cm:stacks:export -a "management token" should work for you.

The csdx cm:stacks:seed plugin uses the same libraries as csdx cm:stacks:import.

Step 2. GitHub

Once the Stack is exported:

  • Create a GitHub repository.
    • By convention, your repository name should be prefixed with stack-. For example: stack-your-starter-app. Doing so will allow the stack names to be found by the interactive prompt when running csdx cm:stacks:seed --repo "account". This step is optional. You can fully qualify the repository name if required: csdx cm:stacks:seed --repo "account/repo.
  • Create a folder named stack within the newly created GitHub repository
  • Take the content from Step 1 and commit it to the stack folder
  • Create a Release

The latest release will be downloaded and extracted, when a user attempts to install a Stack using:

$ csdx cm:stacks:seed --repo "account"
$ csdx cm:stacks:seed --repo "account/repository"

Documentation

To get more detailed documentation of this command, visit the Seed command documentation on our docs.

版本与发布记录

@contentstack/cli-cm-seed 共发布 111 个版本,首次发布于 2021/04/19;过去 12 个月发布了 48 个版本。

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

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

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

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

create a Stack from existing content types, entries, assets, etc.

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

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

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

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

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

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

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

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

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

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

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

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