Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IImperativeConfig

All of the configuration required to set up your Imperative CLI app

Hierarchy

  • IImperativeConfig

Index

Properties

Optional allowConfigGroup

allowConfigGroup: boolean

Boolean flag control whether config command group is enabled or disabled. This option is assumed to be true by default.

memberof

IImperativeConfig

Optional allowPlugins

allowPlugins: boolean

Boolean flag control whether plugins are enable or disable. This option is assumed to be true by default.

memberof

IImperativeConfig

Optional apimlConnLookup

apimlConnLookup: IApimlSvcAttrs[]

The set of attributes used to lookup (within the API Mediation Layer) the connection properties for the REST service associated with this command group. We use an array of such attributes in case the command group is compatible with multiple versions of the associated REST service.

memberof

IImperativeConfig

Optional authGroupConfig

Use this property to customize the command definitions for the auth command group.

memberof

IImperativeConfig

Optional autoGenerateProfileCommands

autoGenerateProfileCommands: boolean

If you specify a list of profile configurations, you can set this to true to automatically add a set of commands to your CLI to create, update, delete, and otherwise manage user profiles. Set this to false to avoid generating these commands. l Default: true (will generate profile commands if you have defined any profiles)

memberof

IImperativeConfig

Optional baseProfile

Use this property to configure a base profile for your CLI. A base profile can store shared values for fields used by other profile types.

memberof

IImperativeConfig

Optional commandModuleGlobs

commandModuleGlobs: string[]

Array of globs (see npm glob package for details) relative to the file that you call Imperative.init() from. The globs should match modules (javascript files) that contain command definition trees as the default export. Each tree from each matching file will be treated as children of the root command Note: absolute file names will also work

memberof

IImperativeConfig

Optional configAutoInitCommandConfig

configAutoInitCommandConfig: ICommandProfileAutoInitConfig

Use this property to customize the command definition for the config init command.

memberof

IImperativeConfig

Optional configurationModule

configurationModule: string

