🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

@remkoj/optimizely-cms-cli

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remkoj/optimizely-cms-cli

Optimizely CMS CLI Tools

latest
npmnpm
Version
5.3.1
Version published
Weekly downloads
1.2K
-16.24%
Maintainers
1
Weekly downloads
 
Created
Source

Optimizely CMS Command Line Toolkit

[!WARNING] There'll be an update of Optimizely SaaS CMS that is incompatible with all SDK versions prior to 5.1.6. If you don't upgrade, you will see empty pages (main website) and "Component not found" messages (preview).

A collection of Command Line tools used to increase productivity when working with the Optimizely CMS from a TypeScript / JavaScript based frontend.

The defaults and methods are based upon using a Next.JS application with the conventions introduced by the Create Next App template

1. Installing

This package has been designed to work in a Yarn PnP / Zero-install environment, it may or may not work with other package managers.

yarn add --dev @remkoj/optimizely-cms-cli

2. General usage and parameters

  • List all commands and global parameters: yarn opti-cms --help
  • Build version: yarn opti-cms --version
  • Command specific help and parameters: yarn opti-cms [command] --help

2.1. Global parameters

All commands share these parameters that configure the frontend environment.

ParameterAliasUsageDefault
--versionShow version number
--path-pThe application root folderThe current working directory
--components-cThe components folder within the application./src/components/cms
--cms_url--cuThe Url of the Optimizely CMS ServiceCalculated from the environment variables OPTIMIZELY_CMS_URL and OPTIMIZELY_CMS_SCHEMA
--client_id--ciThe CMS Service Client IDTaken from the environment variable OPTIMIZELY_CMS_CLIENT_ID
--client_secret--csThe CMS Service Client SecretTaken from the environment variable OPTIMIZELY_CMS_CLIENT_SECRET
--user_iduThe CMS User to impersonateTaken from the environment variable OPTIMIZELY_CMS_USER_ID
--verboseShow debugging output
--helpShow help text

2.2. Environment variables

This CLI tool shares the environment variables with @remkoj/optimizely-cms-api. When starting the CLI tool, it looks for .env and .env.local to extend the environment variables and thus works using the Next.JS conventions.

3. Available commands

The following commands are available. You can run opti-cms --help or opti-cms [command] --help to view all options. If the command is omitted, the CLI defaults to cms:version.

CommandDescriptionUsage
cms:resetCompletely clear & reset the CMS DatabaseSee usage
cms:versionGet the CMS Version informationSee usage
nextjs:componentsCreate the React Components for a Next.JS / Optimizely Graph structureSee usage
nextjs:createScaffold a complete Next.JS / Optimizely Graph structureSee usage
nextjs:factoryCreate the ComponentFactory for a Next.JS / Optimizely Graph structureSee usage
nextjs:fragmentsCreate the GrapQL Fragments for a Next.JS / Optimizely Graph structureSee usage
nextjs:queriesCreate the GrapQL Queries to use two queries to load contentSee usage
nextjs:visualbuilderCreate the React Components for Visual Builder in a Next.JS / Optimizely Graph structureSee usage
style:createCreate a new style definitionSee usage
styles:deleteRemove Visual Builder style definitions from the CMSSee usage
styles:listList Visual Builder style definitions from the CMSSee usage
styles:pullCreate Visual Builder style definitions from the CMSSee usage
styles:pushPush Visual Builder style definitions into the CMS (create/patch)See usage
types:pullPull content type definition files into the projectSee usage
types:pushPush content type definition into Optimizely CMS (create / replace)See usage

cms:reset

yarn opti-cms cms:reset

Command-specific parameters: none. This command only uses global parameters.

cms:version

yarn opti-cms cms:version

Command-specific parameters: none. This command only uses global parameters.

nextjs:components

yarn opti-cms nextjs:components
ParameterAliasUsageExample
--excludeTypes--ectExclude specific content type keysyarn opti-cms nextjs:components --excludeTypes StartPage --excludeTypes LandingPage
--excludeBaseTypes--ebtExclude specific base typesyarn opti-cms nextjs:components --excludeBaseTypes media
--baseTypes-bInclude only the selected base typesyarn opti-cms nextjs:components -b page -b section
--types-tInclude only the selected content type keysyarn opti-cms nextjs:components -t StartPage
--all-aInclude non-supported base typesyarn opti-cms nextjs:components -a
--force-fOverwrite existing generated filesyarn opti-cms nextjs:components -f

nextjs:create

yarn opti-cms nextjs:create
ParameterAliasUsageExample
--excludeTypes--ectExclude specific content type keysyarn opti-cms nextjs:create --excludeTypes StartPage
--excludeBaseTypes--ebtExclude specific base typesyarn opti-cms nextjs:create --excludeBaseTypes media
--baseTypes-bInclude only the selected base typesyarn opti-cms nextjs:create -b page -b experience
--types-tInclude only the selected content type keysyarn opti-cms nextjs:create -t StartPage
--all-aInclude non-supported base typesyarn opti-cms nextjs:create -a
--force-fOverwrite existing generated filesyarn opti-cms nextjs:create -f

nextjs:factory

yarn opti-cms nextjs:factory
ParameterAliasUsageExample
--excludeTypes--ectExclude specific content type keysyarn opti-cms nextjs:factory --excludeTypes StartPage
--excludeBaseTypes--ebtExclude specific base typesyarn opti-cms nextjs:factory --excludeBaseTypes media
--baseTypes-bInclude only the selected base typesyarn opti-cms nextjs:factory -b page
--types-tInclude only the selected content type keysyarn opti-cms nextjs:factory -t StartPage
--all-aInclude non-supported base typesyarn opti-cms nextjs:factory -a
--force-fOverwrite existing generated filesyarn opti-cms nextjs:factory -f

nextjs:fragments

yarn opti-cms nextjs:fragments
ParameterAliasUsageExample
--excludeTypes--ectExclude specific content type keysyarn opti-cms nextjs:fragments --excludeTypes StartPage
--excludeBaseTypes--ebtExclude specific base typesyarn opti-cms nextjs:fragments --excludeBaseTypes media
--baseTypes-bInclude only the selected base typesyarn opti-cms nextjs:fragments -b page -b section
--types-tInclude only the selected content type keysyarn opti-cms nextjs:fragments -t StartPage
--all-aInclude non-supported base typesyarn opti-cms nextjs:fragments -a
--force-fOverwrite existing generated filesyarn opti-cms nextjs:fragments -f

nextjs:queries

yarn opti-cms nextjs:queries
ParameterAliasUsageExample
--excludeTypes--ectExclude specific content type keysyarn opti-cms nextjs:queries --excludeTypes StartPage
--excludeBaseTypes--ebtExclude specific base typesyarn opti-cms nextjs:queries --excludeBaseTypes media
--baseTypes-bInclude only selected base types (defaults to page and experience)yarn opti-cms nextjs:queries -b page
--types-tInclude only the selected content type keysyarn opti-cms nextjs:queries -t StartPage
--all-aInclude non-supported base typesyarn opti-cms nextjs:queries -a
--force-fOverwrite existing generated filesyarn opti-cms nextjs:queries -f

nextjs:visualbuilder

yarn opti-cms nextjs:visualbuilder
ParameterAliasUsageExample
--excludeTypes--ectExclude specific content type keysyarn opti-cms nextjs:visualbuilder --excludeTypes StartPage
--excludeBaseTypes--ebtExclude specific base typesyarn opti-cms nextjs:visualbuilder --excludeBaseTypes media
--baseTypes-bInclude only the selected base typesyarn opti-cms nextjs:visualbuilder -b section
--types-tInclude only the selected content type keysyarn opti-cms nextjs:visualbuilder -t StandardPage
--all-aInclude non-supported base typesyarn opti-cms nextjs:visualbuilder -a
--force-fOverwrite existing generated filesyarn opti-cms nextjs:visualbuilder -f

style:create

yarn opti-cms style:create

Command-specific parameters: none. This command is interactive and prompts for all required values.

styles:delete

