mix ash_form.gen.live (AshFormBuilder v0.4.0)

View Source

Scaffolds a complete CRUD LiveView interface for an Ash resource.

Usage

$ mix ash_form.gen.live -r MyApp.Accounts.User
$ mix ash_form.gen.live --resource MyApp.Blog.Post --accent teal --transitions smooth
$ mix ash_form.gen.live -r MyApp.Inventory.Product --page-size 50
$ mix ash_form.gen.live -r MyApp.Accounts.User --out lib/my_app_web/live/admin

Required option

  • --resource / -r — Fully-qualified resource module (e.g. MyApp.Accounts.User).

Optional flags

  • --out / -o — Override output directory. Default: lib/<otp_app>_web/live/<snake_resource>_live
  • --page-size / -p — Cinder page size. Default: 25
  • --theme / -t — Theme atom or module passed to the form component (:shadcn, :default, :glassmorphism, :mishka, or a user-registered atom). Defaults to whatever the resource's form DSL declares.
  • --accent — Accent color atom (e.g. teal, indigo, rose). Overrides the form's DSL default.
  • --transitionsnone, subtle, or smooth.
  • --web-module — Override the <App>Web module name (rare).

Generated files

  • index.ex — Phoenix LiveView with mount, handle_params, handle_info, and handle_event for create / edit / delete. URL state managed by Cinder.UrlSync.
  • index.html.heex — Cinder.collection table + <.modal> with AshFormBuilder.FormComponent for create/edit. Honors per-form theme/accent/transitions from the resource's DSL, with optional flag-based overrides.