Do you have a SFDX scratch pad?

SFDX here... SFDX there.

SFDX now everywhere!!

I first started using SFDX in 2017 as I remember. Since I started working with Salesforce, I had this question going on :

Why I can't have my own sandbox?  How we can have source control and org code so disconnected??

We could have spin-up a sandbox for my use, but when we have several developers working on the same project, that became HARDCORE.

So first time I used Salesforce CLI, and created my first scratch org, i thought of one word :

MAGICALLLLLLLLLLLLLLLL

But the number of commands... Can be tough in the beginning. Actually when you really understand the logic behind the commands, everything start to makes sense.

So if you are starting with DX, here some common commands!

//Create a dx project locally
sfdx force:project:create --projectname ProjectTest
    
//Create Scratch Org
sfdx force:org:create -f config/project-scratch-def.json -a MyScratchOrg
    
//Open Scratch Org
sfdx force:org:open -u MyScratchOrg
    
//Pull code from a scratch org
sfdx force:source:pull -u MyScratchOrg
    
//Delete Scratch Org
sfdx force:org:delete -u MyScratchOrg
    
//Set default devHub
sfdx force:config:set defaultdevhubusername=YOUR_DEVHUB_USERNAME
    
//Set default username (when doing push, pull etc)
 sfdx force:config:set defaultusername=MyScratchOrg
 
//List of Packagesfdx force:package:list- List of Package Versions
 sfdx force:package:version:list
 
//Install package(in our case TestPackage on version 0.1.0-1) in a scratch org
sfdx force:package:install --package "TestPackage@0.1.0-1" -u MyScratchOrg
Enjoy!!!