Skip to content

Instantly share code, notes, and snippets.

@davescruggs
Last active February 5, 2018 01:27
Show Gist options
  • Save davescruggs/4c24e0ff464cf44dfd01e96d850c1a00 to your computer and use it in GitHub Desktop.
Save davescruggs/4c24e0ff464cf44dfd01e96d850c1a00 to your computer and use it in GitHub Desktop.
Tips for using the Salesforce DX CLI

Getting metadata into an org

I've had more luck with "open directories" than zip files. Create a directory (src/mdout/etc.), put the package.xml file in the directory at the top level, and create subfolders if needed for "objects", "permissionsets", "classes", etc. Make sure the package.xml is formatted correctly (no mismatches, no extra spaces). There are package.xml examples here.

sfdx force:mdapi:deploy -d -w 3 -u

Getting metadata out of an org

My easiest option right now is to use the package.xml file to pick and choose what files I pull out. Using a temporary package is nice, and finds dependencies, but I find that I have more flexibility with packages

sfdx force:mdapi:retrieve -r -w 3 -k

/package.xml -u

The "-w" wait option can be pretty good for a small package at 3 minutes to wait, but you can bump that up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment