Determines if the config file is read/write accessible.
The permission.
true if the user has capabilities specified by perm.
Asynchronously invokes actionFn once for each key-value pair present in the config object.
The function (key: string, value: ConfigValue) => Promise<void> to be called for each element.
Remove all key value pairs from the default group.
Gets an array of key value pairs.
Check to see if the config file exists.
True if the config file exists and has access, false otherwise.
Invokes actionFn once for each key-value pair present in the config object.
The function (key: string, value: ConfigValue) => void to be called for each element.
Returns a specified element from ConfigGroup.
The key.
The associated value.
Returns the entire config contents.
Get all config content for a group.
The contents.
Returns the value associated to the key and group, or undefined if there is none.
The key.
Returns the list of keys that contain a value.
The value to filter keys on.
Returns the path to the config file.
Returns a boolean if an element with the specified key exists in the default group.
The key.
Returns true if this config is using the global path, false otherwise.
Returns an array of the keys from the default group.
Read the config file and set the config contents.
The config contents of the config file.
Add or updates an element with the specified key in the default group.
The key.
The value.
Sets the entire config contents.
The contents.
Convert an object to a ConfigContents and set it as the config contents.
The object.
Sets the default group for all BaseConfigStore methods to use.
The group.
Sets the value for the key and group in the config object.
The key.
The contents.
Get the stats of the file.
The stats of the file.
Convert the config object to a json object.
Delete the config file if it exists.
True if the file was deleted, false otherwise.
Removes an element with the specified key from the default group.
The key.
True if the item was deleted.
Returns true if all elements in the config object existed and have been removed, or false if all the elements do not exist (some may have been removed). {@link BaseConfigStore.has(key)} will return false afterwards.
The keys.
Set a value on a group.
The key.
The value.
The promise resolved when the value is set.
Set a group of entries in a bulk save.
An object representing the aliases to set.
The new property that was saved.
Returns an array of the values from the default group.
Write the config file with new contents. If no new contents are passed in it will write the existing config contents that were set from ConfigFile.read, or an empty file if ConfigFile.read was not called.
The written contents.
Asynchronously constructs and initializes a new instance of a concrete subclass with the provided options.
An options object providing initialization params to the async constructor.
Get an alias from a key and group. Shorthand for Alias.retrieve().get(key).
The value of the alias to match
The promise resolved when the alias is retrieved
Get Aliases specific options.
The aliases state file filename.
Get ConfigGroup specific options, such as the default group.
The default group to use when creating the config.
Updates a group of aliases in a bulk save.
An array of strings in the format <alias>=<value>.
Each element will be saved in the Aliases state file under the group.
The new aliases that were saved.
Helper used to determined what the local and global folder point to.
True if the config should be global. False for local.
The file path of the root folder.
Aliases specify alternate names for groups of properties used by the Salesforce CLI, such as orgs. By default, all aliases are stored under 'orgs', but groups allow aliases to be applied for other commands, settings, and parameters.
Note: All aliases are stored at the global level.
ConfigGroup
const aliases = await Aliases.retrieve();
aliases.set('myAlias', 'username@company.org');
await aliases.write();
// Shorthand to get an alias.
const username: string = await Aliases.fetch('myAlias');
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_usernames_orgs.htm