Setting up Sitecore CLI is an essential step to streamline your Sitecore development workflow. Here’s a guide to configuring Sitecore CLI for your project:
1. Install .NET SDK: First, make sure you have .NET SDK version 4.8 installed on your machine to match the requirements for Sitecore 10.3. You can refer to the Sitecore Compatibility Table for Sitecore XP 9.0 and later to ensure compatibility. Sitecore Compatibility Table
2. Install Sitecore Management Services: Download and install Sitecore Management Services into your Sitecore instance.
3. Open the Command Line: Navigate to your project directory and open the Command Prompt (CMD) or your terminal.
4. Install Sitecore CLI: Run the following commands in your CMD or terminal:
dotnet new tool-manifest
dotnet nuget add source -n Sitecore https://nuget.sitecore.com/resources/v3/index.json
dotnet tool install Sitecore.CLI
5. Initialize Your Project: After installing Sitecore CLI, initiate your project with the following command within your project folder:
dotnet sitecore init
This command sets up the project configuration and creates a sitecore.json file in your project directory.
6. Configure Project Structure: In your sitecore.json file, you can specify your project’s module and plugin configurations. Customize it according to your project’s needs. Here’s a sample sitecore.json structure:
{
"$schema": "./.sitecore/schemas/RootConfigurationFile.schema.json",
"modules": [
"./serialization/*/*.module.json"
],
"plugins": [
"Sitecore.DevEx.Extensibility.Serialization@4.2.0",
"Sitecore.DevEx.Extensibility.Publishing@4.2.0",
"Sitecore.DevEx.Extensibility.Indexing@4.2.0",
"Sitecore.DevEx.Extensibility.ResourcePackage@4.2.0"
],
"serialization": {
"defaultMaxRelativeItemPathLength": 100,
"defaultModuleRelativeSerializationPath": "serialization",
"removeOrphansForRoles": true,
"continueOnItemFailure": false,
"excludedFields": []
}
}
7. Create Module Folders: Organize your project by creating module folders within a “serialization” directory. Typically, you’ll have Feature, Project, and Foundation folders if you’re following the Helix architecture. Customize this structure as needed. For example, you can create a “Feature” folder and add a .module.json file inside it:
{
"namespace": "[YOUR NAMESPACE NAME]",
"description": "[DESCRIPTION OF THE MODULE]",
"tags": ["content"],
"items": {
"includes": [
{
"name": "SCSSolution.SiteContent",
"path": "/sitecore/Templates/Feature"
}
]
}
}
8. Connect to a Sitecore Instance: Use the following command to connect to your Sitecore instance. Replace <Sitecore identity server> and <Sitecore instance> with your actual server URLs:
dotnet sitecore login --authority https://<Sitecore identity server> --cm https://<Sitecore instance> --allow-write true
This will open your Sitecore instance’s login screen in a browser tab. Log in and allow access.

After Succefull login you will see the message in your terminal :

9. Pull Updates from Sitecore: To retrieve updated items from your Sitecore instance, run the following command:
dotnet sitecore ser pull
This command will pull all the templates from your Feature folder and generate corresponding .yaml files.
With these steps completed, you’re all set to streamline your Sitecore development with Sitecore CLI. Happy coding! 😊


