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?

1 Answer 1


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.

  • whats the command in mac? nvm i found it ... its export
    – compski
    Commented Jul 10, 2023 at 16:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .