super-contentful
v0.12.3
Published
Command line management tool for Contentful.
Downloads
1
Maintainers
Readme
Super Contentful
Command line management tool for Contentful.
Installation
To install Super Contentful with Yarn, type in the following command on the terminal:
yarn add super-contentful
To install Super Contentful with NPM, type in the following:
npm install super-contentful
Usage
Once you installed Super Contentful, a global scf
command should be available for use(scf
stands for Super Contentful).
The tool follows a workflow for working with Environments and Spaces in Contentful with management commands(and sub-commands).
See Workflow for a description on how to use to migrate data and test new features using Contentful.
Exploring scf
First things first, you are free to sneak into Super Contentful using the help
flag.
Type in the following in your terminal:
scf --help
scf --help
will print a message listing all available commands, with a description for each:
scf <cmd> [args]
Management commands for Contentful
Commands:
scf export [args] Export Space entries and assets to a JSON
file
scf import [args] Import content models, entries and assets
from a JSON file
scf generate [args] <name> Generate migration file for the content
model of a Space [aliases: gen]
scf make-migration [args] <name> Create an empty migration file
scf migrate [args] Parses and runs a migration script on given
Environment
scf environment <cmd> [args] Management commands for Contentful
Environmets [aliases: env]
scf space <cmd> [args] Management commands for Contentful Spaces
scf organization <cmd> [args] Management commands for Contentful
Organizations [aliases: org]
Options:
--help Show help [boolean]
--version Show version number [boolean]
From there you can explore sub command of scf by typing scf <sub-command> --help
. For example:
$ scf export --help
Export Space entries and assets to a JSON file
Options:
--help Show help [boolean]
--version Show version number [boolean]
--spaceId, -s Contentful Space ID [string]
--envFile, -f Location of a .env file [boolean] [default: true]
--managementToken, -t Contentful management token [string]
--contentOnly, -o Only export entries and assets [boolean]
--fromDate, -d An RFC 2822 or ISO 8601 date time string - When
specified this commanmd will only export content and
assets that were created since the specified date and
time [string]
Examples:
scf export Export the entries and assets of the
default Space
scf export -s 7fc67add Export the entries and assets of
Space "7fc67add"
scf export --envFile Load environment variables from
<project_dir>/.env, then export the
entries and assets of the default
Space
scf export --fromDate "2018-06-01 10:00" Export the entries and assets which
have been updated since(including) 1
June 2018, 10AM
Workflow
The set of commands provided by Super Contentful implement the workflow described below for both Spaces and Environments in Contentful, thus it can work with both the new subscription(which limit number of Spaces a user can create in favor Sandbox Environments) and legacy subscriptions(which doesn't have Sandbox Environments).