Quickstart

Create a starter template and scaffold a project from it in two commands.

This page walks through the smallest possible loop: generate a starter template, then scaffold a project from it.

1. Generate a starter template

terox create demo --path ./templates

This creates ./templates/demo/ with a real terox.json manifest and a {{.project_name}}/ directory containing an example README.md and .gitignore. The directory name is itself a Go template expression — Terox will render it when you scaffold from it.

Have a look at the manifest:

terox.json
{
  "name": "Example Template",
  "description": "A starter template generated by terox create",
  "variables": [
    {
      "name": "project_name",
      "prompt": "Project name",
      "default": "my-project"
    },
    { "name": "author", "prompt": "Author", "default": "" },
    {
      "name": "license",
      "prompt": "License",
      "default": "MIT",
      "choices": ["MIT", "Apache-2.0", "GPL-3.0", "None"]
    }
  ]
}

2. Scaffold a project from it

Interactive mode — Terox prompts you for each variable:

terox scaffold ./templates/demo --output ./my-project

Non-interactive mode — provide answers up-front:

terox scaffold ./templates/demo \
  --output ./my-project \
  --set project_name=portfolio \
  --set author="Sagar Kapoor" \
  --set license=MIT \
  --non-interactive

Either way, you end up with:

my-project/
└── portfolio/
    ├── README.md
    └── .gitignore

The README.md has had {{.project_name}}, {{.author}} and {{.license}} substituted with your answers; the directory name portfolio came from rendering {{.project_name}}.

3. Try it with a GitHub repository

Any public GitHub repository works as a template:

terox scaffold weburz/simple-website-template --output ./my-site

If the repository has a terox.json you will be prompted for its variables. If it does not, Terox simply copies the files as-is — a quick way to grab a clean snapshot of any repo without its git history.

Where to next