The api version
Username associated with the default dev hub org.
Username associate with the default org.
The sid for the debugger configuration.
The url for the debugger configuration.
true if polling should be used over streaming when creating scratch orgs.
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.
Removes all key/value pairs from the config object.
Returns an array of ConfigEntry for each element in the config.
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 the value associated to the key, or undefined if there is none.
The key.
Returns the entire config contents.
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 asserting whether a value has been associated to the key in the config object or not.
The key.
Returns true if this config is using the global path, false otherwise.
Returns an array that contains the keys for each element in the config object.
Read, assign, and return the config contents.
Sets a value for a property.
The value of the property.
Sets the entire config contents.
The contents.
Convert an object to a ConfigContents and set it as the config contents.
The object.
Get the stats of the file.
The stats of the file.
Convert the config object to a JSON object.
Returns the config contents. Same as calling ConfigStore.getContents
Delete the config file if it exists.
True if the file was deleted, false otherwise.
Returns true if an element in the config object existed and has been removed, or false if the element does not exist. {@link BaseConfigStore.has(key)} will return false afterwards.
The key.
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.
Returns an array that contains the values for each element in the config object.
Writes Config properties taking into account encrypted properties.
The new Config value to persist.
Clear all the configured properties both local and global.
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.
Returns an object representing the supported allowed properties.
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.
Creates the config instance and reads the contents of the existing file, if there is one.
This is the same as
const myConfig = await MyConfig.create<MyConfig>();
await myConfig.read();Note: Cast to the extended class. e.g. await MyConfig.retrieve<MyConfig>();
The value of a supported config property.
True for a global config. False for a local config.
The name of the property to set.
The files where sfdx config values are stored for projects and the global space.
Note: It is not recommended to instantiate this object directly when resolving config values. Instead use ConfigAggregator
ConfigFile
const localConfig = await Config.retrieve();
localConfig.set('defaultusername', 'username@company.org');
await localConfig.write();
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_config_values.htm