- Install and setup Sitecore CLI
Install Sitecore Command Line Interface
Sitecore Command Line Interface (CLI) is a tool that you install in a terminal.
To upgrade an existing CLI installation, see Upgrade Sitecore Command Line Interface.
You can install Sitecore CLI either as a local tool for individual projects or as a global tool for all projects.
We do not recommend installing Sitecore CLI as a global tool. Different Sitecore instances might need different versions of the Sitecore CLI.
You must have .NET 10 installed on your workstation before installing the Sitecore CLI. If you do not have the required version of .NET Core installed, you get the following message:
To install Sitecore CLI as a local project tool:
-
Open a terminal with administrator privileges.
-
Run the following commands to install Sitecore CLI:
NoteOther developers working on the same project only have to run
dotnet tool restoreto install Sitecore CLI.To install the CLI globally, use the
-goption when running theinstallcommand (not recommended).When the installation is complete, you get the following message:
NoteThe examples in the following steps use an example version for simplicity, but when you install the CLI, the version displayed in the terminal is the latest official release available.
-
To initialize your new project, run the following command in your project folder:
NoteThe command
dotnet sitecore initadds default plugins with the same version as the CLI to thesitecore.jsonfile. The plugins areSitecore.DevEx.Extensibility.Serialization,Sitecore.DevEx.Extensibility.Publishing,Sitecore.DevEx.Extensibility.Indexing,Sitecore.DevEx.Extensibility.ResourcePackage, andSitecore.DevEx.Extensibility.Database. On the next Sitecore CLI command, the CLI attempts to resolve and install the plugins for you. -
Verify the initialization on your project with the following command:
If this is the first command after
dotnet sitecore init, the CLI attempts to resolve and install the plugins listed in thesitecore.jsonfile. The command prints a message informing you which plugins are being installed. For example:If the installation is successful, the command lists the installed plugins and their version information:
If the installation of any plugin fails, the output shows a
[Failed]status for that plugin. -
To verify that the Sitecore CLI works, go to your project folder in a terminal and type
dotnet sitecore -h.If the Sitecore CLI is ready, you get a message describing the usage, options, and available top-level commands. For example: