zynagent-first application framework

Generate command#

Usage:
  zyn generate [generator]

Generators:
  migration NAME     create an empty SQL migration
  notification NAME  create a notification and email templates
  table TABLE        create a table migration

Generate migrations, tables, and notifications within the current project.

Example:
  zyn generate migration add_status_to_orders

Documentation: zyn docs cli/generate

zyn generate migration NAME, or its zyn g migration NAME alias, creates an empty timestamped SQL file under db/migrations. zyn generate notification NAME, also available through zyn g notification NAME, registers a notification handler and creates text and HTML email templates under src/notifications. zyn generate table TABLE, also available through zyn g table TABLE, creates a migration for a table with a uuidv7() primary key, created_at and updated_at timestamps, and an update trigger calling public.zyn_set_updated_at().

For example:

$ zyn g table audit_events
created db/migrations/20260805143000_create_audit_events.sql
$ zyn db migrate

Edit the generated SQL before migrating when the table needs additional columns or constraints.

Names must be strict snake case. Notification names must also be valid non-keyword Zig identifiers. Table names are limited to 44 ASCII bytes, and schema_migrations is reserved by the framework. Apply generated migrations with zyn db migrate.

Command help
Usage:
  zyn generate migration NAME

Generate migrations, tables, and notifications within the current project.

Example:
  zyn generate migration add_status_to_orders

Documentation: zyn docs cli/generate