Salesforce CLI Plugin
@sfdt/plugin is a Salesforce CLI (sf)
plugin that exposes the entire sfdt command set as sf sfdt <command>. If your team
standardizes on sf plugins install for tooling, this is the install path for you.
This is a thin wrapper, not a reimplementation. Each sf sfdt command forwards to the
bundled @sfdt/cli binary and streams its output verbatim, so every command, flag, exit code,
and --json envelope is identical to running sfdt directly. The plugin pulls in @sfdt/cli
as a dependency, so it’s self-contained and tracks the matching CLI release.
Install
sf plugins install @sfdt/pluginAs an unsigned third-party plugin, sf shows a one-time security prompt on install. Confirm to
proceed. (Salesforce only suppresses this for allowlisted plugins.)
Verify it’s loaded:
sf plugins # lists @sfdt/plugin
sf sfdt --help # lists every sfdt command as an sf topicUsage
Anything you’d run as sfdt <command> becomes sf sfdt <command>:
sf sfdt init
sf sfdt deploy --dry-run --org myorg
sf sfdt preflight --strict
sf sfdt audit --json | jq '.result.summary'
sf sfdt scratch create --alias dev --days 7
sf sfdt drift --org production --jsonNested subcommands and flags work exactly as in the standalone CLI:
sf sfdt scratch pool fill --size 5
sf sfdt data export my-set --org dev
sf sfdt feature-flags disable canvas-searchSee the Command Reference for the full list — every command there is available
under sf sfdt.
JSON output
--json emits the same Salesforce-native { status, result, warnings } envelope as the standalone
CLI (status is the numeric exit code), so sf sfdt output composes natively in sf-based
pipelines. See CI/CD → JSON output for the full shape.
sf sfdt drift --json | jq '.result.driftStatus'How it works
- Command files are code-generated from the CLI’s command tree, so the plugin always mirrors
the current
sfdtcommands — there is no separately maintained command list to drift out of date. - Each command forwards its arguments to the bundled
sfdtbinary and propagates the exit code, so scripting and CI gating behave identically. - The plugin and
@sfdt/cliare released together, so an install resolves to a matching CLI version.
Requirements
The wrapped commands need the same runtime prerequisites as the standalone CLI — sf, git, and
bash on your PATH. See Requirements.
Updating & removing
sf plugins update # updates installed plugins, including @sfdt/plugin
sf plugins uninstall @sfdt/pluginPrefer a standalone binary, Homebrew, or Docker instead? See the other installation methods.