Templates¶
Templates are YAML files that describe a complete development environment. They tell dXon which packages to install, which setup commands to run, and optionally which questions to ask you before creating the container.
Template format¶
Templates use the dxon/v1 schema and are standard YAML files with a .yaml or .yml extension.
A minimal template looks like this:
schema: dxon/v1
name: myenv
description: My development environment
base: arch
packages:
arch:
- git
- curl
- nodejs
- npm
steps:
- name: Enable corepack
run: corepack enable
What a template contains¶
base— the suggested base distro for the container (arch,debian,alpine)packages— distribution-specific packages installed before any steps runoptions— interactive prompts shown to the user before container creationsteps— ordered setup commands run inside the container after packages are installedenv— environment variables set inside the containerrun— commands run after all steps complete
Using templates¶
From the registry¶
Reference a template by name and dXon fetches it from the official registry:
From a local file¶
From a URL¶
Templates from sources other than the official registry will show a trust warning before proceeding.
Official templates¶
The official registry includes templates for common environments:
| Name | Description |
|---|---|
nodejs |
Node.js with optional package manager (npm, pnpm, yarn, bun) |
python |
Python 3 with pip |
rust |
Rust via rustup with clippy and rustfmt |
go |
Go development environment |
cpp |
C/C++ with build tools and optional cmake/ninja |
Pull the full list with:
Writing your own template¶
- Create a file with a
.yamlextension - Set
schema: dxon/v1and give it aname - Define
packages,options, andstepsas needed - Test locally:
dxon create test --template ./mytemplate.yaml
The Template Specification documents every field in detail.