Skip to content

Recipes

A recipe is a production-shaped service definition. It carries the decisions of the stack it came from: dependency choices, dockerfile targets, a dev override, a health endpoint, admin tooling, deploy configuration. mx add applies all of it in one motion.

Terminal window
mx recipes list # what is installed
mx recipes info rust-api # options, features, services
mx add api --recipe rust-api --domain api.localhost # apply it
RecipeVersionApplyWhat it carries
astro2.1✅Astro 5 with Vue 3 islands, SSR, shadcn-vue, PrimeVue, global state, Cloudflare deployment. Brings db and redis.
laravel12.0✅Laravel 12 + Octane (Swoole), Filament admin, Inertia.js SSR. Brings a worker, a scheduler, db and redis.
laravel-rust0.3✅Laravel for Rust (Axum + Tokio, Inertia + React) scaffolded by laravel new --rust. Brings a queue worker, db and redis; Vite hot reload is routed on its own hostname. Opt-in: scheduler, Inertia SSR, Reverb websockets, S3 object storage.
nuxt4.0✅A Nuxt app scaffolded by nuxi init, with the Nitro server and a dependency-free /api/health. Standalone.
rust-api1.0✅Actix-web + SQLx, hexagonal architecture. Brings db and redis.
rust-leptos1.0✅Leptos SSR on Actix-web with shadcn-ui, actor model, Postgres and Redis.
rust-worker1.0✅Job worker on Redis pub/sub with Postgres and local LLM evaluation.
zola1.0✅Zola static site generator. Single binary, no runtime dependencies.

mx new, mx add <svc> --recipe <r>, make dev. No hand edit in between, for every recipe that brings Postgres with it.

That is new. scripts/init.sh used to copy .env.secrets.template verbatim, leaving DB_USER, DB_PASSWORD and DB_NAME empty, and Postgres refuses to initialize with an empty password. scripts/generate-secrets.sh is now the single generation point every recipe shares: make init runs it, make dev runs make init, and it fills only what is still empty or still a placeholder. See Compose & env conventions.

A recipe can ship features that are off unless you ask for them. laravel-rust has four:

Terminal window
mx add web --recipe laravel-rust --with scheduler,ssr,reverb,storage
FeatureWhat you get
schedulerThe task scheduler (schedule:work): a process in the dev container, its own service in production
ssrInertia server-side rendering: Vite renders in development, the production image builds the SSR bundle and runs it beside the binary
reverbThe Reverb WebSocket server for broadcasting, routed at ws.<domain>
storageS3 object storage on a local emulator, routed at storage.<domain>, as the app’s default disk

--with a,b is shorthand for --opt a=true --opt b=true, and a name the recipe does not declare is an error rather than a silent no-op. Run mx add on a terminal without the flag and it asks about each feature instead. --no-prompt skips the questions; so does any non-interactive caller (a pipe, CI, an agent through the MCP server), which gets the defaults.

To add a feature to a service that already exists, run the same mx add again with the full set you want. The app is left alone (the scaffolder is skipped) and the infrastructure files are rewritten for the new set.

Features that need a credential declare it. The install adds the key, empty, to docker/.config/.env.secrets, and make init generates the value the next time make dev, make up or make prod runs. That is also how laravel-rust gets its APP_KEY with no manual step.

astro, laravel-rust, nuxt and zola run a framework initializer, and by default a second mx add over a service that already has an app skips it and says so. To start over from the framework’s own starter:

Terminal window
mx add site --recipe astro --opt force_init=true

This deletes apps/site/ and re-runs the initializer before mx’s wiring is layered back on. Destructive by design, and it refuses any target_dir that escapes the project rather than following it outward.

mx add reads the recipe manifest and works through it in order:

  1. Options: defaults from the manifest, overridden by --domain, any --opt key=value and any --with feature. On a terminal, options the recipe marks with a prompt and that you did not pass are asked for. mx recipes info <name> lists what a recipe accepts; rust-api, for example, takes rust, port and domain.
  2. Placeholders: {{SERVICE_NAME}}, the port, the domain and the rest are substituted through every template.
  3. Framework scaffold (init_app, where a recipe declares one): astro, laravel-rust, nuxt and zola run the framework’s own initializer here. mx add prints Scaffolding the app… and then the command it used, or Scaffolder skipped: <dir> already holds an app when the target is not empty. This step comes first, so mx’s own wiring layers on top of the starter files and wins every collision with them.
  4. Directories: any part of the app’s source tree the scaffolder did not create is filled in.
  5. Templates: the app files, docker/compose/<service>.yml and <service>.dev.yml, docker/dockerfiles/<service>/app and app.prod, and docker/.config/.env.<service>.
  6. Router labels: the Host() rule for your --domain and the devmesh-traefik wiring.
  7. Post-install: anything the recipe declares: renames, .gitignore entries, commands, and the secret keys it needs generated.

Templates and post-install steps can be conditional on an option, which is how an optional feature installs nothing at all when it is off.

Recipes that need backing services also drop db.yml / redis.yml in, once.

A scaffolder command has to be non-interactive, because mx add runs it without a terminal. The shipped defaults carry the flags that make that true, and a command that exits 0 while leaving the target empty is treated as a failure rather than a success, with the command, its working directory and both streams reported. To use a different starter, pass your own: mx add site --recipe astro --opt init_cmd='...'.

The corpus has the long-form version of this, including how recipes and the build system fit together:

→ mx recipes and build

Recipes are directories of templates plus a recipe.json manifest that declares options, placeholders, directories, templates, an optional init_app command and optional post-install steps. Optional features are built from four small pieces: an option with a prompt, a condition on a template mapping, # mx:if NAME / # mx:endif blocks inside a template file, and post_install.secrets. The full authoring guide (manifest schema, placeholder rules, the conformance tests a recipe has to pass) is in the corpus:

→ Recipe Authoring Guide

Also useful while authoring: Docker assembly guide for the dockerfile and compose halves, and Compose & env conventions for what your generated compose files have to honour.

mx recipes pull, mx recipes versions and mx recipes cache work against Unyform-hosted blueprints. That path is optional and needs an account; local recipes need neither. See Remote blueprints.