-
Notifications
You must be signed in to change notification settings - Fork 27
Enabling Plugins
This section explains how you enable the Plugin Management Facility (PMF) in a CLI application and how the PMF works in general. When you enable the PMF, you let your CLI accept incoming plug-ins developed by you or a 3rd party.
- Using the Plugin Management Facility (PMF)
- Enabling the Plugin Management Facility
- Managing and loading installed plug-ins
The PMF lets you manage plug-ins in an Imperative CLI Framework application.
When you initialize a CLI application, you set a parameter to enable or disable the PMF. The parameter that you set adds a plugins command group to your application that lets users install and manage plug-ins.
The PMF is enabled by default in the allowPlugins parameter in ImperativeConfig.ts
.
You can disable the PMF when you do not want to allow plug-ins in your CLI. When you set allowPlugins
to false, the PMF is not initialized.
The following example illustrates how to disable plug-ins in ImperativeConfig.ts
:
import {ICommandDefinition} from "../../../cmd";
import {IImperativeProfileConfig} from "./IImperativeProfileConfig";
import {IImperativeLogsConfig} from "./IImperativeLogsConfig";
/**
* All of the configuration required to set up your Imperative CLI app
*/
export interface IImperativeConfig {
/**
* Boolean flag control wheather plugins are enable or disable.
* This option is assumed to be true by default.
*/
allowPlugins?: boolean;
Imperative CLI Framework uses the Plugins.json
file to manage and load installed plug-ins. All plug-ins have a package.json
file that contains the code structure of the plug-in.
You use the commands in the plugins command group to register the package that is defined in package.json in plugins.json.
- Home
-
Core Features
- Imperative Configuration
- Defining Commands
- Command Handlers
- Command Option Precedence
- Environment Variables
- Help Generator
- Experimental Commands
- Creating Commands Using Chained Handlers
- Configuring Logging
- Working with Team Configuration
- Defining and Programming Profiles
- Managing Secure Properties
- Deprecated User Profiles
- Consuming REST APIs Using the REST Client
- Implementing Progress Bars
- Plugins