1.0.6 • Published 3 years ago
contentstack-cli-seed v1.0.6
Description
This is a plugin for Contentstack's CLI. It allows you to quickly import existing Stacks to run sample apps.
How to install this plugin
$ csdx plugins:install contentstack-cli-seed
Commands
csdx seed
create a Stack from existing content types, entries, assets, etc.
USAGE
$ csdx seed
OPTIONS
-r, --repo=repo GitHub account owner or GitHub repository
EXAMPLES
$ csdx seed
$ csdx seed -r "owner"
$ csdx seed -r "owner/repository"
See code: src/commands/seed.ts
Advanced Flags
The following flags allow you to host and import content models from your own GitHub repository.
$ csdx seed -r "GitHub Owner/GitHub Repository"
Step 1. Export a Stack
Identify a Stack that you would like to export, and run csdx cm:export
against it.
This plugin uses the same libraries as csdx cm:import
.
$ csdx cm:export --help
See more info: Exporting Content
Step 2. GitHub
Once the Stack is exported:
- Create a GitHub repository
- By convention, your repository name should be prefixed with
stack-
. Example:stack-your-starter-app
. - Doing so will allow the stack names to be found by the interactive prompt when running
csdx seed -r "owner"
. - The
stack-
prefix is optional. You can fully qualify the repository name if required. Example:csdx seed -r "owner/repo"
.
- By convention, your repository name should be prefixed with
- 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
For reference, review the stack-gatsby-blog repository.
The latest release will be downloaded and extracted, when a user attempts to install a Stack using:
$ csdx seed -r "owner"
$ csdx seed -r "owner/repository"