This class is used to contain all configuration being set by Imperative. It is a singleton and should be accessed via ImperativeConfig.instance.

### Hierarchy

- ImperativeConfig

## Index

### Properties

- mCallerLocation
- mCommandLine
- mConfig
- mDaemonContext
- mHostPackageName
- mImperativePackageName
- mLoadedConfig
- mRootCommandName
- mInstance

### Accessors

- callerLocation
- callerPackageJson
- cliHome
- commandLine
- config
- daemonContext
- envVariablePrefix
- hostPackageName
- imperativePackageName
- loadedConfig
- profileDir
- profileSchemas
- rootCommandName
- instance

### Methods

- findPackageBinName
- getCallerFile

## Properties

### Private mCallerLocation

mCallerLocation: string = null

- Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:57

This parameter is used to contain the caller location of imperative configuration file.

### Private mCommandLine

mCommandLine: string

- Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:52

Current command needed for processing

### Private mConfig

mConfig: Config

- Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:82

The config object

### Private mDaemonContext

mDaemonContext: IDaemonContext

- Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:41

This is the daemon context needed to pass to `yargs.fail()` in the event that we cannot extract context through a `yargs.parse()` call.

memberof

  ImperativeConfig

### Private mHostPackageName

mHostPackageName: string

- Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:63

This is the package name of the host application. It will only be set once accessed to lessen loads to the host package.json.

### Private mImperativePackageName

mImperativePackageName: string

- Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:72

This is the name of our imperative package. It will only be set once accessed to lessen loads to the imperative package.json.

It isn't hardcoded so that the name of our package can change without affecting modules dependent on it.

### Private mLoadedConfig

mLoadedConfig: IImperativeConfig = null

- Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:47

This parameter is used as the container of all loaded configuration for Imperative.

### Private mRootCommandName

mRootCommandName: string

- Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:77

This is our calling CLI's command name (taken from package.json: bin).

### Static Private mInstance

mInstance: ImperativeConfig = null

- Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:32

This is the variable that stores the specific instance of Imperative Config. Defined as static so that it can be accessed from anywhere.

## Accessors

### callerLocation

- get callerLocation(): string
- set callerLocation(location: string): void

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:123

  Return file location of imperative configuration file.

  #### Returns string

  - location of configuration file
- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:115

  Set the caller location.

  #### Parameters

  - ##### location: string

    new location to be updated with

  #### Returns void

  - location of configuration file

### callerPackageJson

- get callerPackageJson(): any

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:219

  Return package.json of the imperative user

  #### Returns any

  - package.json file of caller

### cliHome

- get cliHome(): string

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:199

  Return the cli Home path.

  #### Returns string

  path to cli Home.

### commandLine

- get commandLine(): string
- set commandLine(args: string): void

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:229

  Retrieve the command line.

  example

    For example, in "banana a b --c", "a b --c" is the command line.

  #### Returns string

  - command line
- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:237

  Set the command line (needed for daemon where command changes and is not static)

  memberof

    Imperative

  #### Parameters

  - ##### args: string

  #### Returns void

  - command line

### config

- get config(): Config
- set config(c: Config): void

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:268

  Get the config properties

  #### Returns Config

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:261

  Set the config

  #### Parameters

  - ##### c: Config

  #### Returns void

### daemonContext

- get daemonContext(): IDaemonContext
- set daemonContext(context: IDaemonContext): void

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:246

  Set context for daemon to retrieve if no handler is called.

  memberof

    ImperativeConfig

  #### Returns IDaemonContext

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:254

  Context for daemon when no handler is invoked.

  memberof

    ImperativeConfig

  #### Parameters

  - ##### context: IDaemonContext

  #### Returns void

### envVariablePrefix

- get envVariablePrefix(): string

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:103

  Get the configured environmental variable prefix for the user's CLI

  #### Returns string

  - the configured or default prefix for environmental variables for use in the environmental variable service

### hostPackageName

- get hostPackageName(): string

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:162

  Retrieve the host package name from which imperative was called.

  #### Returns string

### imperativePackageName

- get imperativePackageName(): string

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:173

  Retrieve the package name of the imperative application.

  #### Returns string

### loadedConfig

- get loadedConfig(): IImperativeConfig
- set loadedConfig(config: IImperativeConfig): void

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:139

  Retrieve the loaded config (if init has

  #### Returns IImperativeConfig

  - the config that has been loaded, if any
- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:131

  Set the loaded config data.

  #### Parameters

  - ##### config: IImperativeConfig

    to be set.

  #### Returns void

  - the config that has been loaded, if any

### profileDir

- get profileDir(): string

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:211

  Return profile Directory.

  #### Returns string

  profile directory.

### profileSchemas

- get profileSchemas(): {}

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:303

  #### Returns {}

  a key/value object where the key is the profile type and the value is the profile type schema

  - ##### [key: string]: ICommandProfileSchema

### rootCommandName

- get rootCommandName(): string
- set rootCommandName(rootCommandName: string): void

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:155

  Get our root command name.

  #### Returns string

  The name of our calling CLI's command.

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:147

  Set our root command name.

  #### Parameters

  - ##### rootCommandName: string

    The name of our calling CLI's command.

  #### Returns void

  The name of our calling CLI's command.

### Static instance

- get instance(): ImperativeConfig

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:91

  Gets a single instance of the ImperativeConfig. On the first call of ImperativeConfig.instance, a new ImperativeConfig object is initialized and returned. Every subsequent call will use the one that was first created.

  #### Returns ImperativeConfig

  The newly initialized ImperativeConfig object.

## Methods

### findPackageBinName

- findPackageBinName(): string

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:185

  Parses the package.json file and searches for the symlink name used under "bin".

  #### Returns string

  - return bin symlink name if present, otherwise null

### getCallerFile

- getCallerFile(file: string): any

- - Defined in @zowe/imperative/src/utilities/src/ImperativeConfig.ts:277

  Require a file from a project using imperative accounting for imperative being contained separately from the current implementers directory.

  #### Parameters

  - ##### file: string

    the file to require from project using imperative

  #### Returns any

Generated using TypeDoc