Skip to content

Template Authoring Guide

29 provider templates across 13 categories. Each template teaches the system how to manage a specific platform — what resource types it serves, what actions it can perform, and how those actions translate to concrete commands.

Categories

Category Providers
compute proxmox, govc, powercli, kubevirt
container docker, incus, k3d, kubectl, argocd
cicd dagger, gitlab
networking vyos, caddy, nginx
dns cloudflare, powerdns, technitium
identity vault, keycloak
database postgresql
dcim netbox
provisioning foreman
automation ansible, awx
monitoring zabbix
iac terraform, opentofu
backup restic, pbs

Directory Structure

template/<name>/
  meta/meta.cue          # Provider metadata and type matching
  patterns/<name>.cue    # Action registry
  examples/demo.cue      # Working example
  README.md

Parameter binding

Each parameter declares from_field — the resource field it binds to:

from_field Resolves from Example value
"ip" resource.ip "198.51.100.211"
"host" resource.host "pve-alpha"
"container_id" resource.container_id 101
"ssh_user" resource.ssh_user "root"

Rules:

  • If a required parameter's field is missing from the resource, the entire action is silently omitted.
  • Optional parameters (required: false) with default values use the default when the field is absent.
  • All values are stringified for template substitution.
  • Up to 8 parameters per action (limitation of #ResolveTemplate).

Conventions

  1. Use generic field names. host not node, container_id not lxcid.
  2. One registry per provider. Name it #<Name>Registry.
  3. Idempotent by default. Mark read-only actions as idempotent: true. Mark state-changing actions as destructive: true.
  4. SSH wrapping. For remote actions, use ssh {host} '<command>' in the template.
  5. Package naming. meta/meta.cue uses package meta. patterns/<name>.cue uses package patterns. examples/demo.cue uses package demo.