deckctl template
Handles template lifecycle.
Synopsis
Section titled “Synopsis”deckctl template [command] [flags]| Subcommand | Purpose |
|---|---|
list | List available templates from a source |
variables | List the variables a template expects, without applying it |
apply | Render a template into a target directory |
All subcommands also accept the global flags.
deckctl template list
Section titled “deckctl template list”List available templates from a source.
deckctl template list [flags]| Flag | Default | Description |
|---|---|---|
-s, --source <name> | — | Source to list from. Prompted for if omitted. |
Table columns: Name, Path. Path is the absolute directory for local
sources and empty for GitLab sources.
deckctl template list --source localdeckctl template list --source work -o jsondeckctl template list --source local --concurrency 8deckctl template variables
Section titled “deckctl template variables”List the variables a template expects, without applying it.
deckctl template variables [template-name] [flags]Takes exactly one positional argument: the template name.
| Flag | Default | Description |
|---|---|---|
-s, --source <name> | — | Source to fetch from. Prompted for if omitted. |
--sidecar-format <fmt> | auto | auto, deckctl or copier |
Table columns: Name, Type, Default, Choices, Description. A variable
with no declared type is reported as str.
This command fetches the template but never renders or writes anything. For Copier templates, translation warnings are printed to stderr.
deckctl template variables go-service --source localdeckctl template variables go-service --source work -o jsondeckctl template variables legacy-thing --source work --sidecar-format copierdeckctl template apply
Section titled “deckctl template apply”Apply a template to a target directory.
deckctl template apply [template-name] [output-path] [flags]Takes exactly two positional arguments: the template name and the output directory.
| Flag | Default | Description |
|---|---|---|
-s, --source <name> | — | Source to fetch from. Prompted for if omitted. |
--var key=value | — | Set a variable. Repeatable. Wins over sidecar defaults. |
--tag <ref> | — | Git tag to fetch (GitLab sources). Omit to pick interactively. |
--dry-run | false | Print what would be written; touch nothing. |
--no-cache | false | Bypass the cache and re-fetch unconditionally. |
--sidecar-format <fmt> | auto | auto, deckctl or copier |
What it does
Section titled “What it does”- Resolves the source (prompting for
--sourceif absent). - For GitLab sources, resolves the ref:
--tagif it exists, an interactive picker if the project has tags, otherwise the default branch. - Fetches the template, using the cache when fresh.
- Detects the sidecar format and resolves variables:
--var→ sidecar default → interactive prompt. - Walks the tree from the render root (
subdirectoryif set, else the template root): files matchingtemplate_suffixesare rendered and lose the suffix, everything else is copied byte-for-byte. - Writes a history record — unless
--dry-run.
Output
Section titled “Output”RENDER main.goRENDER README.mdCOPY LICENSECOPY media/logo.png
Applied "go-service": 2 rendered, 2 copied → ./outWith --dry-run, the full rendered content of each file is printed along with
the source path of each copy, and the summary reads Would apply:
COPY: ./out/LICENSE (from /home/you/.cache/deckctl/work/go-service/main/LICENSE)RENDER: ./out/main.gopackage billing...
Would apply "go-service": 2 rendered, 2 copied → ./outExamples
Section titled “Examples”# Local source, one variable supplied, rest defaulted or prompteddeckctl template apply go-service ./out --source local --var app_name=billing
# Preview onlydeckctl template apply go-service ./out --source local --var app_name=billing --dry-run
# Pinned GitLab tag, fully non-interactivedeckctl template apply go-service ./out \ --source work --tag v1.2.3 \ --var app_name=billing --var replicas=3
# Force a fresh fetchdeckctl template apply go-service ./out --source work --tag v1.2.3 --no-cache
# Force the Copier reader on a template that also has a deckctl.yamldeckctl template apply legacy ./out --source work --sidecar-format copier--varvalues are always strings, whatever the declared type. Sidecar defaults keep their YAML type.- A
--varentry without=is silently ignored. - A
--tagthat doesn’t exist warns on stderr and falls back to the default branch. --tagis ignored for local sources.- Prompts are free-text for every variable type.
- Dry runs are not recorded in history.