# @contentstack/cli-cm-seed

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

Latest version **2.0.1** (published 2026-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @contentstack/cli-cm-seed
pnpm add @contentstack/cli-cm-seed
yarn add @contentstack/cli-cm-seed
bun add @contentstack/cli-cm-seed
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-09-15 |
| First published | 2021-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=22.0.0 |
| Dependencies | 7 |
| Unpacked size | 47.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Contentstack |
| Maintainers | mynk, cloudaccounts |
| Keywords | contentstack, cli, plugin |

## Links

- npm: https://www.npmjs.com/package/@contentstack/cli-cm-seed
- Repository: https://github.com/contentstack/cli-plugins
- Homepage: https://github.com/contentstack/cli
- Issues: https://github.com/contentstack/cli-plugins/issues
- npm.io page: https://npm.io/package/@contentstack/cli-cm-seed

## Dependencies (7)

- [tar](https://npm.io/package/tar.md) ^7.5.22
- [tmp](https://npm.io/package/tmp.md) ^0.2.7
- [mkdirp](https://npm.io/package/mkdirp.md) ^1.0.4
- [inquirer](https://npm.io/package/inquirer.md) 12.11.1
- [@contentstack/cli-command](https://npm.io/package/@contentstack/cli-command.md) ~2.0.1
- [@contentstack/cli-cm-import](https://npm.io/package/@contentstack/cli-cm-import.md) ~2.0.1
- [@contentstack/cli-utilities](https://npm.io/package/@contentstack/cli-utilities.md) ~2.0.1

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2026-09-15
- 1.15.11 (v1-x) — 2026-08-13
- 2.0.0-beta.25 (beta) — 2026-07-29
- 2.0.0 — 2026-08-12
- 1.15.10 — 2026-08-05
- 1.15.9 — 2026-07-29
- 2.0.0-beta.24 — 2026-07-20
- 1.15.8 — 2026-07-13
- 2.0.0-beta.23 — 2026-07-13
- 2.0.0-beta.22 — 2026-07-06
- 2.0.0-beta.21 — 2026-06-29
- 1.15.7 — 2026-06-29
- 1.15.6 — 2026-06-10
- 2.0.0-beta.20 — 2026-06-08
- 1.15.5 — 2026-06-01
- … 94 more at https://npm.io/package/@contentstack/cli-cm-seed/versions

## README

## 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).

<!-- usage -->
```sh-session
$ npm install -g @contentstack/cli-cm-seed
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-cm-seed/2.0.1 linux-x64 node-v22.23.2
$ csdx --help [COMMAND]
USAGE
  $ csdx COMMAND
...
```
<!-- usagestop -->
## Commands
<!-- commands -->
* [`csdx cm:stacks:seed [--repo <value>] [--org <value>] [--stack-api-key <value>] [--stack-name <value>] [-y] [--alias <value>]`](#csdx-cmstacksseed---repo-value---org-value---stack-api-key-value---stack-name-value--y---alias-value)

## `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](https://github.com/contentstack/cli-plugins/blob/main/packages/contentstack-seed/src/commands/cm/stacks/seed.ts)_
<!-- commandsstop -->

## 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](https://www.contentstack.com/docs/headless-cms/export-content-using-the-cli).

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](https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/managing-releases-in-a-repository)

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](https://www.contentstack.com/docs/headless-cms/import-content-using-the-seed-command).

---
_Source: https://npm.io/package/@contentstack/cli-cm-seed · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
