The manifest
aspenx.yml lives next to your docker-compose.yml and is the only thing your monorepo adds.
AspenX knows nothing about your projects until it reads aspenx.yml at the monorepo root. The file names the layout, the shared services, the per-feature mail catcher, the QA inputs, and one entry per project. Values under env and compose_env may use the templates below. Everything else is literal.
You can write the file by hand, let aspenx manifest draft propose one, or edit it in the desktop app’s configuration editor. See Editing and checking.
A complete example
monorepo: acme/shop # GitHub owner/repo; the checkout path comes from `aspenx init`
layout: submodules # required; or directories (then every project needs a path)
features_root: ~/aspenx/acme-shop/features # feature folders live here
local_domain: aspenx.localhost # <project>.<feature>.aspenx.localhost
public_domain: example.dev # <label>-<project>.example.dev: review apps and tunnels
open_project: web # what `aspenx open <feature>` opens by default
feature_md: FEATURE.md.tmpl # Go template for .aspenx/FEATURE.md (optional)
shared:
compose_services: [postgres, redis]
postgres_service: postgres # base-file service names (defaults shown)
redis_service: redis
postgres_port: 5432 # host ports the shared containers publish
redis_port: 6379
redis_databases: 64 # four indexes per slot
volumes: [bundle_cache, node_modules_cache] # base-file named volumes shared by every feature
mail:
image: axllent/mailpit:v1.21.8
qa:
checklist: CHECKLIST.md.tmpl # template for .aspenx/qa/checklist.md
logins: # seeded accounts the QA agent may use
- role: admin
email: admin@example.test
password: seed-password
project: web
projects:
api:
compose_services: [api, api-jobs]
port_offset: 0 # host port 4000 + slot*100 + 0
container_port: 3000 # what {{ internal_url api }} points at
health: /healthz
db:
name: app # feature clone: app_<feature> (invoice-pdf gives app_invoice_pdf)
template: app_template
seed: [bin/rails, db:seed]
migrate: [bin/rails, db:migrate]
grant_read: [readonly]
env:
APP_URL: "{{ url api }}"
WEB_URL: "{{ url web }}"
WORKER_INTERNAL_URL: "{{ internal_url worker }}"
CORS_ORIGINS: "{{ url web }},{{ url admin }}"
ALLOWED_HOSTS: "{{ cookie_domain }}"
SESSION_COOKIE_DOMAIN: "{{ cookie_domain }}"
REDIS_URL: "redis://redis:6379/{{ redis 0 }}"
SMTP_HOST: mail
SMTP_PORT: "1025"
compose_env: # ${VAR} interpolation in the base compose file
API_PORT: "{{ port api }}" # the base file publishes "${API_PORT:-3000}:3000"
API_IMAGE_TAG: dev
main_image:
dockerfile: docker/api/Dockerfile.main
services: [api, api-jobs]
args: { RAILS_ENV: production }
test: bin/rails test
cable: /cable
doctor_mail: [bin/rails, runner, "TestMailer.ping.deliver_now"]
tunnel: optional # `aspenx tunnel` may expose it
web:
compose_services: [web]
port_offset: 1
container_port: 5173
env:
VITE_API_URL: "{{ url api }}"
VITE_ALLOWED_HOSTS: "{{ cookie_domain }}"
compose_env:
WEB_PORT: "{{ port web }}"
main_image:
dockerfile: web/Dockerfile
worker:
compose_services: [worker]
public: false # no hostname, no host port: internal only
port_offset: 3 # offsets are unique across every project, public or not
container_port: 9000
env:
API_INTERNAL_URL: "{{ internal_url api }}"
DATABASE_URL: "postgres://app@host.docker.internal:5432/{{ db api }}"
main_image:
dockerfile: worker/Dockerfile
admin:
compose_services: [admin]
port_offset: 2
container_port: 8080
compose_env:
ADMIN_PORT: "{{ port admin }}"
main_image:
dockerfile: admin/Dockerfile
Top level
| Key | Meaning |
|---|---|
monorepo |
The monorepo’s GitHub owner/repo, such as acme/shop. It names the default features_root. aspenx init records the checkout path. |
layout |
Required. submodules: each project is a git submodule, and the submodule path is the project path. directories: projects are directories of one repo, and each needs path. See Layouts. |
features_root |
Where feature folders go. ~ expands. The default is ~/aspenx/<monorepo>/features, with monorepo lower-cased, / turned into -, and characters outside a-z 0-9 . _ - dropped. acme/shop gives ~/aspenx/acme-shop/features. With monorepo unset it is ~/aspenx/monorepo/features. |
local_domain |
The parent of every local hostname. Browsers resolve *.localhost to loopback with no DNS setup. Default aspenx.localhost. |
public_domain |
The parent of the public hostnames that review apps (aspenx review) and callback tunnels (aspenx tunnel) use: <label>-<project>.<public_domain>. The label is the feature’s control-plane id when the install uses one, else its name. The zone must be in Cloudflare. A single label keeps every name under the zone’s wildcard certificate. |
open_project |
The project aspenx open <feature> opens when none is named. Default: the first public project. |
feature_md |
A Go text/template for .aspenx/FEATURE.md, relative to the root. Default FEATURE.md.tmpl. When the file is absent, a built-in template applies. |
shared
Postgres and Redis run once, in the compose project aspenx-shared. Every feature reaches them through extra_hosts entries that point at the Mac, so the host ports equal the in-container ports the base file uses.
redis_databases sizes the shared Redis. Slot s owns indexes 4s to 4s+3.
volumes lists base-file named volumes, such as dependency caches, that every feature shares. Each one becomes the external volume aspenx-<name> with _ turned into -, so bundle_cache becomes aspenx-bundle-cache.
A project cannot list a shared service among its own.
| Key | Default |
|---|---|
compose_services |
None. The base-file services AspenX runs once, in aspenx-shared. |
postgres_service, redis_service |
postgres, redis |
postgres_port, redis_port |
5432, 6379 |
redis_databases |
64 (four per slot) |
volumes |
None. |
mail
image defaults to axllent/mailpit:v1.21.8. Every feature runs a Mailpit container from it. Services reach it as mail on SMTP port 1025 inside the feature’s network, and the browser at mail.<feature>.<local_domain>. The QA agent reads it through the MCP server’s mail_list and mail_read tools.
qa
checklist is the template for .aspenx/qa/checklist.md. The default is CHECKLIST.md.tmpl, and a built-in template applies when the file is absent. new renders it once per feature and never overwrites it.
logins are accounts the canonical seed creates. Each has a role, an email and a password (the last two required) and the project to sign in at. They reach the checklist template, FEATURE.md and the QA prompt. Use seed passwords only, never real credentials.
projects.<name>
| Key | Meaning |
|---|---|
path |
The project’s directory. Required for directories, ignored for submodules. |
compose_services |
The base-file services that belong to this project. Services behind a compose profile never run in a feature. |
port_offset |
Sets the host port published for Caddy: 4000 + slot × 100 + port_offset. 0 to 98, default 0. It must be unique across every project, including those with public: false. 99 belongs to the feature’s mail catcher. |
container_port |
The port the first compose service listens on inside its container. {{ internal_url }} uses it, so it is required once any template names this project with internal_url. |
health |
The path that new, up, touch, restart and review poll on a public project’s host port until it answers. doctor --hosts fetches it through Caddy. Default /. |
public |
false means no Caddy route and no host port. Default true. |
db |
The project’s database. name is required; the feature’s clone is <name>_<feature>, with the feature’s dashes as underscores. template is the database to clone from. template rebuild runs seed in the main image. baseline pull runs migrate. grant_read lists roles that get SELECT after seeding. |
env |
Environment written into the generated override for every service of the project. Templates allowed. |
compose_env |
Variables for ${VAR:-default} interpolation in the base file, written to .aspenx/env. This is how a project’s host port reaches the base file: set VAR: "{{ port <project> }}" for the variable its ports: entry uses. Two projects may set the same variable only to the same value. A conflict fails when AspenX writes the env file. |
main_image |
How to build aspenx/<project>:<source id>. dockerfile is relative to the root. services are the ones that run from the image when the project is referenced; they default to all of compose_services and each must be one of them. Any other service of the project runs as the base file defines it. args are build args. Required for any project a feature runs as referenced: aspenx new refuses a referenced project without one. |
optional |
true means a feature doesn’t run the project unless it turns it on: aspenx new --with, aspenx enable, the app’s Turn on, or by working on it. Turning one on also turns on the optional projects it needs, found from the base file’s depends_on, URLs in its environment that name another project’s service, and its {{ }} references. While it’s off, env vars elsewhere that point at it (http://<service>:<port>) are left unset, so callers see “not configured”. Its main image and template database are built the first time a feature turns it on. Default false. |
tunnel |
optional or always, treated the same. aspenx tunnel may give this public project a callback tunnel of its own. Ignored with public: false. Review apps need no flag, since they carry every public project. |
test |
How to run the project’s tests inside its container. FEATURE.md prints it for touched projects. |
cable |
The websocket path doctor --hosts opens on a public project. |
doctor_mail |
A command, as a list, that doctor --hosts runs in the project’s first compose service to send a test email. The email must land in the feature’s Mailpit with links into the feature. |
Templates
Inside env and compose_env values, AspenX resolves {{ ... }} each time it writes the feature’s override and env file. That happens on new, up, touch, review and pull.
| Template | Value |
|---|---|
{{ url api }} |
The project’s public URL, https://api.<feature>.<local_domain>. While a review app is on, https://<label>-api.<public_domain>. |
{{ host api }} |
The hostname alone, by the same rule. |
{{ port api }} |
The host port Caddy proxies to. |
{{ internal_url api }} |
http://<first service>:<container_port> on the feature’s network. |
{{ db api }} |
The feature’s clone of the project’s database, such as app_invoice_pdf for feature invoice-pdf. |
{{ redis N }} |
The slot’s Redis index N (0 to 3), resolved to slot × 4 + N. |
{{ feature }} |
The feature name. |
{{ slot }} |
The slot number. |
{{ cookie_domain }} |
.<feature>.<local_domain>. A cookie scoped here travels between the feature’s projects and cannot reach another feature. While a review app is on, .<public_domain>. |
Each template has requirements:
url,hostandportneed a public project.internal_urlneedscompose_servicesandcontainer_port.dbneedsdb.redistakes 0 to 3.feature,slotandcookie_domaintake no argument.
The checks below catch a template whose target cannot supply the value.
Editing and checking
There are three ways to change the file, and all of them end in the same checks.
- By hand. The daemon notices a changed
aspenx.ymlwithin a second and re-reads it.aspenx daemon reloadmakes it re-read at once.aspenx projectsshows which submodules or directories the file covers. aspenx manifest.showprints the file with its problems.validatechecks a file, or a document on stdin.writemerges a document into the file, keeping comments and order. It refuses when the document has errors, otherwise writes it and prints the diff;--dry-runprints the diff and writes nothing.inspectdescribes a folder.draftproposes a starter file for a monorepo that has none. See Commands.- The desktop app. It edits the same document in a form, validates as you type, shows the diff before writing, and reloads the daemon after. You commit the change yourself.
A problem names the key (projects.api.port_offset) and says what is wrong. When the key is in the file, it also gives the line.
An unknown key, or a value of the wrong type, stops the file from being read. That problem is reported on its own; fix it to see the other checks. seed, migrate, doctor_mail, compose_services and grant_read are lists.
Errors
Errors stop validate, write and the editor’s Save:
- an empty file;
- a missing or unknown
layout; - no projects;
- a duplicate project, or a bad project name;
- a duplicate, out-of-range or reserved (99)
port_offset; - with
layout: directories, a missing, duplicate or outside-the-repopath; - a project that lists a shared service;
dbwithoutnameortemplate;main_imagewithout a dockerfile, with a dockerfile outside the repo, or withservicesnot incompose_services;- a
tunnelother thanoptionaloralways; - an
open_projectthat is not a project; - a login without email or password, or one naming an unknown project;
- an empty
shared.volumesentry; - a template that names an unknown function or project, is missing its project argument, passes an argument to
feature,slotorcookie_domain, givesredisan index outside 0 to 3, or names a project that cannot supply the value.
With the monorepo root known, these are errors too:
- a
docker-compose.ymlthat does not parse; - a shared or project service missing from it;
- a project service behind a compose profile;
- a volume the base file does not declare;
- with
layout: submodules, a project with no submodule of that name or path in.gitmodules; - a
pathor Dockerfile that does not exist.
Warnings
Warnings never block:
- a project without
main_image; - an
open_projectthat is not public.
With the monorepo root known, also:
- a submodule no project maps;
- a project without
compose_services; - a public project whose first service’s first published port is a fixed host port, or a
${VAR}withoutcompose_envwiring; - a
feature_mdorqa.checklistpath other than the default that does not exist.
--no-context, on validate and write, skips the checks that need the repo. Use it for a document checked away from its repo. Text in {{ }} that is not one function with at most one argument is left as it is.
Running referenced projects
A referenced project needs main_image to run in a feature. When the base file publishes ${VAR:-default}:<port> for it, it also needs compose_env.VAR: "{{ port <project> }}". manifest draft writes both when it can see the Dockerfile and the published port.