Skip to main content

Create a new Salesforce scratch org.

Command: force:org:create

Example: sfdx force:org:create -s -a MyScratchOrg

Open a Salesforce org in a web browser.

Command: force:org:open

Example: sfdx force:org:open -u MyOrg

Deploy source code and metadata to a Salesforce org.

Command: force:source:deploy force-app/main/default/classes

Example: sfdx force:source:deploy -p

Retrieve source code and metadata from a Salesforce org.

Command: force:source:retrieve

Example: sfdx force:source:retrieve -m ApexClass:MyApexClass

Description: Create an Apex trigger in the local project.

Command: force:apex:trigger:create MyApexTrigger

Example: sfdx force:apex:trigger:create -n

Import data into Salesforce using JSON files.

Command: force:data:tree:import

Example: sfdx force:data:tree:import -p data/Account.json

Install a Salesforce managed or unmanaged package.

Command: force:package:install

Example: sfdx force:package:install -i 04t...

Create a Salesforce package.

Command: force:package:create

Example: sfdx force:package:create -n MyPackage -t Unlocked

Create a package version for a Salesforce package.

Command: force:package:version:create

Example: sfdx force:package:version:create -p MyPackage -x

Create an Apex class in the local project.

Command: force:apex:class:create

Example: sfdx force:apex:class:create -n MyApexClass

Run Apex tests in a Salesforce org.

Command: force:apex:test:run

Example: sfdx force:apex:test:run -n MyTest

Create a Lightning Web Component (LWC) in the local project.

Command: force:lightning:component:create

Example: sfdx force:lightning:component:create -n MyLWC

Push source code changes from the local project to a Salesforce org.

Command: force:source:push

Description: Example: sfdx force:source:push

Pull source code changes from a Salesforce org to the local project.

Command: force:source:pull

Example: sfdx force:source:pull

Set a Salesforce CLI configuration value.

Command: force:config:set

Example: sfdx force:cong:set defaultusername=MyOrg

Execute a SOQL query against a Salesforce org and display the results.

Command: force:data:soql:query

Example: sfdx force:data:soql:query -q "SELECT Name FROM Account"

Deploy metadata using Metadata API (Classic).

Command: force:mdapi:deploy

Example: sfdx force:mdapi:deploy -d path/to/metadata

Create an Apex class in the local project.

Command: force:apex:class:create

Example: sfdx force:apex:class:create -n MyApexClass

Join the discussion 2 Comments

Subscribe For More Updates

 

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!