Download Salesforce metadata using SFDX

How to download Salesforce metadata to your local machine using SFDX CLI

Feb 23, 2021
featured image
cd some/directory
sfdx auth:web:login -a --instanceurl=
sfdx force:project:create -n myProject --manifest
cd myProject
sfdx config:set
# Modify the package xml to retieve whatever we want
sfdx force:source:retrieve -x manifest/package.xml
# or retrieve this way
sfdx force:source:retrieve -m "ApexClass:MyApexClass"

Photo by Cookie the Pom on Unsplash

salesforce sfdx