🚀. 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

npmnpm
Version
5.2.0
Version published
Weekly downloads
1.2K
-18.66%
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 always run opti-cms --help or opti-cms [command] --help to see all information for the CLI utility or command. If the command is omitted, the CLI will assume the cms:version command.

CommandDescription
cms:versionFetch the version of the CMS from the endpoint. See 3.2. Check build and CMS Versions
cms:resetReset the CMS instance by removing all Content, Content Types and Display Templates.
Note: This currently requires some manual steps, the CLI will provide the needed guidance on these manual steps.
types:pullRead all existing content types from the Optimizely CMS and create their representation within the codebase. Use the parameters of this method to control which types will be pulled and to allow overwriting of existing files.
types:pushCreate or overwrite the content type defintions from the codebase into Optimizely CMS, use the parameters of this method to control which types will be transferred and whether destructive changes are allowed.
nextjs:factoryGenerate the component factories needed for suggested implementation pattern of Optimizely CMS in Next.JS. See 3.1. Generate React Component Factory

3.1. Generate React Component Factory

This is a companion method to the ComponentFactory / DefaultComponentFactory implementation within @remkoj/optimizely-cms-react that is used to resolve content types within Optimizely CMS into React Components. This method will create the needed files to easily construct the factory from the components in the frontend.

Usage & example

Command: nextjs:factory

yarn opti-cms nextjs:factory -f

Command line parameters

ParameterAliasUsageDefault
--excludeTypes--ectKey of content type to exclude. Can be used multiple times to exclude a list of content types[]
--excludeBaseTypes--ebtExclude all content types, with one of these base types. If provided it will replace the default. Add multiple times to build a list["folder","media","image","video"]
--baseTypes-bSelect only content types with one of these base types. Add multiple times to build a list[]
--types-tSelect content types with this key. Add multiple times to build a list[]
--all-aInclude non-supported base types, non supported base types are skipped by default
--force-fBy default, this method is none-destructive. Set this parameter to overwrite existing files.

3.2. Check build and CMS Versions

Connect to the Optimizely CMS Service to fetch service health and version information.

Usage & example

Command: cms:version

yarn opti-cms cms:version

FAQs

Package last updated on 09 Jan 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