Download Salesforce metadata using SFDX

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


Andres Canavesi
Feb 23, 2021
Download Salesforce metadata using SFDX
featured image
      
cd some/directory
sfdx auth:web:login -a my@username.dev --instanceurl=https://my-sfdc-instance.my.salesforce.com
sfdx force:project:create -n myProject --manifest
cd myProject
sfdx config:set defaultusername=my@username.dev
# 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