# Salesforce DX, the CLI and Developer Console

*Platform Developer Study Guide · Testing, Debugging, and Deployment · Last updated October 15, 2026 · https://www.certifyforce.com/study-guide/platform-developer/testing-debugging-and-deployment/salesforce-developer-tools*

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.

- Certification: Salesforce Platform Developer
- Exam section: Testing, Debugging, and Deployment
- Study guide: https://www.certifyforce.com/study-guide/platform-developer

**Official exam objective:**

> Given a scenario, know how and when to use the Salesforce Developer tools such as Salesforce DX, Salesforce CLI, and Developer Console.

## 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

| Fact | Detail | Source |
|---|---|---|
| DX source of truth | Version control, not the org | [How Salesforce DX Tooling Changes the Way You Work](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_intro.htm) |
| Where Dev Hub can be enabled | Production, Developer Edition or trial org; never a sandbox; can't be disabled | [Select and Enable a Dev Hub Org](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_setup_enable_devhub.htm) |
| Trial or DE Dev Hub limits | Six scratch orgs and package versions per day, three active scratch orgs | [Select and Enable a Dev Hub Org](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_setup_enable_devhub.htm) |
| Scratch org lifespan | 1-30 days, default 7; can't be restored after expiry | [Scratch Orgs](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs.htm) |
| Scratch org source tracking | On by default; opt out with `--no-track-source` | [Scratch Orgs](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs.htm) |
| Which org a command uses | The default org unless `--target-org` names a username or alias | [Salesforce DX Usernames and Orgs](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_usernames_orgs.htm) |
| Stream debug logs | `sf apex tail log` | [apex Commands](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_apex_commands_unified.htm) |
| Headless CI login | `sf org login jwt` with a consumer key, private key file and username | [Authorize an Org Using the JWT Flow](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_jwt_flow.htm) |
| Execute Anonymous permissions | API Enabled and Author Apex | [Executing Anonymous Apex Code](https://help.salesforce.com/s/articleView?id=sf.code_dev_console_execute_anonymous.htm&type=5) |
| Query Editor | SOQL and SOSL; last 10 queries in History | [Developer Console Query Editor](https://help.salesforce.com/s/articleView?id=sf.code_dev_console_tab_query_editor.htm&type=5) |

## Check yourself

- 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?

## Sources

- [How Salesforce DX Tooling Changes the Way You Work](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_intro.htm)
- [Salesforce CLI Quick Start](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm)
- [Developer Console](https://help.salesforce.com/s/articleView?id=sf.code_dev_console.htm&type=5)
- [Select and Enable a Dev Hub Org](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_setup_enable_devhub.htm)
- [Scratch Orgs](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_scratch_orgs.htm)
- [Salesforce DX Usernames and Orgs](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_cli_usernames_orgs.htm)
- [apex Commands](https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_reference.meta/sfdx_cli_reference/cli_reference_apex_commands_unified.htm)
- [Authorize an Org Using the JWT Flow](https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_jwt_flow.htm)
- [Salesforce Extensions for Visual Studio Code](https://developer.salesforce.com/tools/vscode)
- [Agentforce Vibes IDE](https://developer.salesforce.com/docs/platform/code-builder/guide)
- [Executing Anonymous Apex Code](https://help.salesforce.com/s/articleView?id=sf.code_dev_console_execute_anonymous.htm&type=5)
- [Developer Console Query Editor](https://help.salesforce.com/s/articleView?id=sf.code_dev_console_tab_query_editor.htm&type=5)
- [Developer Console Tests Tab](https://help.salesforce.com/s/articleView?id=sf.code_dev_console_tab_tests.htm&type=5)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 12 linked practice questions, and unlimited timed mock exams are included with the Platform Developer pack (USD $19): https://www.certifyforce.com/practice-exams
