Skip to content

Ask for placeholders, template init, templates from Git - #7

Merged
kajvans merged 2 commits into
mainfrom
feat/vars-init-gitadd
Oct 16, 2026
Merged

kajvans merged 2 commits into
mainfrom
feat/vars-init-gitadd

Conversation

@kajvans

@kajvans kajvans commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

What

Three things that make templates nicer to write and use:

  • Placeholders are asked for. A template declares them in .foundry.yaml (vars: with a prompt and a default). In a terminal Foundry asks; with --non-interactive the default is used; any other placeholder that is used but has no value is asked for as well. --strict stops before writing anything when a value is missing (for CI).
  • foundry template init <folder> creates the skeleton of a new template (--add <name> saves it right away).
  • foundry template add <name> <git-address> keeps a copy of a template from Git (--branch); template update fast-forwards it and template remove deletes the copy. The post commands of such a template are never run.

Tested

Unit and CLI tests for declared variables (default, --var wins, missing reported, asking only for what is missing), --strict writing nothing, the skeleton working as a template, adding from a Git address with a real local repository, updating it, not running its setup commands and removing only Foundry's own copy.

Templates declare placeholders in .foundry.yaml (vars) and Foundry asks for them in a terminal; --strict stops
before writing when a value is missing. template init creates a skeleton. template add accepts a Git address and
keeps a copy that update fast-forwards; setup commands of such templates are never run.
@kajvans
kajvans merged commit 6dc1286 into main Oct 16, 2026
19 checks passed
@kajvans
kajvans deleted the feat/vars-init-gitadd branch October 16, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant