Newer Version Available

This content describes an older version of this product. View Latest

Support for JSON Responses

Salesforce CLI commands typically display their output to the console (stdout) in non-structured, human-readable format. Messages written to the log file (stderr) are always in JSON format.

To view the console output in JSON format, specify the --json parameter for a particular CLI command.

1sfdx force:org:display --json

Most CLI commands support JSON output. To confirm, run the command with the --help parameter to view the supported parameters.

To get JSON responses to all Salesforce CLI commands without specifying the --json option each time, set the SFDX_CONTENT_TYPE environment variable.

1export SFDX_CONTENT_TYPE=JSON