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?

1 Answer 1


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .