The CLI plugin command

Abstract

Reference of the DevEx CLI plugin command that manages plugins that contain additional CLI commands.

The Sitecore CLI includes a plugin command. This command manages plugins that contain additional CLI commands.

Note

The version displayed in the terminal is the latest official release available.

You can use the command as follows:

sitecore plugin [subcommand] [options]

You can use the following subcommands:

Subcommand

Description

add

Add or update a plugin in your project.

remove

Removes a plugin from your project.

list

Lists all the installed plugins.

You can use the following options with the add subcommand:

Option

Required?

Description

-c, --config

No

The path to the sitecore.json configuration file (default: cwd).

-n, --name

Yes

Name of the plugin to install into the current project.

--version

No

The version of the plugin to install. If it isn't specified, the CLI installs the latest version.

-v, --verbose

No

Report additional diagnostic and performance data.

-t, --trace

No

Report additional diagnostic and performance data.

-?, -h, --help

No

Help for the command.

You can use the following options with the remove subcommand:

Option

Required?

Description

-c, --config

No

The path to the sitecore.json configuration file (default: cwd).

-n, --name

Yes

Name of the plugin to install into the current project.

-v, --verbose

No

Report additional diagnostic and performance data.

-t, --trace

No

Report additional diagnostic and performance data.

-?, -h, --help

No

Help for the command.

You can use the following options with the list subcommand:

Option

Required?

Description

-c, --config

No

The path to the sitecore.json configuration file (default: cwd).

-v, --verbose

No

Report additional diagnostic and performance data.

-t, --trace

No

Report additional diagnostic and performance data.

-?, -h, --help

No

Help for the command.

The following are examples of the plugin command use:

Command

Result

sitecore plugin add -n Sitecore.DevEx.Extensibility.Serialization

Output:

Successfully installed version 4.0.0 of plugin Sitecore.DevEx.Extensibility.Serialization

Note

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.

sitecore plugin add -n Sitecore.DevEx.Extensibility.Serialization --version 4.0.0

Output:

Successfully installed version 4.0.0 of plugin Sitecore.DevEx.Extensibility.Serialization

sitecore plugin remove -n Sitecore.DevEx.Extensibility.Serialization

Output:

Successfully deleted version 4.0.0 of plugin Sitecore.DevEx.Extensibility.Serialization

Note

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.

sitecore plugin list

Output:

List of plugins: 
Sitecore.DevEx.Extensibility.Indexing v.4.0.0
Sitecore.DevEx.Extensibility.Publishing v.4.0.0
Sitecore.DevEx.Extensibility.ResourcePackage v.4.0.0
Sitecore.DevEx.Extensibility.Serialization v.4.0.0