Tailwind Logo

Install Sitecore CLI

CLI

Published: 2022-05-18

Sitecore provides a command line tool that can be used for development efficiency and operation. In this article, we will show you how to install this tool, Sitecore CLI.

Sitecore Command Line Interface

The following sites provide help documentation on how to use the command line interface.

The following blog also provides information on the verification procedure.

Unlike the above article, Sitecore CLI has already been released 4.1.0 as of the publication of this blog post.

We will introduce 4.1.0 on this blog.

Prerequisite.

Sitecore CLI 4.1.0 can be used in the following environments

  • Use in combination with Sitecore 10.1 and 10.2
    • Sitecore Management Services must be installed
    • .NET Core 3.1- PowerShell

If you go to the Sitecore CLI NuGet Package site, you will see that .NET Core 3.1 is the target.

cli01.png

Preparation for Installation

NET Core 3.1 is installed if you have already installed Visual Studio or other software. However, if you have not installed it, you can download the module from the following site

cli02.png

The operating environment is now ready.

Install

It is recommended that the Sitecore CLI be installed on a per-project basis. This is because the version of the Sitecore CLI may differ depending on the target Sitecore version. For this reason, we will install it in a local project.

PowerShell
cd <project folder>
dotnet new tool-manifest
dotnet nuget add source -n Sitecore https://sitecore.myget.org/F/sc-packages/api/v3/index.json

Running dotnet new tool-manifest will create a .config folder. dotnet nuget add source -n Sitecore is not required if it has been run once before.

Then install the command.

PowerShell
dotnet tool install Sitecore.CLI

The command is now installed.

cli03.png

Project Initialization

From here, we will perform the initial setup of the project. First, start configuring the Sitecore CLI commands.

PowerShell
dotnet sitecore init

Doing so will add some data.

  • .sitecore folder
  • sitecore.json
  • .gitignore
  • .vscode\settings.json

Install the Sitecore CLI plugin, available in 4.1, for the following items

  • Sitecore.DevEx.Extensibility.Serialization
  • Sitecore.DevEx.Extensibility.Publishing
  • Sitecore.DevEx.Extensibility.Indexing
  • Sitecore.DevEx.Extensibility.ResourcePackage

This time we will install the serialize and publish plug-ins.

PowerShell
dotnet sitecore plugin add -n Sitecore.DevEx.Extensibility.Serialization
dotnet sitecore plugin add -n Sitecore.DevEx.Extensibility.Publishing
cli04.png

The following commands can be used to check the installed plug-ins.

PowerShell
dotnet sitecore plugin list
cli05.png

Summary

We have introduced the installation of Sitecore CLI. We will discuss how to use the tool in another article, but please install Sitecore CLI as much as possible, as we will be using it in our blog from now on.

Related article

Tags