Sitecore Command Line Interface and Features | Sitecore Development Services in USA India

Sitecore Command Line Interface and Features

Published on : June 29, 2022

Sitecore Command Line Interface and Features

Sitecore 10 has released two new modules Sitecore command-line interface and Sitecore for Visual Studio for serializing Sitecore contents. It is easy to port different Sitecore instances like one dev to another dev/ local/UAT or higher). It provides the ability to login into the remote Sitecore instance, serialize items, and publish, package, and additional commands reference for the command line.

Sitecore Command Line Interface (CLI) is a tool that you install in a terminal and either as a local tool for individual projects or as a global tool for all projects. Sitecore CLI is free and can be accessed via PowerShell whereas Sitecore for Visual studio has plugins, but it requires a separate license. To install Sitecore CLI the required version of .NET Core is installed in the workstation before installing the Sitecore CLI.

Sitecore has provided publishing and Serialization plugins that can easily install as part of the Sitecore CLI NuGet extensibility release.

The publishing plugin helps us to publish Sitecore Items with configurable options from your local machine to the target database. serialization plugin helps us to serialize, share and deploy content items, as well as keep them in version control.

Serialization

Serialization is a process to collect an item from the Sitecore Content Tree and store it as a file system for the development team. This ability to synchronize it to another Sitecore instance. So, it’s used to move items from our local environment to any environment. As well as to share items between developers.

Prerequisites to be installed on the workstation:

• Sitecore 10/above instance
• Sitecore. management services package.

To install Sitecore Management Service in CM Download the Sitecore.ManagementServices package file from the Sitecore Downloads site. On the Sitecore Launchpad, click Control Panel, and Install a package. Then follow the Installation Wizard to install the Sitecore.managementservices package file.

• .NET Core

The steps here are taken from the Sitecore documentation website which is very easy to follow.

• Make sure you have .NET Core installed, the CLI is a .NET Core CLI Tool
• Open PowerShell session
• cd <project folder>
• dotnet new tool-manifest
• dotnet tool install Sitecore.CLI –add-source https://sitecore.myget.org/F/sc-packages/api/v3/index.json

Sitecore CLI – commands

Sitecore login will launch a popup where you can log in as a user into the Sitecore environment.
Sitecore init provides your project with some sitecore.json configuration file.
Sitecore ser info shows you an overview of all configured module.json files.
Sitecore ser watches to automatically serialize changes made in Sitecore to the file system.
Sitecore ser pushes to push your changes to Sitecore.
Sitecore ser pull to pull an item from Sitecore instance to file system.
Sitecore ser diff to check the difference between two Sitecore instance items.
Sitecore ser package to check available package commands.

Scroll to Top