00:00.0 / 00:00.0
README.md2.3 KB
View on GitHubExample: Scaffold Templates
Scaffold templates for generating new Atmos projects and components.
Learn more in the Scaffold Command Documentation.
What You'll See
- Scaffold template configuration with
scaffold.yaml - Interactive prompts for customizing generated projects
- Template files with Go templating support
- Conditional prompts —
vendor_versionis only askedwhen:enable_vendoringwas answeredtrue - Conditional file generation —
vendor.yamlis only generatedwhen:enable_vendoringistrue, and is skipped entirely otherwise
Try It
# List available scaffold templatesatmos scaffold list# Generate a new project from a templateatmos scaffold generate example ./my-project# Generate with a pinned component versionatmos scaffold generate example ./my-project --set project_name=my-app --set enable_vendoring=true --set vendor_version=1.536.0# Skip vendoring entirely — vendor_version is never asked and vendor.yaml is never generatedatmos scaffold generate example ./my-project --set enable_vendoring=false
Key Files
| File | Purpose |
|---|---|
scaffold.yaml | Template configuration with prompts, conditional when: rules, and metadata |
atmos.yaml | Template for generated Atmos configuration |
vendor.yaml | Conditionally-generated vendor manifest (only when enable_vendoring: true) |
Learn More: Generation Hooks
Templates can also declare hooks that run automatically before or after
generation — for example, formatting generated files or running a linter.
Hooks reuse the same when: condition engine as Atmos workflows and CI
hooks, and support --skip-hooks to opt out per invocation. This example
doesn't wire one up, but the syntax looks like:
hooks:format:events:- after.scaffold.generatekind: steptype: shellwith:command: "terraform fmt"
Creating Custom Templates
Scaffold templates use Go templates with access to:
.Config- Values from prompts and--varsflags- Sprig functions for string manipulation
- Gomplate functions for advanced templating
See the Scaffold Templates Guide for more details.