config Commands

Use the config commands to view and set your Salesforce CLI configuration values. Set your default Dev Hub and scratch org, and your default instance URL, either globally or at the project level.

config:get

Gets the Salesforce CLI configuration values for your default scratch org, your default Dev Hub org, your default instance URL, or any combination of the three.

Command Syntax

sfdx force:config:get
[--json]
[--loglevel LOGLEVEL]
[--verbose]

Parameters

--json
Optional




Format output as JSON.

Type: flag
--loglevel LOGLEVEL
Optional




The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.

Type: string
Permissible values are: trace, debug, info, warn, error, fatal
Default value: error
--verbose
Optional




Emit additional command output to stdout.

Type: flag

Help for config:get

To see your default scratch org username, include "defaultusername".

To see your default Dev Hub, include "defaultdevhubusername".

To see your default instance URL, include "instanceUrl".

To see the locations where your values are set, include the --verbose flag.

Examples:

config:list

Lists the configuration variables for the Salesforce CLI.

Command Syntax

sfdx force:config:list
[--json]
[--loglevel LOGLEVEL]

Parameters

--json
Optional




Format output as JSON.

Type: flag
--loglevel LOGLEVEL
Optional




The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.

Type: string
Permissible values are: trace, debug, info, warn, error, fatal
Default value: error

Help for config:list

Lists the config variables that the Salesforce CLI uses for various commands and tasks.

config:set

Sets the local and global configuration variables for the Salesforce CLI.

Command Syntax

sfdx force:config:set
[-g]
[--json]
[--loglevel LOGLEVEL]

Parameters

-g | --global
Optional




Sets the configuration variables globally, so they can be used from any directory.

Type: flag
--json
Optional




Format output as JSON.

Type: flag
--loglevel LOGLEVEL
Optional




The logging level for this command invocation. Logs are stored in $HOME/.sfdx/sfdx.log.

Type: string
Permissible values are: trace, debug, info, warn, error, fatal
Default value: error

Help for config:set

Sets the configuration variables that the Salesforce CLI uses for various commands and tasks. Local variables apply only to your current project. Global variables apply in any directory.

Examples: