universalIdentifier and the correct defineEntity() call.
You can also pass the entity type directly to skip the first prompt:
Available entity types
| Entity type | Command | Generated file |
|---|---|---|
| Object | yarn twenty dev:add object | src/objects/<name>.ts |
| Field | yarn twenty dev:add field | src/fields/<name>.ts |
| Logic function | yarn twenty dev:add logicFunction | src/logic-functions/<name>.ts |
| Front component | yarn twenty dev:add frontComponent | src/front-components/<name>.tsx |
| Role | yarn twenty dev:add role | src/roles/<name>.ts |
| Skill | yarn twenty dev:add skill | src/skills/<name>.ts |
| Agent | yarn twenty dev:add agent | src/agents/<name>.ts |
| View | yarn twenty dev:add view | src/views/<name>.ts |
| Navigation menu item | yarn twenty dev:add navigationMenuItem | src/navigation-menu-items/<name>.ts |
| Page layout | yarn twenty dev:add pageLayout | src/page-layouts/<name>.ts |
What the scaffolder generates
Each entity type has its own template. For example,yarn twenty dev:add object asks for:
- Name (singular) — e.g.,
invoice - Name (plural) — e.g.,
invoices - Label (singular) — auto-populated from the name (e.g.,
Invoice) - Label (plural) — auto-populated (e.g.,
Invoices) - Create a view and navigation item? — if you answer yes, the scaffolder also generates a matching view and sidebar link for the new object.
field entity type is more detailed: it asks for the field name, label, type (from a list of all available field types like TEXT, NUMBER, SELECT, RELATION, etc.), and the target object’s universalIdentifier.
Custom output path
Use the--path flag to place the generated file in a custom location: