Salesforce DX, the CLI and Developer Console
When to reach for Salesforce DX and the Salesforce CLI (Dev Hub, scratch orgs, aliases, scripted tests, log tailing, JWT login for CI), the VS Code extensions and the browser-based Agentforce Vibes IDE, or the Developer Console for quick in-org work.
Given a scenario, know how and when to use the Salesforce Developer tools such as Salesforce DX, Salesforce CLI, and Developer Console.
~8 min read · 12 practice questions ·
What the exam expects
- Choose between Salesforce DX with the Salesforce CLI, the Salesforce Extensions for VS Code, Agentforce Vibes IDE and the Developer Console for a given task.
- Explain what Salesforce DX changes: source in version control, Dev Hub, scratch orgs and source tracking.
- Use the CLI to target the right org (aliases, default org), run tests with coverage, stream debug logs, return JSON and log in without a browser for CI.
- Use the Developer Console for Execute Anonymous, logs, test runs with coverage and SOQL/SOSL in the Query Editor.
Key terms: Salesforce DX (source-driven development tooling where version control, not the org, is the source of truth); Salesforce CLI (the sf command-line interface for orgs, source, tests and packages); Dev Hub (the org that creates and manages scratch orgs); scratch org (a disposable, source-driven org built from a definition file); alias (a readable name for an authorized org's username).
Key facts
- Detail
- Version control, not the org
- Detail
- Production, Developer Edition or trial org; never a sandbox; can't be disabled
- Detail
- Six scratch orgs and package versions per day, three active scratch orgs
- Detail
- 1-30 days, default 7; can't be restored after expiry
- Detail
- On by default; opt out with
--no-track-source
- Detail
- The default org unless
--target-orgnames a username or alias
- Detail
sf apex tail log
- Detail
sf org login jwtwith a consumer key, private key file and username
- Detail
- API Enabled and Author Apex
- Detail
- SOQL and SOSL; last 10 queries in History
Sources for this section (8)
- How Salesforce DX Tooling Changes the Way You Workdeveloper.salesforce.com (opens in a new tab)
- Select and Enable a Dev Hub Orgdeveloper.salesforce.com (opens in a new tab)
- Scratch Orgsdeveloper.salesforce.com (opens in a new tab)
- Salesforce DX Usernames and Orgsdeveloper.salesforce.com (opens in a new tab)
- apex Commandsdeveloper.salesforce.com (opens in a new tab)
- Authorize an Org Using the JWT Flowdeveloper.salesforce.com (opens in a new tab)
- Executing Anonymous Apex Codehelp.salesforce.com (opens in a new tab)
- Developer Console Query Editorhelp.salesforce.com (opens in a new tab)
- Why does a Dev Hub belong in production rather than a sandbox?
- When should a developer pick the Developer Console over the CLI?
- Why can a CI server use the JWT flow when it can't use web login?
- How long does a scratch org last by default?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the Platform Developer pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 21 lessons of the Platform Developer guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Inline practice questions and one-click topic practice (12 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Unlimited timed practice exams