Command Palette

Search for a command to run...

Templates

Scaffold new projects from templates

A template is a project starter — a folder of files with an anesis.template.json manifest. Install one, run anesis new, and Anesis writes a fully-rendered project to disk with your project name substituted throughout.

Local cache under ~/.anesis.tera file rendering + inputsCommit-aware cache reuseNon-interactive: --yes, --input, --installed

Installing a template

anesis template install downloads the template and saves it to your local cache. You only need to install once — subsequent uses are served from cache unless there's a newer version.

# Install a template by name from the registry
anesis template install react-vite-ts

# Anesis downloads the template and caches it at:
# ~/.anesis/cache/templates/react-vite-ts/

Installing requires a valid login session from anesis login, because the CLI looks up the template in the backend registry.

Finding templates

Browse the template registry to discover what's available before installing.

Every template in the registry has a name, description, and version. The template name is what you pass to anesis template install and anesis new.

Template names can only contain letters, numbers, hyphens, and underscores. Spaces and special characters are rejected by the CLI before it even contacts the backend.

Open the template registry →

Creating a new project with anesis new

This is the primary command for using templates. It combines template auto-install (if needed) with project generation in a single step.

# Create a new project from a template
anesis new my-app react-vite-ts

# Use "." to scaffold into the current directory
anesis new . react-vite-ts

# Omit the template to pick one interactively
anesis new my-app

# Only offer templates you've already downloaded
anesis new my-app --installed

# Non-interactive: accept defaults and pass input values up front
anesis new my-app react-vite-ts --yes --input use_ssl=true --input driver=postgres

# Scaffold a template + a pinned set of addons from a stack
anesis new my-app --stack nest-drizzle-stack

When you run it, Anesis works through four steps:

  1. Validate the project name. The name must not already exist on disk. A single dot (".") is allowed to scaffold into the current directory. Names can use letters, numbers, hyphens, underscores, and dots, but cannot start with a dot or end with a dot or space.
  2. Ensure the template is available. If the template isn't already in the local cache, Anesis fetches it from the registry automatically. This step requires a valid login. Pass --installed to only pick from templates already downloaded.
  3. Collect inputs. If the template manifest declares an inputs array, Anesis prompts for each one (or reads it from --input NAME=VALUE / accepts the default with --yes) before generating any files.
  4. Render and copy files. Files ending in .tera are rendered through Tera with the project name and every input (plus its pascal/camel/kebab/snake forms) in scope. Any paths matched by the manifest's exclude blocks are skipped. All other files are copied exactly as-is.
  5. Print next steps. Once the project is written, Anesis prints "cd <project-name>" so you know where to go. If any output file already existed on disk, it warns which paths were overwritten.

Listing installed templates

See which templates are already cached on this machine. This command reads only local files — no network call, no login required.

# See every template currently cached on this machine
anesis template list

Removing a template

Remove a template from the local cache. The template can be re-installed later; the registry entry is not affected. No login required.

# Remove a template from the local cache
anesis template remove react-vite-ts

# The template can be re-installed at any time

Updating a template

Re-fetch a template from its source URL and update its registry entry. Use this when the template author has pushed new changes.

# Re-fetch a template and update the registry entry
anesis template update https://github.com/owner/repo/tree/main/templates/react-vite-ts

The update command requires a GitHub URL pointing to the template directory — the same URL used when the template was originally published. A valid login is required.

How the cache works

Anesis caches templates locally and avoids unnecessary re-downloads using commit SHAs.

  • Templates are stored at ~/.anesis/cache/templates/<name>/ after the first install.
  • A cache index at ~/.anesis/cache/templates/anesis-templates.json tracks name, version, source, and commit SHA.
  • On install, Anesis compares the cached commit SHA against the latest value from the backend. If they match and the directory exists, the download is skipped.
  • anesis template remove deletes the cached directory and removes the entry from the index.

Templates inside a stack

A stack pins a template together with an ordered set of addons, so you can scaffold both in one command.

anesis new my-app --stack <id>scaffolds the stack's template exactly as described above, then applies each addon in the stack in order. See Using Stacks →

Next steps

Ready to build and share your own?

  • Creating Templates — author an anesis.template.json manifest, declare inputs, and use Tera variables for rendering.
  • Publishing Templates — publish and update a template in the Anesis registry using a GitHub URL.