Welcome to the navigation

Elit, eiusmod irure non magna ut labore ex veniam, quis voluptate mollit enim do pariatur, ea lorem in nisi ad ut in qui aute cillum. Ullamco ad dolor amet, eiusmod incididunt in pariatur, dolore tempor duis voluptate cillum esse quis id occaecat exercitation velit proident, sunt fugiat sed anim est

Yeah, this will be replaced... But please enjoy the search!

Optimizely CMS 12 CLI tools, getting started

Since the launch of CMS 12, the usage of CLI tools (command-line interfaces) has accelerated. This is mostly awesome since it is costly and not very platform multi-platform to build graphical user interfaces. CLI tools are also simpler to ship and install and usually more powerful.

 

Begin by installing the Optimizely .NET Templates

dotnet new -i EPiServer.Templates

If you already have installed the templates, ensure they are updated 

dotnet new --update-check

If there are updates available it will look like this

I'll go ahead and update all packages

dotnet new --update-apply

 

Install the Optimizely CLI Tool

Already have it? Check which version in that case

dotnet-episerver --version

To verify that you have the latest version check with Optimizelys nuget feed

nuget list EPiServer.Net.Cli -Source "https://nuget.optimizely.com/feed/packages.svc/"

 

 

To install the Optimizely CLI Tool

dotnet tool install EPiServer.Net.Cli --global --add-source https://nuget.optimizely.com/feed/packages.svc/

To update or reinstall the Optimizely CLI Tool

dotnet tool update EPiServer.Net.Cli --global --add-source https://nuget.optimizely.com/feed/packages.svc/

Usage

First, we need to think of the CLI tools as two products, dotnet and dotnet-episerver (this may change to dotnet-optimizely) where dotnet is the standard Microsoft dotnet command CLI and dotnet-episerver is the custom command specifically relating to Optimizely products.

Create resources using the dotnet command

Setup a new CMS or Commerce site

To list all new templates

dotnet new --list Optimizely

To list all current templates, old and new

dotnet new --list epi

To install any of these templates use the following syntax

dotnet new epi-cms-empty

Create resources using the dotnet-episerver command

The Optimizely CLI tool contains four main functions

  • create-cms-database
  • create-commerce-database
  • update-database
  • add-admin-user

Use the following syntax to create resources

dotnet-episerver <command> <parameters>

Check my other blog posts for a better understanding of the dotnet-episerver command.