-
Notifications
You must be signed in to change notification settings - Fork 88
Imperative Configuration
A key component of an Imperative based CLI is it's Imperative configuration document. Detailed documentation can be found in the typedoc of the IImperativeConfig interface. In summary, the configuration document is the mechanism by which you will configure the imperative framework for your CLI. On the document you provide the CLI name, command definition and option documents, profile definitions, plugin capabilities and more.
Note: The general Imperative philosophy is to assume you would like all features enabled by default. This philosophy cuts down on the amount of required configuration and provides the most "out of the box" value without needing to understand all configuration or features.
You must supply the configuration document in your package.json
. There are two forms of the package.json
configuration.
You can supply the entire static configuration document in your package.json
using the imperative
property:
"imperative": {
"productDisplayName": "Example Command Line Interface",
"definitions": [{
"name": "hello",
"description": "A sample command",
"type": "command",
"handler": "/path/to/handler"
}],
"rootCommandDescription": "Welcome to the Example CLI",
"envVariablePrefix": "SAMPLE_CLI"
}
You can supply the configuration document in a module and "point" to it using the imperative
property in your package.json
:
"imperative": {
"configurationModule": "lib/imperative.js"
}
-
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