Skip to content

template lua Reference

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

template.lua Reference

Required manifest of every template.

Minimal example

return {
id="my_app",
name="My App",
version="0.1.0",
description="Short description",
source_dir="files",
output= {
path="{{ project_slug }}",
overwrite=false,
},
}

Fields

FieldRequiredDescription
idyesUnique template ID (folder name recommended)
nameyesDisplay name in list / info
versionyesSemver string for reapply policy
descriptionnoShort text
source_diryesRelative path to source files (usually "files")
includesnoList of base template IDs
output.pathnoDefault target path when no CLI target ({{ vars }})
output.overwritenoDefault existing_path_behavior (false = error)

includes

includes= { "base_cpp_common" },

See Includes & Layering.

output.path

Prebyte expression. Without a CLI target, Tempify renders into this path (relative to CWD).

Hooks

Hooks are detected as files:

  • hooks/pre.lua
  • hooks/before_render.lua
  • hooks/after_render.lua
  • hooks/post.lua

See Hooks (Authors).

layout.lua

Separate file in template root - see layout.lua.

See also

Your First Template · Template Quality

Clone this wiki locally