mix caravela.gen.context (Caravela v0.13.3)

Copy Markdown View Source

Generates a Phoenix context module for the given domain, with CRUD functions for every entity, authorization via can_* permissions, and lifecycle hooks via on_*.

mix caravela.gen.context MyApp.Domains.Library

Flags:

  • --dry-run — print the generated file without writing
  • --output DIR — write under DIR instead of the project root
  • --force — overwrite existing files without prompting

Regeneration preserves content below the # --- CUSTOM --- marker.