Overview
Local app development revolves around syncing: the CLI rebuilds your manifest and the server applies only the difference between it and the metadata already in your workspace. This page covers which command to reach for, how to read what a sync changed, and what to do — in order — when local state looks inconsistent.Which command, when
For day-to-day local iteration you almost always want
twenty app dev.
Deploying and publishing are for shipping releases, not for the local
loop.Local sync does not need a version bump
The strictly-increasingversion rule (VERSION_ALREADY_EXISTS on deploy, APP_ALREADY_INSTALLED / CANNOT_DOWNGRADE_APPLICATION on install) applies to twenty app publish / twenty app install — the release path. twenty app dev syncs your manifest in place and never requires a version change, so you don’t need to touch package.json to iterate. If you find yourself bumping the version to test a local change, you’re using the release path when you want the dev loop.
Reading the sync output
Every sync prints the metadata changes it applied (or would apply, withplan), Terraform-style — one block per entity with its attributes, then a summary line:
to destroy) are listed with what they drop (e.g. objectMetadata "auditNote" — drops the table and all its rows) and require interactive confirmation, or --yes in scripts.
A deletion that only happens because another one removes what it belongs to (a deleted object’s fields, views and page layouts, the relation fields pointing at it, a deleted field’s view columns and widgets) is folded into that deletion: its block ends with also destroys N dependent entities, and the warning names each dropped table or column once. The server marks these deletions with cascadedFromUniversalIdentifier; against an older server, every deletion is listed. --json still lists every action, and summary.cascaded counts the folded ones.
A sync deletes every entity your app owns that your source no longer declares. When a plan contains destroys it says so and points at --no-prune (formerly --no-delete, which still works), which makes the sync additive: creates and updates are applied, nothing missing from your source is deleted, and the settings component and uninstall hook bindings of the app stay as they are when your source does not declare them. Use it when your source is intentionally partial, for example while adopting an app that was built in the UI. The workspace Custom application is the exception: since pull cannot export everything it owns yet, its sync is additive unless you pass --prune. Servers released before this change still delete by default, so pass --no-prune when applying the Custom application to one.
When a sync fails on a single entity, the error names the offending entity and its universalIdentifier, for example:
Previewing changes (plan)
twenty app plan builds your manifest, asks the server for the migration plan, and prints it — without applying anything. It’s the safe way to answer “what would this sync change?” before committing to it.
- Does not change the workspace, no metadata migration, application record update, or default role/tab changes. It builds a local snapshot but does not regenerate the API client.
- Returns the same diff a real sync would apply, so you can review created/updated/deleted entities up front.
- Is useful before a risky change, when reviewing an AI-generated change, or in a script that should fail if an unexpected change is about to land.
A plan only previews metadata changes. It also works for an app that was
never synced: the server evaluates the manifest against an empty application,
so the plan lists everything your source would create.
Pulling an installed app back to source
twenty app pull is the inverse of apply: it reads an application out of the workspace and restores its define files, translations, stored dependency files, public assets and front component entry source.
defineApplication() identifier and retrieves that application. Outside an app, it asks for a directory and confirmation, creates a local project for the selected workspace’s custom application, installs dependencies with Yarn, then pulls the definitions. The new project includes package and configuration files, without the initializer’s demo entities.
Use --path to select an existing app or a new or empty directory. Noninteractive creation requires --path and --yes; pull refuses to overwrite an unrelated nonempty directory. Creating a project does not register an application or change the workspace. An existing SDK project without an application definition also pulls the custom application. There is no --universal-identifier option.
If dependency installation fails for a new project, the scaffold is kept. Run yarn install inside it, then retry pull. Existing projects do not install dependencies automatically. If their application identifier cannot be read, pull reports that error instead of creating another app. Add --verbose to expand the coverage sections of the report, which then name up to 20 identifiers per metadata type instead of only the totals.
What it writes:
- the application config;
- front component entry files, including AI-generated components, as their stored original TSX, plus their inventoried local source files;
- stored
package.jsonandyarn.lockdependency files, at the project root; - objects, with their fields inline;
- fields your app added to objects it does not own;
- authored indexes;
- permission flags your app declares, as
definePermissionFlag()files; - roles, with their
recordsPermissionsand permission flags inline.recordsPermissionsholds the grants for all objects and, per object, its all records grants,unreadableFields,uneditableFieldsand row-level records permissions, with their predicates and predicate groups nested inside. Predicates linked to no rule are written in the deprecatedrowLevelPermissionPredicatesandrowLevelPermissionPredicateGroups. Your app’s default role is written withdefineApplicationRole(). An object ofrecordsPermissionswhose identifier is the one the build derives is written without it. When the default role is not one of your app’s own roles, as for the workspace Custom application, the application config keepsdefaultRoleUniversalIdentifierinstead; - views, with their fields, field groups, filters, filter groups, sorts and groups inline;
- view fields your app added to views it does not own, as standalone
defineViewField()files; - page layouts, with their tabs and widgets inline;
- tabs your app added to page layouts it does not own, as standalone
definePageLayoutTab()files; - navigation menu items, as
defineNavigationMenuItem()files, folders included; - widgets your app added to tabs it does not own, as standalone
definePageLayoutWidget()files; - workflows, as
defineWorkflow()files, with each Code step’s source in its own<workflow-file-name>/<step-name>.code.tsfile beside the workflow. These files contain workspace-authored code, read as text during pull and build rather than executed as app definitions. Workflows are pulled when their stored version is the one the last sync wrote. For the workspace Custom application, it is the active version, whether a sync or the workflow builder published it, and apply publishes a changed definition as a new version, as described in Workflows; - skills, as
defineSkill()files; - agents, as
defineAgent()files, with their triggers and the role your app binds them to; - validation rules, as
defineValidationRule()files with their expression as a string; - published translations, as
locales/<locale>.jsonfor the strings pull can read back from the pulled metadata and source, andlocales/compiled/<locale>.jsonfor the rest.
export default defineFrontComponent({...}) with a literal matching identifier and no computed or spread metadata. Missing files, checksum mismatches, metadata that differs from the workspace, and unsupported definitions are reported as coverage gaps, together with widgets that depend on them. Source files, public assets and dependency files share a 12 MiB encoded-file budget, leaving room for metadata within the 16 MiB response limit.
An unrelated file at a source destination stops pull before any writes. A locally moved component with an inventory must be restored to its original path first, so its relative imports stay valid. Unchanged remote source preserves local edits; changed source replaces it and reports overwritten edits. Files no longer in the remote inventory remain untouched locally.
Older deployments without an inventory still export entry files only; apply or publish again to retain imported files. Imports outside the app and installed packages are not copied. Older clients keep their entry-only behavior, and the new CLI falls back to the file export options an older server supports.
Public assets. Pull restores uploaded public-asset files to public/, preserving image and font bytes. Record attachments are excluded. Unchanged remote assets keep local edits; changed remote assets replace them and report overwritten edits. Missing remote assets leave local files untouched. Assets share the 12 MiB encoded-file budget with source and dependency files. Assets exceeding this budget are reported as unsupported; metadata and other supported files still pull. Older servers without asset export continue to pull supported metadata and files.
Dependency files. When the stored package.json or yarn.lock changes, pull replaces the local file and reports any overwritten local edits. If the remote file has not changed since the previous pull, local edits are kept. A missing remote file does not delete its local counterpart. When the exported package omits twenty-sdk, as the workspace Custom application does, pull retains your local SDK dependency so CLI commands can still load the project. Dependency files, metadata and the baseline are written together and rolled back together if a write fails.
Run yarn install after pulling dependency changes. Pull installs dependencies only when creating a new project, before restoring the remote files; it does not reinstall them after replacing package.json or yarn.lock. Pull does not regenerate the typed client. Run twenty app generate-client when you need updated workspace types.
Logic functions restore their original definitions and inventoried local imports. Missing or stale inventories are reported as coverage gaps; reapply from the original project to refresh them.
What it does not write:
- Not exported yet — command menu items and settings menu items, settings front components, connection providers, application variables, timeline activity types.
- Front components the export cannot carry yet — missing source, computed identifiers, metadata that differs from the workspace, or widget availability that one definition cannot express are reported and left in place.
- Derived by the engine — system fields, default relations, default views and backing indexes, and the default page layouts of each object. The server rebuilds them on apply. An object may still point its label identifier at one of them, as junction objects created in the UI do; the pointer is written and the build resolves it without adding a field.
- Placed on a default or foreign view — filters, filter groups, sorts, groups and field groups added to an engine default view, or to a view owned by another application, have no source form yet and are reported. View fields added there are written as standalone files, since the view’s identifier is known.
- Placed on a default or foreign page layout — tabs and widgets added to an engine default page layout, or to one owned by another application, are written as standalone
definePageLayoutTab()anddefinePageLayoutWidget()files, since the identifier they attach to is known. - Widgets the export cannot carry yet — on any layout, including your own, a widget of the deprecated
VIEWtype, a widget referencing an unexported front component or one of your app’s own command menu items, a widget with conditional availability, a widget without a configuration, or a widget with a missing or incompatible position for its tab’s layout mode is reported, and the layout or tab is written without it. - Workflows the export cannot carry yet — a workflow changed in the workflow builder since the last sync, a system or private workflow, one with a Code step created before steps stored their source, and one calling another app’s workflow action are reported and left in place. A left-in-place workflow keeps its
.code.tsfiles. The workspace custom application is the exception for the first and last cases: the builder publishes its workflows too, and they may call any app’s actions, so they are pulled. One of its workflows is reported instead when it has no active version, or when its active version uses settings a definition can’t express. Email and calendar steps are pulled: an account shared with the workspace is written as itsconnectedAccountHandle, while a member’s private account and variables are kept as they are. The workflow is reported instead when a step’s account is archived, can no longer run the step, or shares its address with an older account, since applying the handle would pick another account. - Agents the export cannot carry yet — an agent on more than one role, or bound to a role pull does not write, is reported and left in place.
- Validation rules the export cannot carry yet — a rule with no expression or message, such as an unfinished draft from Settings, or one that reads a field deleted from the workspace, is reported and left in place.
- Workspace runtime state, record attachments, email attachments, member and API-key role assignments, webhooks, per-user navigation and navigation items pinned to a record, all excluded by design, including for the workspace Custom application.
- Owned by another application — reported, never pulled.
twenty app apply --no-prune until the missing kinds are covered. The workspace Custom application already applies this way by default. A pruning apply (the default for other apps, --prune for the Custom application) would delete them, and twenty app plan lists exactly which.
Workspace-local state. An entity deactivated in the workspace is written as an active definition, and the overrides the workspace made on an entity, such as a renamed label, are not written. The report lists those rows under “Written without their workspace-local state”. Applying the tree back to the same workspace leaves that state untouched; another workspace gets the entity active and without the overrides.
The base file. Pull records what it pulled in .twenty/cli/pull-base.json, which is gitignored and per checkout. That file is what a later pull compares against to leave untouched the files whose entity did not change, and to delete the file of an entity that is gone from the workspace. A checkout without it simply writes everything and deletes nothing.
Recovery ladder
When local metadata looks wrong, escalate in this order and stop as soon as you’re unblocked. Each step is more disruptive than the last.- Re-sync. Run
twenty app applyagain. Syncs are idempotent — re-running a clean manifest is safe and often resolves a transient hiccup. - Preview the plan. Run
twenty app planto see exactly what the next sync intends to change, without applying it. - Read the named error. If a sync fails, note the metadata type and
universalIdentifierin the message (see above) and locate that entity in your manifest. A conflict usually points to a duplicated or re-used identifier. - Uninstall and reinstall.
twenty app uninstall, then sync again (twenty app dev). This rebuilds the app’s metadata from a clean slate while keeping the rest of your workspace intact. - Full reset (last resort). For a CLI-managed local environment, run
twenty local reset, thentwenty local startand reconnect before syncing again. For a source checkout, reset and re-seed its development database instead.
Hit a metadata error? Please open an
issue and include the
failing migration message (with its metadata type and
universalIdentifier),
the Metadata changes output from the sync, and the commands you ran.Avoid concurrent syncs on one workspace
Syncing applies metadata migrations. Running several sync, deploy, or install operations against the same workspace at the same time — for example, multiple terminals or AI agents iterating in parallel — can interleave those migrations and leave metadata in a partially-applied state. The server serializes syncs per workspace to prevent this, but you should still funnel sensitive metadata operations through a single process rather than firing them concurrently. If you orchestrate development with multiple agents, route their sync/deploy/install calls through one queue so only one runs at a time.Telling failures apart
When something goes wrong, the metadata diff and named errors let you place the failure:- Manifest build error — the CLI fails before syncing (
MANIFEST_BUILD_FAILED,TYPECHECK_FAILED); fix your app source. - Registration ownership error — the sync is refused because the app’s
universalIdentifierbelongs to another workspace, or to no workspace at all; see Registration ownership. - Sync / migration error — the build succeeds but applying the diff fails, naming the entity and
universalIdentifier; fix the conflicting metadata. - Dependencies size error — the sync or install fails because the app’s production
dependenciesare too large to install as a runtime layer (LOGIC_FUNCTION_DEPENDENCIES_SIZE_EXCEEDED); move packages your logic functions do not import at runtime (UI libraries, dev tooling) todevDependencies. - Deferred migration in progress — the sync is refused because a background data model migration from an earlier sync is still running (
DEFERRED_WORKSPACE_MIGRATION_ACTIONS_IN_PROGRESS); wait for it to finish, then sync again. - App code runtime error — the sync succeeds but your logic functions or components misbehave at runtime; check function logs.
- Local instance state — none of the above and the workspace still looks wrong; work down the recovery ladder.