The CLI publish command
Reference of the DevEx CLI publish command that publishes Sitecore Items.
The Sitecore publishing plugin includes a publish
command. This command publishes Sitecore Items. To install the publishing plugin, run the following code:
dotnet sitecore plugin add -n Sitecore.DevEx.Extensibility.Publishing
You can use the command as follows:
dotnet sitecore publish [options]
You can use the following options with the publish
command:
Option | Required? | Description |
---|---|---|
| Optional | The Sitecore environment to use. Default: |
| Optional | Path to root |
| Optional | Comma-separated list of languages to publish. If unspecified, then all languages are published. |
| Optional | Sitecore item path or GUID to smart publish. If unspecified, then the full database is published. |
| Optional | Use republish. If unspecified, then smart-publish is used instead. |
| Optional | Report additional diagnostic and performance data. |
| Optional | Report additional diagnostic and performance data. |
| Optional | Help for the command. |
The following are examples of the publish
command use:
Command | Result |
---|---|
Attempt to publish from the | Does not publish Sitecore items and returns the following message: error: Couldn't resolve a root configuration file (sitecore.json) in the current or any parent directory. Looks like the command may have been executed outside a Sitecore project? |
Attempt to publish from the
| Publishes the Sitecore items from the folder |
| Publishes Sitecore items to the environment with the name |
| Publishes Sitecore items for only the specified languages ( |
| Publishes only the item with path /sitecore/content/Home/Test Item. |
| Creates additional diagnostic and performance data, such as root config path or count of nodes with performance, for example, 73ms (8.1ms/node). |
| Creates additional diagnostic and performance data, such as FSIndex: Loaded filesystem indexes in, for example, 70ms (9 metadatas) or created package of 1 trees in, for example, 1983ms (9 items; 220.3ms/node). |