Command Palette

Search for a command to run...

Stacks

Scaffold a template and its addons in one shot

A stack is a template plus an ordered list of addons, declared in an anesis.stack.json manifest. Run anesis new my-app --stack <id> and Anesis scaffolds the template, then applies every addon in order — the same pipeline as running each step by hand, wired together.

anesis new <dir> --stack <id>Ordered addon applicationPreset addon inputs

Scaffolding from a stack

This is the primary way to use a stack — one command instead of a template plus a series of anesis use calls.

# Scaffold a project directly from a stack (auto-installs if uncached)
anesis new my-app --stack nest-drizzle-stack

# Or install first, then scaffold
anesis stack install nest-drizzle-stack
anesis new my-app --stack nest-drizzle-stack

The anesis.stack.json manifest

A stack manifest names a template and lists the addons to apply on top of it, in order.

{
  "schema_version": "1",
  "id": "nest-drizzle-stack",
  "name": "NestJS + Drizzle",
  "description": "NestJS starter with Drizzle ORM already wired up.",
  "template": "nestjs",
  "addons": [
    { "id": "dotenv", "command": "install" },
    {
      "id": "nest-drizzle",
      "command": "install",
      "inputs": { "driver": "postgres", "use_ssl": "false" }
    }
  ]
}

Key fields

template
The template name to scaffold first — the same value you'd pass to anesis new <name> <template>.
addons[].id
Addon id to apply, in order, after the template is scaffolded.
addons[].command
Command to run on that addon. Defaults to "install" if omitted.
addons[].inputs
Preset input values for this addon, so the user isn't re-prompted for anything the stack already decided. Missing inputs are still prompted unless --yes is passed.

What happens when a stack runs

A stack doesn't introduce a new execution model — it drives the exact same template and addon pipelines documented elsewhere, in sequence.

  1. The template is scaffolded first, exactly as anesis new would do it (including its own inputs/exclude handling).
  2. Each addon in addons then runs in the order listed, via the same anesis use <id> <command> pipeline — variant detection, input prompts, and step execution all apply.
  3. Any preset in addons[].inputs is used as a default; you're only prompted for values the stack didn't pin (unless --yes is set, which accepts every default).
  4. If an addon fails, the stack aborts with an error naming which addon failed. Steps already applied by that addon are rolled back the same way a standalone anesis use failure would be; earlier addons in the stack are not undone automatically.

Installing and inspecting stacks

Stacks have their own local cache, separate from templates and addons.

  • Stacks are cached at ~/.anesis/cache/stacks/<id>.json — a single manifest file per stack, unlike templates/addons which cache whole directories.
  • anesis stack install <id> pre-downloads and caches a stack manifest. Optional — anesis new --stack <id> auto-installs it when missing.
  • anesis stack list and anesis stack remove operate on the local cache only, no login required.
  • anesis stack info <id> prints the template and ordered addon list; it prefers the freshest registry copy but falls back to the local cache if the registry is unreachable.

Publishing a stack

Stacks are published from a GitHub URL the same way templates and addons are.

anesis stack publish https://github.com/owner/repo
anesis stack update https://github.com/owner/repo

Both accept --visibility, --credential-id, and --org-id — see the command reference for the full flag list. A saved login (anesis login) is required.

Next steps

A stack only references templates and addons that already exist in the registry.

  • Creating Templates — build the base project the stack scaffolds first.
  • Creating Addons — build the addons the stack applies on top, in order.
  • Once both exist in the registry, see Creating Stacks for how to plan the composition and generate the manifest — the builder can also add extra one-off terminal commands (like bun add tailwindcss) alongside your addons before you write anesis stack publish.