sfdx "force:source:deploy is deprecated, use sf project deploy" in CI
The old sfdx force:* topics are deprecated in favor of the new sf command tree. CI still running sfdx force:source:deploy prints a deprecation warning and, once the command is removed, fails outright. Migrate to sf project deploy start.
What this error means
A step using sfdx force:source:deploy prints "The command "force:source:deploy" has been deprecated and will be removed" or fails as not found after a CLI upgrade.
Warning: The "force:source:deploy" command has been deprecated. Use "project deploy start" instead.Common causes
Pipelines still call legacy sfdx force commands
Scripts written for the old CLI use sfdx force:source:deploy and similar, which the unified sf CLI deprecates and eventually removes.
A CLI upgrade dropped the old command
After updating to a CLI version that removed the deprecated topic, the old command is no longer recognized.
How to fix it
Switch to the sf command tree
- Replace
sfdx force:source:deploywithsf project deploy start. - Update related commands (
force:org:create,force:apex:test:run) to theirsfequivalents. - Pin the CLI version so the command set is predictable.
# old
sfdx force:source:deploy -p force-app -u ci-org
# new
sf project deploy start --source-dir force-app --target-org ci-orgPin the CLI version in CI
Install a known CLI version so an unexpected upgrade does not remove a command mid-pipeline.
npm install --global @salesforce/cli@2How to prevent it
- Migrate pipelines from
sfdx force:*to thesfcommand tree. - Pin the CLI version so command availability is deterministic.
- Watch CLI release notes for deprecations before they become removals.