[SalesForce] Can sfdx force:source:delete be used against a production org

Just wondering if anyone has tried this and if so how does validation come into play?

I can't find any information or documentation stating whether this is possible or not.

Best Answer

No, You can't delete in production using sfdx force:source:delete.

As per doc, it Deletes source files from your project and from a non-source-tracked org, such as a sandbox.

To delete from production, use destructiveChanges.xml. Follow these articles:-

  1. Deleting Files from an Organization

The package.xml file is a project manifest that lists all the components to retrieve or deploy. Although you can use package.xml to add components, it’s not sufficient to delete them. To delete files, create a delete manifest that’s called destructiveChanges.xml. The format of the delete manifest is the same as package.xml, except that wildcards aren’t supported.