Series of Sitecore CLI blogs
- Set up Sitecore CLI
- All about Sitecore CLI configurations
- All about Sitecore Serialization
You can check if you have the serialization plugin:
> dotnet sitecore plugin list
If plugin is not there, then install it by running:
> dotnet sitecore plugin add -n Sitecore.DevEx.Extensibility.Serialization
To get the information about serialization commands run:
> dotnet sitecore ser -h
You will get all the information about parameters like below:

Once setup of Sitecore CLI and Sitecore content serialization configuration is done, you are good to execute serialization of items.
First, login via interactive or non interactive flow(check link for more details):
Here, will go with non-interactive client login:
> dotnet sitecore login --authority https://<sitecore-identity-server> --cm http://<sitecore-instance> --allow-write true --client-credentials true --client-id <client-id> --client-secret <client-secret>
Login information will be saved in .sitecore/user.json.
Pull:
Serialize items from Sitecore to disk
You can figure out usage of individual commands with -h or –help command.

- Pull all items as configured in *.module.json.
> dotnet sitecore ser pull
After pulling items, you will see .yml file corresponding to each item in sitecore in disk
- Pull items from specific module only(with tags separated by comma ,For inserting tags, check – link)
> dotnet sitecore ser pull -i tags:[tagA,tagB]
- Pull items from specific module only(with Module namespace)
> dotnet sitecore ser pull -i ModuleA ModuleB
- Pull all items except certain modules with tags:
> dotnet sitecore ser pull -e tags:[tagA,tagB]
- Pull all items except some modules(with Module namespace)
> dotnet sitecore ser pull -e ModuleA ModuleB
- Pull items without integrity validation
> dotnet sitecore ser pull -s
- Check the differences/changes in disk and Sitecore without actually pulling it
> dotnet sitecore ser pull --what-if
Validate
Ensures file system integrity of serialized items in disk and their paths
It performs the following checks on serialized items:
- Invalid physical path.
- Orphaned parent ID.
- Non-included item.
- Empty folder.
- Duplicate item ID.
- Non-unique path.

- Run the validation on serialized items
> dotnet sitecore ser validate
- Fix the issues found in validation above
> dotnet sitecore ser validate --fix
If the --fix
command finds duplicate content items in your file system, it keeps the last updated one and deletes the oldest one.
Package
- Create package of serialized items in disk
> dotnet sitecore ser pkg create -o FILE_PATH
Package with extension .itempackage will be created at the file path given in command.
Create package at root path location
> dotnet sitecore ser pkg create -o <Package name>
- Install the created package in Sitecore
> dotnet sitecore ser pkg install -f FILE_PATH
Push
Serialize items from disk to Sitecore
Push commands can be executed just like pull commands.
- Push all items as configured in *.module.json.
> dotnet sitecore ser push
- Push items from specific module only(with tags separated by comma , for inserting tags, check – link)
> dotnet sitecore ser push -i tags:[tagA,tagB]
- Push items from specific module only(with Module namespace)
> dotnet sitecore ser push -i ModuleA ModuleB
- Push all items except certain modules with tags:
> dotnet sitecore ser push -e tags:[tagA,tagB]
- Push all items except some modules(with Module namespace)
> dotnet sitecore ser push -e ModuleA ModuleB
- Push items without integrity validation
> dotnet sitecore ser push -s
- Check the differences/changes in disk and Sitecore without actually pushing it
> dotnet sitecore ser push --what-if
Explain
To check if specific path is present in any modules.
> dotnet sitecore ser explain --path "PATH"
It will return the module information in which mentioned “path” is present.
Watch
Pull the changed items automatically into file system.
- Activate watch
> dotnet sitecore ser watch