Skip to content

monoceros create-template

Turns a workbench that works into a template, so the next one starts from the same setup. The template lands next to your other workbench templates, and monoceros init starts from it.

Terminal window
monoceros create-template <name> <template> [--description "…"]

<name> is the workbench (acme below is a sample workbench name). <template> is the name of the new template.

Flag Content
--description What the template is for, in quotes (--description "Node with Postgres."), or the shell passes only its first word. Written under the comment at the top, where list-components --json reads it from.

You set up the workbench acme for a project: Node, Postgres, RabbitMQ and Claude Code, each configured the way your team works. The next project needs the same, and you don’t want to piece it together from init flags again.

Make acme a template called standard:

Terminal window
monoceros create-template acme standard --description "Node with Postgres and RabbitMQ, plus Claude Code."
✔ Wrote template 'standard': ~/.monoceros/templates/workbenches/standard.yml
ℹ Start a workbench from it: monoceros init <name> --template=standard
ℹ In a team repository, commit it there.

acme itself is unchanged. The next project, shop say, starts from the template and gets the same setup under its own name:

Terminal window
monoceros init shop --template=standard

init asks for the credentials the setup needs, because the values in acme.env stay with acme. If ~/.monoceros/templates is your team’s repository, commit standard.yml, and your colleagues can start from it after their next pull.

  • Replaces the workbench name and the runtime. Wherever the name stands as a word, in name: and in the comments, it becomes __MONOCEROS_NAME__. The pinned runtimeVersion becomes __MONOCEROS_RUNTIME_VERSION__. Other values stay as they are, so a repository URL that happens to contain the name is never touched.
  • Copies the yml only. The values in acme.env stay behind. The template keeps the ${VAR} references, and init --template asks for the values.
  • Replaces a carried-over description. A workbench made from a template still has that template’s description; --description replaces it.
  • Never overwrites a template. If one of that name exists, the command stops and writes nothing.