Skip to Content
CLICommand ReferenceOrg Health & Operations

Org Health & Operations

Most commands here accept --org <alias> (defaults to config.defaultOrg) and --json.


sfdt audit

Diagnoses org health. Run a single check or all.

sfdt audit all sfdt audit mfa sfdt audit licenses --org production --json
CheckWhat it inspects
audittrailRecent Setup Audit Trail entries (lookback audit.auditTrailLookbackDays)
licensesLicense usage vs audit.licenseWarnThreshold
mfaMulti-factor-authentication coverage
unused-apexApex classes with no recent references
inactive-usersUsers inactive beyond audit.inactiveUserDays
api-versionsComponents below audit.minApiVersion

Results are written to logs/audit-latest.json (consumed by the dashboard and the VS Code Org Health sidebar).


sfdt monitor

Monitors org operational health. Run a single check or all.

sfdt monitor all sfdt monitor limits sfdt monitor all --backup # include a metadata backup in the run
CheckWhat it inspects
limitsGovernor-limit usage vs monitoring.limitWarnThreshold
errorsApex errors in the last monitoring.errorLookbackDays days
healthSecurity Health Check score vs monitoring.healthMinScore
backupMetadata backup (see below)
OptionDescription
--backupInclude a metadata backup when running all
--org <alias>Target org
--jsonStructured output

Results land in logs/monitor-latest.json.

sfdt monitor backup

Retrieves a full metadata backup into monitoring.backupDir.

sfdt monitor backup sfdt monitor backup --org production --json

sfdt docs

Generates documentation and diagrams from your org/source.

sfdt docs generate # objects, Apex, flows (MkDocs-compatible) sfdt docs generate --ai # include an AI overview sfdt docs diagram # print a Mermaid ER diagram sfdt docs diagram --output erd.mmd
SubcommandOptions
docs generate--ai, --json
docs diagram--output <file>, --json

sfdt data

Manages data sets via the native sf data tree, for seeding sandboxes and scratch orgs.

sfdt data list sfdt data export AccountsAndContacts sfdt data import AccountsAndContacts sfdt data delete AccountsAndContacts --yes
SubcommandDescription
listList defined data sets
export [set]Export records to a data set
import [set]Import a data set into the org
delete [set]Delete records (--yes to skip confirmation; required non-interactively)

Common options: --org <alias>, --json.


sfdt scratch

Creates, deletes, lists, and pools scratch orgs.

sfdt scratch create --alias feature-x --days 7 sfdt scratch list sfdt scratch delete --alias feature-x sfdt scratch pool --size 3
SubcommandDescription
createCreate a scratch org from scratch.definitionFile
deleteDelete a scratch org
listList active scratch orgs
poolManage a pre-created pool

Options: --alias <name>, --days <n>, --size <n>, --json.


sfdt notify

Sends a structured Slack notification for a deployment-lifecycle event via Slack Incoming Webhooks.

sfdt notify deploy-success sfdt notify deploy-failure --org production --version 1.5.0 sfdt notify test-failure --message "Coverage dropped below threshold" sfdt notify release-created --version 1.5.0
ArgumentValues
<event>deploy-success, deploy-failure, test-failure, release-created
OptionDescription
--version <ver>Version label to include
--org <alias>Org alias to display
--message <msg>Custom message body

Requires features.notifications: true and notifications.slack.webhookUrl in config. Otherwise the command exits with setup instructions.

Last updated on