This tutorial will guide you through the process of installing Salesforce CLI, authenticating to a Salesforce Org, creating a Salesforce project, connecting your development org to the project, retrieving metadata, and deploying metadata from your local machine to the Salesforce org.
- Install Salesforce CLI (Skip if using Code Builder)
- Authenticate to Salesforce Org via CLI
- Create a Salesforce Project
- Connect your Development org to the Salesforce Project
- Retrieve metadata from the Development Org
- Deploy metadata from the local machine to the Salesforce org
Make sure your computer has Node.js and NPM installed:
node --version
npm --version
Install Salesforce CLI Stable Release:
npm install @salesforce/cli --global
Sign up for a Free Developer Edition Org
sf org login web -s -a <alias>
sf org login web -r <instance url> -a <alias>
sf project generate -n myProject
sf config set [email protected]
sf config set target-org=<alias>
- Build a Custom Object named House
- Add two fields: Name and Address
- Create a Tab and an App named Dreamhouse
sf project retrieve start -m CustomObject
sf project retrieve start --metadata ApexClass:MyApexClass
sf project retrieve start
sf project generate manifest --from-org <username/alias>
sf project retrieve start --manifest --from-org package.xml
sf apex generate class -n myClass -d force-app/main/default/classes
sf project deploy start --metadata ApexClass:MyApexClass
sf project deploy start -p force-app/main/default/classes
sf project deploy start
sf --help
sf search