Generators (CLI Scaffolding)
ZinTrust uses CLI generators to keep projects consistent across teams: folder layout, import style (ESM + aliases), and default patterns are all produced by the same scaffolding code.
The main entrypoints are:
zin new <name>— scaffold a new projectzin add <type> [name]— add components to an existing project
Most generators are interactive by default; add --no-interactive for CI / scripted runs.
zin add — add components
The add command supports these canonical type values:
servicefeaturemigrationmodelcontrollerroutesfactoryseederrequestfactoryresponsefactoryworkflowgovernance
Common options
--no-interactive— disable prompts (required for deterministic automation)--package-manager <pm>— used when installing plugin-style adapters (npm|yarn|pnpm)
Service generator
Creates an in-project service scaffold (folders + starter code).
Key options:
--domain <name>--port <number>--database <shared|isolated>--auth <api-key|jwt|none|custom>
Example:
zin add service users --domain ecommerce --port 3001 --database shared --auth api-key --no-interactiveFeature generator
Adds a feature module into an existing service path.
Key options:
--service <path>— the service root directory path (relative to project root)--with-test— generate an accompanying test
Example:
zin add feature auth --service src/services/ecommerce/users --with-test --no-interactiveController generator
Creates a controller file.
Key option:
--controller-type <crud|resource|api|graphql|websocket|webhook>
Example:
zin add controller UserController --controller-type resource --no-interactiveModel generator
Creates an ORM model.
Key options:
--soft-delete--timestamps(timestamps are enabled by default; use interactive prompts to disable)
Example:
zin add model User --soft-delete --no-interactiveMigration generator
Creates one or more migration files.
Example:
zin add migration create_users_table --no-interactiveRoutes generator
Creates a new route group file.
Key option:
--resource— scaffold resource-style routes
Example:
zin add routes api --no-interactiveFactory and seeder generators
Factories and seeders can be parameterized.
Common options:
--model <ModelName>--relationships <csv>
Seeder options:
--count <number>--states--truncate
Workflow generator
Scaffolds CI/CD workflow templates.
Key options:
--platform <lambda|fargate|cloudflare|deno|all>--branch <name>--node-version <version>
Governance installer
zin add governance installs governance tooling (lint + architecture tests) into an existing project.
Plugin-style installs: zin add <domain>:<driver>
ZinTrust supports planned modular adapter installs via the domain:driver syntax.
Examples:
zin add db:sqlite
zin add queue:redis
zin add broadcast:redis
zin add mail:nodemailerUse --package-manager to control the installer:
zin add db:sqlite --package-manager pnpmzin new — scaffold a project
zin new generates a new project directory with a selected template and baseline configuration.
Options include:
--template <basic|api|microservice|fullstack>--database <sqlite|mysql|postgresql|d1-remote>--port <number>--no-git/--no-install--package-manager <npm|yarn|pnpm>--governance--no-interactive
Example (fully scripted):
zin new my-app --template api --database postgresql --port 7777 --governance --no-interactiveTemplate scaffolds (Mail + Notification)
ZinTrust also provides focused scaffolds for Markdown templates:
zin make:mail-template(alias:zin make:mail) → creates a file undersrc/mail/markdown/...zin make:notification-template→ creates a file undersrc/notification/markdown/...
These are project-owned templates; see the Markdown template docs for how registries resolve templates.
Microservices generator (services/ folder)
Separate from zin add service, ZinTrust includes a microservices workspace generator under the services/ folder, driven by scripts:
npm run microservices:generate -- <domain> <servicesCsv>npm run microservices:bundle -- <domain> <servicesCsv>npm run microservices:docker -- <domain> <servicesCsv>
This path is intended for domain-level microservices folders (e.g., services/ecommerce/users).