Plugins

A plugin is a library that extends the CLI with additional commands. Plugins are automatically registered when the application starts, if they are located in either of the following:

  • A plugins folder within the application directory, alongside the binary.

    RequestResponse
    // [!code word:<PARENT_DIRECTORY>] 
    
    -- <PARENT_DIRECTORY> 
      |-- copyrights
      |-- plugins
      |  |-- <see directory structure below> 
      |-- ch-cli(.exe)
      |-- LICENSE.md
    
    
  • A plugins folder within the configuration directory in the user profile.

Note

You can specify search paths by using the environment variable CH_CLI_PLUGIN_SEARCH_PATHS. If you want to use more than one path, separate them using ; or ,.

The file structure within a search directory includes a separate folder for each plugin:

RequestResponse
// [!code word:<YOUR_PLUGIN_DIRECTORY>] 
// [!code word:<PLUGIN MAIN ASSEMBLY>] 
// [!code word:<OPTIONAL PLUGIN DEPENDENCIES>] 

-- plugins
  |-- Sitecore.CH.Cli.Plugin.Applications
  |  |-- Sitecore.CH.Cli.Plugin.Applications.dll
  |-- Sitecore.CH.Cli.Plugin.Audit
  |  |-- Sitecore.CH.Cli.Plugin.Audit.dll
  |-- <YOUR_PLUGIN_DIRECTORY> 
    |-- <PLUGIN MAIN ASSEMBLY>.dll
    |-- <OPTIONAL PLUGIN DEPENDENCIES>

Do you have some feedback for us?

If you have suggestions for improving this article,