tmd object create
Creates a new object file (Markdown + YAML frontmatter) based on the type schema.
tmd object create [type] [name]tmd object create book "Clean Code"tmd object create book "Clean Code" -t reviewtmd object create --type idea "Some Thought"tmd object create "Some Thought" # uses default type from configtmd object create bookThe type argument can be omitted if --type flag is set or cli.default_type is configured in .typemd/config.yaml. When a single argument matches a known type name, it is treated as the type. To use a name that collides with a type name, use the --type flag explicitly.
Names are automatically converted to slugs for the filename (e.g., “Clean Code” becomes clean-code in the filename), while the original input is preserved as the name property in frontmatter.
If the type has a name template, the name argument is optional — the name will be auto-generated from the template. When no name is provided and no name template is defined, an error is returned.
The command generates a .md file under objects/<type>/ with all schema-defined properties set to their default values (or null if no default is specified). The object is also added to the SQLite index.
Each object is assigned a unique ULID suffix, so multiple objects of the same type can share the same name (e.g. two book/clean-code-<ulid> files with different ULIDs). If the type does not exist, an error is returned.
| Flag | Short | Description |
|---|---|---|
--type | Object type (overrides config default) | |
--template | -t | Template name to use (from templates/<type>/) |
Default type
Section titled “Default type”If cli.default_type is configured in .typemd/config.yaml, you can omit the type argument:
cli: default_type: page# These are equivalent when default_type is "page":tmd object create page "Some Thought"tmd object create "Some Thought"The --type flag always takes precedence over the config default.
Templates
Section titled “Templates”If the type has templates defined in templates/<type>/, they are resolved automatically:
- No templates — proceeds without a template
- Single template — auto-applied without prompting
- Multiple templates — interactive prompt for selection (or use
-tto skip the prompt)
Template frontmatter properties override schema defaults. Template body becomes the initial object body. Auto-managed system properties (created_at, updated_at) in templates are ignored.