0.0.10 • Published 1 year ago

xyz-accelerator v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Kontent.ai Model Accelerator

!TIP
The idea behind this tool is to export & import project structure to & from Kontent.ai environments. Data is both exported and imported via Management Api into a specified json format.

Getting started

We recommend running data-ops with npx. Use --help anytime to get information about available commands and their options.

npx @kontent-ai/content-model-accelerator --help

# you can also install the package globally, or locally
npm i @kontent-ai/content-model-accelerator -g

# with the package installed, you can call the tool as follows
kontent-ai-accelerator --help

Use via CLI

Configuration

ConfigValue
environmentIdId of Kontent.ai environment (required)
apiKeyManagement API key (required)
actionOne of (export, list, remoteImport or fileImport) (required)
filenameFilename used to export or import
projectCodename of the remote project (required for remoteImport)
contentTypesComma separated list of codenames. May be used to import only selected content types
contentTypeSnippetsComma separated list of codenames. May be used to import only selected content type snippets
taxonomiesComma separated list of codenames. May be used to import only selected taxonomies
debugIf set to true, full error messages are shown in console log
forceIf set to true, confirmation prompt is disabled

Execution

!CAUTION
We do not recommended importing into a production environment directly (without proper testing). Instead you should first create a testing environment and run the script there to make sure everything works as you intended to.

# List default accelerator models
kontent-ai-accelerator --action=list

# Export existing project into a json
kontent-ai-accelerator --action=export --environmentId=xxx --apiKey=yyy --filename=my-export.json

# Import from file to an existing environment
kontent-ai-accelerator --action=fileImport --environmentId=xxx --apiKey=yyy --filename=my-export.json

# Import from the default accelerator model
kontent-ai-accelerator --action=remoteImport --environmentId=xxx --apiKey=yyy --model=advanced_model

# Import only parts from the default accelerator model
kontent-ai-accelerator --action=remoteImport --environmentId=xxx --apiKey=yyy --model=advanced_model --contentTypes=link --contentTypeSnippets=metadata --taxonomies=persona,product_type

# To get some help you can use:
kontent-ai-accelerator --help