Skip to content

Hooks Users

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

Hooks (Users)

Template hooks from the render user's perspective - without writing Lua.

What are hooks?

Optional Lua scripts in the template that run in four phases:

Phase When
pre Before directory/file creation
before_render After directories, before Prebyte render
after_render After Prebyte render
post At the end

tempify info <id> shows whether hooks are defined.

Control

Option Behavior
--accept-hooks yes Always run hooks
--accept-hooks no / --no-hooks Skip hooks
--accept-hooks ask With TTY: confirmation; with pipe/CI: hooks run without prompt

Config default: render.accept_hooks in Configuration.

Trust

With ask + confirmation, the template is stored in the trust store - next time no prompt (for the same template root).

Trust path: $XDG_DATA_HOME/tempify/trust/hooks.json

Timeout

tempify my_template out --hook-timeout-ms 5000

Config: render.hook_timeout_ms. 0 disables timeout.

Security

Hooks run in a sandbox: read/write only within the build root (except read access to template files). See Security.

Reapply & diff

--diff and --reapply do not run hooks (report/update mode).

See also

Hooks (Authors) · Configuration

Clone this wiki locally