This page explains how to install the Optimizely SDK and CLI into your project.
- The SDK is a library with tools to model your content, fetch it and render it
- The CLI is a terminal app to upload your models to the CMS via the CMS REST API
You can run the CLI directly without installing it using npx:
npx @optimizely/cms-cli@latestThis will always use the latest version and doesn't require installation. You should see a command list.
Alternative: Install the CLI
npm install @optimizely/cms-cli -gYou can test that it worked by running:
optimizely-cms-clinpm install @optimizely/cms-cli -DThen use it from the project:
optimizely-cms-cliWe recommend to initialize a Next.js project. Run:
npx create-next-app@latestAnd select the following prompts:
- Would you like to use TypeScript: Yes
- Would you like your code inside a
src/directory? Yes - Would you like to use App Router? (recommended) Yes
npm install @optimizely/cms-sdkNow, you are ready to set up the CLI