I am interested in knowing how someone can pull SObject definitions, custom and standard, from a scratch org using the CLI, or otherwise, into a local directory e.g. .sfdx. Something similar to what vscode plugin for Salesforce does.

Which commands are related? How can someone go about it?


You can look for sfdx force:source:retrieve command here.

For your own use case, you could run the following command: sfdx force:source:retrieve -m CustomObject:Account.

Note that this will work the same way the Metadata API works with a package.xml, as described here.

Definitely have a look to the Wildcard Support in the Manifest File section to understand what's retrieved with sfdx force:source:retrieve -m CustomObject and what's not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.