I have created a custom metadata type in my dev org. I want to pull that cmdt (and included fields) down to my machine using the CLI (sfdx command).
I found this command but it only retrieves a record of the given custom metadata type.
sfdx force:source:retrieve -m CustomMetadata:MetadataTypeAPIName.MetadataRecordAPIName
I'm looking for a command that actually retrieves the definition of the custom meta data type itself and not just a single record. I want to do that so the custom metadata type can use VS Code "Deploy Source To Org" to deploy that type in another org and later include it in my managed package.
Best Answer
To get the Custom Metadata Type itself (including its fields), you use the
CustomObject
metadata type. The API name just uses__mdt
instead of__c
.sfdx force:source:retrieve -m CustomObject:My_Custom_Metadata_Type__mdt
+edit:
update for the
sf
executable that Salesforce is pushing to replacesfdx
sf project retrieve start -m CustomObject:My_Custom_Metadata_Type__mdt