A path to a module (javascript file) that will return a complete IImperativeConfig object. If you use this option, anything else you specify in package.json or your manually provided config object (i.e. Imperative.init({...}) will be ignored. Relative to the file that you call Imperative.init() from, unless an absolute path is provided.

memberof

IImperativeConfig

Optional customHelpGenerator

customHelpGenerator: string

A path to a module that implements the AbstractHelpGenerator. Use this

memberof

IImperativeConfig

Optional daemonMode

daemonMode: boolean

If Imperative should run in Daemon mode This should only be specified for CLIs

memberof

IImperativeConfig

Optional defaultHome

defaultHome: string

The home directory for your CLI's configuration, logging, extensions, etc. e.g. "~"/.myapp" Defaults to ~/.yourcliname

memberof

IImperativeConfig

Optional definitions

definitions: ICommandDefinition[]

Rather than using modules, you can provide an array of definition trees of commands that will be treated as children of the root command.

If your configuration object is being used for a plugin, these command definitions will be added to the set of commands of the CLI into which the plugin is installed.

memberof

IImperativeConfig

Optional envVariablePrefix

envVariablePrefix: string

Environmental variable name prefix used to construct configuration environmental variables for your CLI. For example, . Note that the prefix chosen should adhere to the platform env var naming standards for which your CLI is intended to run.

Optional

Default: "name" value in this config (which defaults from package.json "name")

memberof

IImperativeConfig

Optional experimentalCommandDescription

experimentalCommandDescription: string

Optionally override the block of text that appears in the help text for commands that are set to experimental:true in their definition. You can use this to describe what a command being experimental means to your CLI. If you omit this, a generic block of text (Constants.DEFAULT_EXPERIMENTAL_COMMAND_EXPLANATION) will be used by default.

memberof

IImperativeConfig

Optional logging

Use this property to configure imperative logs, your CLI logs, console logs, and create new logs.

memberof

IImperativeConfig

Optional name

name: string

Identifier of your CLI following the convention of "name" as is required in a package.json.

If your configuration object is being used for a plugin, the name property is used as the group name for your plugin. All plugin commands will be underneath this group. For example, if the name property is YourPluginName, the plugin supplies a command named YourPluginCmd, and you install YourPluginName into YourBaseCLI, you would issue a command like: YourBaseCLI YourPluginName YourPluginCmd Also see the 'rootCommandDescription' property.

Optional

Default: package.json ==> name

memberof

IImperativeConfig

Optional overrides

Optional - List of overrides you wish Imperative to use instead of the defaults.

memberof

IImperativeConfig

Optional pluginAliases

pluginAliases: string[]

If the project you are configuring is an Imperative plugin, you can assign aliases to the group that is added when a user installs your plugin.

So, if your plugin's name is "my-special-plugin" and you specify ["msp"] as your value for pluginAliases, users can issue the command "mycli my-special-plugin my-command" or "mycli msp my-command"

Note: For plugins only. Ignored when specified on a core/base CLI

example

const config: IImperativeConfig = { ... pluginAliases: ["msp"] ... }

memberof

IImperativeConfig

Optional pluginFirstSteps

pluginFirstSteps: string

If the project you are configuring is an Imperative plugin, you can assign the first steps to the plugin, where it will be visible when running the firststeps command in the root plugins level help for the core CLI.

The first steps are a short list of steps required to set up your plugin for use.

Note: For plugins only. Ignored when specified on a core/base CLI

example

const config: IImperativeConfig = { ... pluginFirstSteps: "a list of first steps for your plugin" ... }

memberof

IImperativeConfig

Optional pluginHealthCheck

pluginHealthCheck: string

A path to a module (javascript file) that will perform a health check for a plugin. The health check should verify the health of the plugin. The implementor of a plugin determines what actions can confirm that the plugin is in an operational state.

This property is recommended for a plugin. The existence of this property and the existence of the specified file will be verified when the plugin is validated by the Imperative framework. Their absence will generate warnings.

The health check should return true if all plugin health checks pass. It should return false otherwise.

This property is unused for a base CLI.

TODO: While the pluginHealthCheck property is validated, no Imperative command currently calls the health check function.

memberof

IImperativeConfig

Optional pluginSummary

pluginSummary: string

If the project you are configuring is an Imperative plugin, you can assign a summary to the plugin that is showed in the root level help for the core CLI. The summary is a short description of your plugin's functionality.

Note: For plugins only. Ignored when specified on a core/base CLI

example

const config: IImperativeConfig = { ... pluginSummary: "a brief summary of your group" ... }

memberof

IImperativeConfig

Optional primaryTextColor

primaryTextColor: string

Optional - choose a color that will be used for help headings and other highlighting

memberof

IImperativeConfig

Optional productDisplayName

productDisplayName: string

The display name for your CLI, used in messages

memberof

IImperativeConfig

Optional profiles

Use this property to configure the available profile types for your CLI. The "type" indicates a homogeneous grouping of profiles (think 'category'). The "schema" dictates the structure of this profile type and assists Imperative with validating profile structure (on load) and helps imperative auto-generate profile manipulation commands.

If your configuration object is being used for a plugin, these profiles will be added to the set of profiles of the CLI into which the plugin is installed.

memberof

IImperativeConfig

Optional progressBarSpinner

progressBarSpinner: string

characters that will be looped through in a progress bar e.g. "|/-". If you don't specify this, a default spinner will be used.

memberof

IImperativeConfig

Optional rootCommandDescription

rootCommandDescription: string

The description that will be displayed if the user issues your root command (e.g. if your CLI's main command, in the "bin" field of package.json, is "banana", they will see this when they issue "banana --help") Typically, this is an overview description of your CLI as a whole -- it's purpose, syntax, and information the user needs the first time they use your CLI

If your configuration object is being used for a plugin, this property will be used as the description for the plugin's top-level group. For plugins, this property must be specified. Also see the 'name' property.

memberof

IImperativeConfig

Optional secondaryTextColor

secondaryTextColor: string

Optional - choose a secondary color that will be used for things like highlighting search results and other rarer

memberof

IImperativeConfig

Optional webHelpCustomCssPath

webHelpCustomCssPath: string

Optionally specify path to a custom CSS file for web help. It will replace the main.css file that controls the style of the page.

Optional webHelpLogoImgPath

webHelpLogoImgPath: string

Optionally specify path to an image of logo for your CLI. It will be displayed at the top of web help pages.

Generated using TypeDoc