Skip to content

feat: mxcli scaffold crud — generate standard CRUD pages, microflows, and navigation from an entity #513

@ako

Description

@ako

Feature request

Generate a complete CRUD scaffold for a given entity in one command:

mxcli scaffold crud MyModule.Customer -p app.mpr

What it generates:

  • MyModule.Customer_Overview — overview page with a data grid and New/Edit/Delete buttons
  • MyModule.Customer_NewEdit — new/edit page with input fields for all attributes
  • MyModule.ACT_New_Customer — microflow: create object, show NewEdit page
  • MyModule.ACT_Save_Customer — microflow: validate, commit, close page
  • MyModule.ACT_Delete_Customer — microflow: delete with confirmation, return to overview
  • Navigation menu item pointing to the Overview page (optional, --nav <profile>)

Options:

  • --module <name> — override output module (default: entity's module)
  • --nav <profile> — add a navigation menu item to the named profile
  • --output <file.mdl> — write generated MDL to a file for review before exec (default: apply directly)
  • --layout <name> — layout to use for pages (default: project default)

Rationale

This is the most common pattern in Mendix development. Hand-writing it three times per entity (as experienced during testing) is the highest-friction part of app generation. A scaffold command eliminates it and also gives LLMs a reliable, convention-correct starting point.

Strategic context

Discussed in docs/01-project/MXCLI_STRATEGIC_POSITIONING.md (Section 10) as a Starlark generation pattern:

Implementation patterns — CRUD, approval workflows, master-detail pages — are quantitative: given the same inputs, the correct output is always the same. These should move to Starlark generation scripts.

The scaffold command is the user-facing entry point; the underlying implementation can be a built-in Starlark script (patterns/crud.star) that emits MDL and is invoked by mxcli scaffold crud. This makes the pattern inspectable, overridable, and composable with org-specific conventions.

Non-goals

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions