CLI reference

Every Terox command and flag.

This page lists every subcommand Terox ships with. Run terox <command> --help at any time for the same information from the binary itself.

terox scaffold

Render a template into an output directory.

terox scaffold <owner/repo|path> [flags]

Arguments

NameDescription
<owner/repo|path>Either a public GitHub repository (owner/repo) or a local directory containing a template.

Flags

FlagDefaultDescription
-o, --output.Directory to write the rendered project into.
--set key=valuePre-set a variable value. Repeatable.
--non-interactivefalseDo not prompt. Every variable must have a --set value or a default.
--refreshfalseRe-download a remote template, ignoring the local cache. No effect on local paths.

Examples

# Interactive, from a local template
terox scaffold ./templates/demo --output ./my-project

# Non-interactive, from a GitHub repository
terox scaffold weburz/simple-website-template \
  --output ./my-site \
  --set project_name=portfolio \
  --set author="Sagar Kapoor" \
  --non-interactive

Exit codes

CodeMeaning
0Scaffolded successfully.
1Any error: bad template ref, missing required variable, etc.

terox create

Create a starter template directory you can edit and publish.

terox create <template-name> [flags]

Arguments

NameDescription
<template-name>Folder name for the new template.

Flags

FlagDefaultDescription
--path.Parent directory in which to create the template folder.

Example

terox create demo --path ./templates

The generated folder contains:

  • terox.json with three example variables (project_name, author, license)
  • {{.project_name}}/README.md showing variable usage
  • {{.project_name}}/.gitignore

terox list

List templates that Terox has cached locally.

terox list

Templates are cached under $XDG_DATA_HOME/terox/ (typically ~/.local/share/terox/) the first time you scaffold from a remote source.

terox clean

Delete every locally cached template.

terox clean

The next remote scaffold will re-download the template from GitHub.

terox version

Print the build version, commit, build date and Go toolchain version.

terox version

Global help

Any subcommand accepts --help for the flag list.

terox --help
terox scaffold --help