This package contains the base command class for Salesforce CLI, SfdxCommand. Extend this class for convenient access to common Salesforce CLI parameters, a logger, CLI output formatting, scratch orgs, and Dev Hubs. This class extends @oclif/command and is available within a plug-in generated by Salesforce Plug-In Generator.
A deprecation configuration type. A typical instance can pass name,
type, and version for a standard message. Alternatively, the messageOverride can
be used as a special case deprecated message. Used when defining a deprecation on a
command or flag.
A deprecation warning message configuration type. A typical instance can pass name,
type, and version for a standard message. Alternatively, the messageOverride can
be used as a special case deprecated message. Used when formating a deprecation message.
The configuration of flags for an SfdxCommand class, except for the following:
json and loglevel are configured automatically for all SfdxCommand classes.
targetusername is enabled using either SfdxCommand.supportsUsername or SfdxCommand.requiresUsername.
targetdevhubusername is enabled using either SfdxCommand.supportsDevhubUsername or SfdxCommand.requiresDevhubUsername.
Additionally, apiversion is enabled automatically if any of the static *Username booleans are set, but may be
configured here explicitly as well if those settings are not required.
publicstatic flagsConfig: FlagsConfig = {
name: flags.string({ char: 'n', required: true, description: 'name of the resource to create' }),
source: flags.directory({ char: 'd', required: true, description: 'path of the source directory to sync' }),
wait: flags.minutes({ description: 'number of minutes to wait for creation' }),
notify: flags.url({ description: 'url to notify upon completion' })
};
Adds the apiversion built-in flag to allow for overriding the API
version when executing the command.
Optional concise?: flags.Builtin
Adds the concise built-in flag to allow a command to support concise output,
which is useful when the output can be overly verbose, such as test results.
Note that this must be implemented by the command.
Optional quiet?: flags.Builtin
Adds the quiet built-in flag to allow a command to completely suppress output.
Note that this must be implemented by the command.
Optional targetdevhubusername?: undefined
Optional targetusername?: undefined
Optional verbose?: flags.Builtin
Adds the verbose built-in flag to allow a command to support verbose output,
which is useful to display additional command results.
Note that this must be implemented by the command.
A table option configuration type. May be a detailed configuration, or
more simply just a string array in the simple cases where table header values
are the only desired config option.
Defines a varargs configuration. If set to true, there will be no
validation and varargs will not be required. The validator function
should throw an error if validation fails.
A deprecation configuration type. A typical instance can pass
name
,type
, andversion
for a standard message. Alternatively, themessageOverride
can be used as a special case deprecated message. Used when defining a deprecation on a command or flag.