I was having some issues with a particular source push to a new scratch org and wanted to examine the underlying metadata based package that was being deployed to Salesforce. How can I see what the SFDX CLI was deploying with my force:source:push command?


The SFDX_MDAPI_TEMP_DIR environment variable can be configured to retain the underlying metadata packages.

From the docs:

Places the files (in metadata format) in the specified directory when you run some CLI commands, such as force:source:<name>. Retaining these files can be useful for several reasons. You can debug problems that occur during command execution. You can use the generated package.xml when running subsequent commands, or as a starting point for creating a manifest that includes all the metadata you care about.

From a Windows command prompt:

SET SFDX_MDAPI_TEMP_DIR="C:\Development\SFDC\metadata\"

I'd avoid pointing it to a sub-directory of your current project if possible to keep it separate from the rest of the source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.