SFDX in Salesforce (Salesforce DX) – Complete Guide

SFDX (Salesforce DX) is Salesforce’s source-driven way of building and deploying apps: your metadata lives in a local project under version control, and you use the Salesforce CLI to create projects, connect orgs, deploy and retrieve. Today the CLI command is sf, not sfdx. To start a project, run sf project generate --name myproject.

Many SFDX tutorials still show the retired sfdx force:... commands. This guide uses the current Salesforce CLI (v2) and its official command reference: what SFDX gives you, how to install the CLI, every flag of sf project generate, the files it creates, and a table mapping old sfdx commands to the new sf commands.