cmdt generate object

Generate a new custom metadata type in the current project.

This command creates a metadata file that describes the new custom metadata type. By default, the file is created in the MyCustomType__mdt directory in the current directory, where MyCustomType is the value of the required –type-name flag. Use the –output-directory to generate the file in a package directory with other custom metadata types, such as “force-app/main/default/objects”.

force:cmdt:create

cmdt:create

Flag Name (Long)Flag Name (Short)Description
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑label‑lType: Value

Label for the custom metadata type.
‑‑output‑directory‑dType: Value

Directory to store the newly-created custom metadata type files

The location can be an absolute path or relative to the current working directory. The default is the current directory.
‑‑plural‑label‑pType: Value

Plural version of the label value; if blank, uses label.
‑‑type‑name‑nType: Value
Required

Unique object name for the custom metadata type.

The name can contain only underscores and alphanumeric characters, and must be unique in your org. It must begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
‑‑visibility‑vType: Value
Valid Values: PackageProtected, Protected, Public
Default value: Public

Who can see the custom metadata type.

For more information on what each option means, see this topic in Salesforce Help: https://help.salesforce.com/s/articleView?id=sf.custommetadatatypes_ui_create.htm&type=5.

Generate a custom metadata type with developer name ‘MyCustomType’; this name is also used as the label:

Generate a protected custom metadata type with a specific label: