cmdt generate records

Generate new custom metadata type records from a CSV file.

The custom metadata type must already exist in your project. By default, the Name column is used to determine the record name; use the –name-column flag to specify a different column.

force:cmdt:record:insert

cmdt:record:insert

Flag Name (Long)Flag Name (Short)Description
‑‑csv‑fType: Value
Required

Pathname of the CSV file.
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑input‑directory‑iType: Value
Default value: force-app/main/default/objects

Directory from which to get the custom metadata type definition from.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑name‑column‑nType: Value
Default value: Name

Column used to determine the name of the record.
‑‑output‑directory‑dType: Value
Default value: force-app/main/default/customMetadata

Directory to store newly-created custom metadata record files.
‑‑type‑name‑tType: Value
Required

API name of the custom metadata type to create a record for.

The ‘__mdt’ suffix is appended to the end of the name if it’s omitted.

Generate record metadata files from values in a CSV file for the custom metadata type MyCmdt. Use ‘Name’ as the column that specifies the record name:

Generate record metadata files from a CSV file in the directory different from the default, and use ‘PrimaryKey’ as the column that specifies the record name: