CLI
lawn template
Scaffold, validate, and test app templates from the command line.
lawn template is not available in the public beta. The commands below describe planned functionality. Users taking part in our private alpha can use the standalone lawn-validate tool to validate and test templates today.The lawn template command group provides tools for template developers — scaffold new templates, validate them, and run end-to-end health check tests.
| Command | Description |
|---|---|
lawn template new | Scaffold a new template |
lawn template validate | Validate a template |
lawn template test | Test a template end-to-end |
lawn template new
Scaffold a new template with the required directory structure, a starter manifest, and a compose file.
lawn template new <template-id>
| Option | Description |
|---|---|
--name <name> | Display name for the app |
--category <category> | App category |
--image <image> | Container image to use |
# Scaffold a new template
lawn template new my-app
# Scaffold with details filled in
lawn template new my-app --name "My App" --category Utilities --image myapp/myapp:latest
This creates a directory with the standard template structure:
my-app/
├── manifest.yaml
├── icon.svg
└── lawn-compose/
└── v1.0.0.yaml
lawn template validate
Validate a template's manifest and compose files for Lawn-specific issues — missing fields, invalid icons, misconfigured health checks, and circular dependencies.
lawn template validate <path>
# Validate the current directory
lawn template validate .
# Validate a specific template directory
lawn template validate path/to/my-app
lawn template test
Test a template end-to-end. Pulls images, starts the app in an isolated environment with dynamic ports, runs all health checks, and cleans up.
lawn template test <path>
| Option | Description |
|---|---|
--timeout <seconds> | Timeout for the entire test (default: 300) |
--keep-instance | Keep the test instance after completion for debugging |
--var <assignment> | Variable value as NAME=VALUE (repeatable) |
# Test the template in the current directory
lawn template test .
# Test with a longer timeout
lawn template test . --timeout 600
# Supply required variables
lawn template test . --var ADMIN_PASSWORD=test123
# Keep the instance for manual inspection
lawn template test . --keep-instance
See the Testing guide for more on how template testing works.
Continue reading