Skip to content

Questions and Answers

Leonard Ramminger edited this page Aug 22, 2026 · 1 revision

Questions & Answers

How Tempify collects values and uses them in templates.

Question sources

Source Description
questions.lua Definitions in the template (type, default, validation)
Template .env Environment variables in template root
Configuration defaults in global/workspace config
--answers JSON file
--set CLI (highest priority)
Interactive / --tui Prompt for missing required values

Priority (low → high)

  1. Question defaults and derived defaults (e.g. slugify(project_name))
  2. Template .env
  3. Global config defaults
  4. Workspace config defaults
  5. --answers
  6. CLI --set

Answers file format

JSON object with scalar values:

{
  "project_name": "My App",
  "name_slug": "my-app",
  "namespace": "app_ns",
  "include_ci": false,
  "author": "Me"
}

Allowed value types: string, bool, integer (used internally as strings).

Export for replays

tempify basic_cpp my-app --write-answers resolved.json ...

Strict mode

With --strict:

  • Unknown keys in --answers → error
  • Invalid imported values → error

Without --strict, unknown keys are ignored.

Non-interactive

tempify basic_cpp my-app --non-interactive --answers answers.json

Missing required value → abort instead of prompt.

Show questions

tempify basic_cpp --questions
tempify basic_cpp --questions --json --full

Authors

Define questions: questions.lua Reference

See also

Configuration · Getting Started

Clone this wiki locally