Custom Templates
Extend Burner with your own project templates using any scripting language.
Template Requirements
- Scripts can be written in any language (bash, PowerShell, Python, etc.)
- Must be executable from the command line
- Script filename becomes the template alias (e.g.,
react.ps1→react) - Supported extensions:
.ps1,.sh,.py,.bat,.cmd,.exe
Template Location
Place template scripts in the templates directory:
# Default location
~/.burner/templates/
# Open in file explorer
burner config --open-templates
Environment Variables
Burner sets these environment variables before running your template:
| Variable | Description | Example |
|---|---|---|
BURNER_NAME |
User-provided project name | my-experiment |
BURNER_PATH |
Full path to project directory | ~/.burner/projects/260115-my-experiment |
BURNER_DATED_NAME |
Dated folder name | 260115-my-experiment |
The working directory is automatically set to BURNER_PATH.
Interactive Templates
Some templates (like Vite-based ones) require user input. Add a marker comment in the first 10 lines:
# BURNER_INTERACTIVE
This automatically enables interactive mode when using the template.
Example Templates
PowerShell - React with Vite
#!/usr/bin/env pwsh
# react.ps1 - Creates a React app using Vite
Set-Location $env:BURNER_PATH
echo "y" | npm create vite@latest $env:BURNER_DATED_NAME -y -- --template react --no-rolldown
Set-Location $env:BURNER_DATED_NAME
npm install
PowerShell - Svelte (Interactive)
#!/usr/bin/env pwsh
# BURNER_INTERACTIVE
# svelte.ps1 - Creates a Svelte app
Set-Location $env:BURNER_PATH
npm create vite@latest . -- --template svelte-ts
npm install
npm pkg set name=$env:BURNER_NAME
Bash - React
#!/bin/bash
# Creates a React app using Vite
set -e
npm create vite@latest . -- --template react
npm install
Python - Simple Project
#!/usr/bin/env python3
import os
name = os.environ['BURNER_NAME']
with open('main.py', 'w') as f:
f.write(f'# {name}\nprint("Hello from {name}!")\n')
with open('requirements.txt', 'w') as f:
f.write('')
PowerShell - .NET with Extra Setup
#!/usr/bin/env pwsh
# dotnet-api.ps1 - Creates a .NET Web API project
dotnet new webapi -o .
dotnet add package Swashbuckle.AspNetCore
dotnet restore
Tips
- Use
$env:BURNER_PATH(PowerShell) or$BURNER_PATH(Bash) for the project path - The script's exit code determines success (0) or failure (non-zero)
- Test templates manually before adding to Burner
- Use
burner templatesto verify your template is detected