The CLI plugin command
The Sitecore CLI includes a plugin command. This command manages plugins that contain additional CLI commands.
The version displayed in the terminal is the latest official release available.
Usage
You can use the command as follows:
Subcommands
You can use the following subcommands:
- The
initsubcommand - initializes default plugins. Available starting with version 4.1.0 - The
addsubcommand - adds or updates a plugin in your project. - The
removesubcommand - removes a plugin from your project. - The
listsubcommand - lists all the installed plugins.
The init subcommand
The init subcommand initializes default plugins.
You can use the following options with the init subcommand:
-c, --config- Optional. The path to thesitecore.jsonconfiguration file. Default: current working directory.--version- Optional. The version of the default plugins to install. If not specified, the CLI installs the version of the plugin matching the CLI version.--overwrite- Optional. Allow overwriting or updating existing plugins. Plugins that were not installed previously are installed with the latest version or the specified version.--prerelease- Optional. Allow pre-release versions for default plugins.-v, --verbose- Optional. Report additional diagnostic and performance data.-t, --trace- Optional. Report additional diagnostic and performance data.-?, -h, --help- Optional. Help for the command.
Examples:
Initialize the default plugins
Command:
Output:
If the default plugins already exist, the CLI displays messages to inform you, for example, You have already installed Sitecore.DevEx.Extensibility.Serialization.
Initialize a specific plugin version
Command:
Output:
Overwrite existing plugins with a newer version
Command:
Output:
The add subcommand
You can use the following options with the add subcommand:
-c, --config- Optional. The path to thesitecore.jsonconfiguration file. Default: current working directory.-n, --name- Required. Name of the plugin to install into the current project.--version- Optional. The version of the plugin to install. If it is not specified, the CLI installs the latest version.-v, --verbose- Optional. Report additional diagnostic and performance data.-t, --trace- Optional. Report additional diagnostic and performance data.-?, -h, --help- Optional. Help for the command.
Examples:
Add a plugin using the latest version
Command:
Output:
If you do not specify the --version option, the CLI installs the latest version. If you specify a plugin version higher than the one already installed, the CLI updates it to the newer version. If the package does not exist, the CLI displays a message to inform you.
Add a specific plugin version
Command:
Output:
The remove subcommand
You can use the following options with the remove subcommand:
-c, --config- Optional. The path to thesitecore.jsonconfiguration file. Default: current working directory.-n, --name- Required. Name of the plugin to install into the current project.-v, --verbose- Optional. Report additional diagnostic and performance data.-t, --trace- Optional. Report additional diagnostic and performance data.-?, -h, --help- Optional. Help for the command.
Example:
Command:
Output:
If the plugin does not exist, the CLI displays a message to inform you, for example, The plugin Sitecore.DevEx.Extensibility.PluginDoesNotExist does not appear to be installed.
The list subcommand
You can use the following options with the list subcommand:
-c, --config- Optional. The path to thesitecore.jsonconfiguration file. Default: current working directory.-v, --verbose- Optional. Report additional diagnostic and performance data.-t, --trace- Optional. Report additional diagnostic and performance data.-?, -h, --help- Optional. Help for the command.
Example:
Command:
Output: