Configuring sources
A source tells deckctl where to look for templates. Sources live in
~/.config/deckctl/config.yaml and are referenced by name with --source.
The config file
Section titled “The config file”sources: - name: local type: local path: /home/you/templates
- name: work type: gitlab url: https://gitlab.mycompany.com group: platform/templates token_env: DECKCTL_WORK_TOKEN cache_ttl: 24h
- name: public type: gitlab url: https://gitlab.com group: my-public-group
default_source: localFull field-by-field details are in the configuration reference.
Managing sources from the CLI
Section titled “Managing sources from the CLI”# Add non-interactivelydeckctl source add --name local --type local --path ~/templatesdeckctl source add --name work --type gitlab \ --url https://gitlab.mycompany.com \ --group platform/templates \ --env DECKCTL_WORK_TOKEN
# Add interactively (prompts for each field)deckctl source add
# Inspectdeckctl source listdeckctl source get workdeckctl source list -o json
# Removedeckctl source remove --name workdeckctl source remove --name work --auto-approve # skip the confirmationLocal sources
Section titled “Local sources”A local source points at a directory whose immediate subdirectories are
templates. A subdirectory only counts as a template if it contains a
deckctl.yaml:
~/templates/ go-service/ ← template deckctl.yaml main.go.tpl helm-chart/ ← template deckctl.yaml Chart.yaml scratch/ ← ignored, no deckctl.yaml notes.txtLocal sources are read straight from disk: nothing is cached, --tag is
ignored, and cache_ttl is rejected at config load.
If the tree is large, --concurrency N fans the scan out across a bounded
worker pool:
deckctl template list --source local --concurrency 8The default is 1 (sequential). The result is identical either way — this is
purely a throughput knob.
GitLab sources
Section titled “GitLab sources”A GitLab source points at a group. Every non-archived project in that group is one template, and the template’s files are the project’s files at the root:
group: platform/templates├── go-service/ ← project → template "go-service"│ ├── deckctl.yaml│ ├── main.go.tmpl ← rendered, suffix stripped│ ├── README.md ← copied verbatim│ └── media/logo.png ← copied verbatim (binary)├── helm-chart/ ← project → template "helm-chart"└── retired-thing (archived) ← filtered outNested group paths work: group: platform/templates/backend.
Authentication
Section titled “Authentication”Tokens are never stored in config.yaml. token_env holds the name of an
environment variable, and deckctl reads its value at runtime:
export DECKCTL_WORK_TOKEN=glpat-xxxxxxxxxxxxdeckctl template list --source work| Group visibility | Token needed? |
|---|---|
| Public group on gitlab.com | No |
| Private group | Yes |
| Internal group on a self-hosted instance | Yes |
Create the token at User Settings → Access Tokens. Scopes:
read_api— listing projects and tagsread_repository— downloading archives from private projects
If token_env is set but the variable is empty or unset, deckctl prints a
warning to stderr and continues unauthenticated rather than failing. If
token_env is omitted entirely, no warning is printed.
token_env must look like an environment variable name — uppercase letters,
digits and underscores — or config validation rejects it.
Pinning a version with tags
Section titled “Pinning a version with tags”GitLab-backed templates can be applied at a specific git tag:
# Pin explicitly — non-interactive, the right choice for CIdeckctl template apply go-service ./out --source work --tag v1.2.3
# Omit --tag to pick from the project's tags interactivelydeckctl template apply go-service ./out --source workWhat deckctl fetches:
| You run | Project has tags? | Result |
|---|---|---|
apply X (no --tag) | yes | Interactive picker over all tags |
apply X (no --tag) | no | The project’s default branch |
apply X --tag v1.2.3 | tag exists | v1.2.3 |
apply X --tag v1.2.3 | tag missing | Warning on stderr, falls back to the default branch |
Notes:
- The picker lists every tag, in the order the GitLab API returns them — there is no semver or date sorting.
- Each ref is cached as its own entry, so
v1.2.3andv1.3.0of the same template coexist. See Caching. deckctl template variablesdoes not take--tag; it always inspects the default branch.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Likely cause |
|---|---|
404 Not Found when listing | Wrong group path (check nesting), or the token can’t see it — GitLab returns 404 for both |
| Empty list, no error | Group exists but has no projects, or all of them are archived |
401 Unauthorized | Token set but invalid or expired |
403 Forbidden | Token valid but missing a scope (read_api, read_repository) |
--tag silently ignored | Tag doesn’t exist (check stderr), or the source is local |
| No tag picker appears | The project has no tags — the default branch is used |
More in Troubleshooting.