yarn opti-cms styles:delete
ParameterAliasUsageExample
--excludeTypes--ectExclude content types when resolving style targetsyarn opti-cms styles:delete --excludeTypes StartPage
--excludeBaseTypes--ebtExclude base types when resolving style targetsyarn opti-cms styles:delete --excludeBaseTypes media
--baseTypes-bInclude only styles targeting selected base typesyarn opti-cms styles:delete -b section
--types-tInclude only styles targeting selected content typesyarn opti-cms styles:delete -t StartPage
--all-aInclude non-supported base typesyarn opti-cms styles:delete -a
--excludeNodeTypes--entExclude specific node typesyarn opti-cms styles:delete --excludeNodeTypes row
--excludeTemplates--etExclude specific style template keysyarn opti-cms styles:delete --excludeTemplates hero
--nodes-nInclude only selected node typesyarn opti-cms styles:delete -n row
--templates-dInclude only selected style template keysyarn opti-cms styles:delete -d hero -d article
--templateTypes--ttInclude only selected style target types (node, base, component)yarn opti-cms styles:delete --tt node --tt base
--force-fActually perform delete; without this the command shows a dry previewyarn opti-cms styles:delete -f
--withStyleFile-wAlso delete local .opti-style.json filesyarn opti-cms styles:delete -f -w
--definitions-uUpdate/delete generated TypeScript display template helpersyarn opti-cms styles:delete -f -u

styles:list

yarn opti-cms styles:list

Command-specific parameters: none. This command only uses global parameters.

styles:pull

yarn opti-cms styles:pull
ParameterAliasUsageExample
--excludeTypes--ectExclude content types when resolving style targetsyarn opti-cms styles:pull --excludeTypes StartPage
--excludeBaseTypes--ebtExclude base types when resolving style targetsyarn opti-cms styles:pull --excludeBaseTypes media
--baseTypes-bInclude only styles targeting selected base typesyarn opti-cms styles:pull -b section -b element
--types-tInclude only styles targeting selected content typesyarn opti-cms styles:pull -t StartPage
--all-aInclude non-supported base typesyarn opti-cms styles:pull -a
--excludeNodeTypes--entExclude specific node typesyarn opti-cms styles:pull --excludeNodeTypes row
--excludeTemplates--etExclude specific style template keysyarn opti-cms styles:pull --excludeTemplates hero
--nodes-nInclude only selected node typesyarn opti-cms styles:pull -n row
--templates-dInclude only selected style template keysyarn opti-cms styles:pull -d hero -d article
--templateTypes--ttInclude only selected style target types (node, base, component)yarn opti-cms styles:pull --tt component
--force-fOverwrite existing generated filesyarn opti-cms styles:pull -f
--definitions-uCreate or update generated TypeScript definitionsyarn opti-cms styles:pull -u

styles:push

yarn opti-cms styles:push
ParameterAliasUsageExample
--excludeTemplates-eExclude style template keys from pushyarn opti-cms styles:push -e hero
--templates-tPush only selected style template keysyarn opti-cms styles:push -t hero -t article

types:pull

yarn opti-cms types:pull
ParameterAliasUsageExample
--excludeTypes--ectExclude specific content type keysyarn opti-cms types:pull --excludeTypes StartPage
--excludeBaseTypes--ebtExclude specific base typesyarn opti-cms types:pull --excludeBaseTypes media
--baseTypes-bInclude only selected base typesyarn opti-cms types:pull -b page -b section
--types-tInclude only selected content type keysyarn opti-cms types:pull -t StartPage
--all-aInclude non-supported base typesyarn opti-cms types:pull -a
--force-fOverwrite existing generated filesyarn opti-cms types:pull -f

types:push

yarn opti-cms types:push
ParameterAliasUsageExample
--force-fForce overwrite/replace while pushing to CMSyarn opti-cms types:push -f
--excludeTypes--ectExclude specific content type keys from pushyarn opti-cms types:push --excludeTypes StartPage
--excludeBaseTypes--ebtExclude content type base types from pushyarn opti-cms types:push --excludeBaseTypes media
--baseTypes-bPush only content types with selected base typesyarn opti-cms types:push -b page
--types-tPush only selected content type keysyarn opti-cms types:push -t StartPage -t ArticlePage

FAQs

Package last updated on 23 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts