Salesforce DX is a development approach that brings source-driven development, team collaboration, and continuous integration to the Salesforce Platform. Instead of working directly in an org through a web browser, you work with metadata as source files in a local DX project, track changes in version control, and deploy through automated processes.
This project template gets you started with the tools and structure you need to build Salesforce applications using source control, scratch orgs, and the Salesforce CLI.
Before you start, make sure you have:
- Salesforce CLI - Download from developer.salesforce.com/tools/salesforcecli. See Install Salesforce CLI for details.
- VS Code with Salesforce Extension Pack - See Installation Instructions for details. Includes the Agentforce Vibes extension.
- A development org - Sign up for a free Developer Edition org here.
- Dev Hub enabled (optional, required to create scratch orgs) - You can enable Dev Hub in your development org under Setup > Dev Hub. See Provide Developers Access to Salesforce DX Tools.
Your DX project follows this structure:
force-app/main/default/- Your metadata source files live in this default package directory. You can configure additional package directories in thesfdx-project.jsonfile.config/- Scratch org definitions and project settingsscripts/- Automation scripts for common taskssfdx-project.json- Project manifest that defines package directories, namespace, API version, and other project-level settings
See Salesforce DX Project Configuration.
Ready to start developing? The Get Started with Salesforce DX guide walks you through your first project, from creating a scratch org to creating a simple Apex class or LWC to deploying your code to a sandbox.
Here are common CLI commands that you'll use the most:
sf org login web: Authorize an orgsf org open: Open your org in a browsersf org create scratch: Create a scratch orgsf project deploy start: Deploy metadata to your orgsf project retrieve start: Retrieve metadata from your orgsf template generate <artifact>: Scaffold new components, such as Apex classes and triggers, LWC components, Lightning apps, and moresf apex <command>: Run Apex tests, run anonymous Apex blocks, and view logssf data <command>: Work with test datasf alias <command>: Manage org aliasessf config <command>: Configure CLI settings
Transform your ideas into custom Lightning apps that extend CRM workflows directly in Lightning Experience. Through natural conversations with Agentforce Vibes, implement custom objects and fields, complex business logic, and dynamic UI components. See Build a Lightning App Using Agentforce Vibes.