Skip to content

Commands

Generate a new project from a template.

Terminal window
diecut new <TEMPLATE> [OPTIONS]
OptionDefaultDescription
<TEMPLATE>Template source: local path, gh:user/repo, gl:user/repo, bb:user/repo, sr:user/repo, or any Git URL
-o, --output <PATH>Output directory
-d, --data <KEY=VALUE>Override variable values (repeatable)
--defaultsfalseUse default values without prompting
--overwritefalseOverwrite output directory if it exists
--no-hooksfalseSkip running hooks
Terminal window
# From a local template
diecut new ./my-template --output my-project
# From a GitHub shorthand
diecut new gh:user/template-repo --output my-project
# Use defaults without prompting
diecut new gh:user/repo --defaults --output my-project
# Override specific variables
diecut new ./my-template -d project_name=foo -d license=MIT
  • Git-hosted templates are cloned and cached locally on first use.
  • The --data flag can be repeated to set multiple variables.
  • When --defaults is set, any variable without a default value causes an error.

List cached templates.

Terminal window
diecut list

None.

Terminal window
diecut list
  • Templates are cached at ~/.cache/diecut/templates/. Override with the DIECUT_CACHE_DIR environment variable.

Update a previously generated project from its template.

Terminal window
diecut update [PATH] [OPTIONS]
OptionDefaultDescription
[PATH].Path to the project
--ref <REF>latestGit ref (branch, tag, commit) to update to
Terminal window
# Update the project in the current directory
diecut update
# Update a project at a specific path
diecut update ./my-project
# Pin the update to a tag
diecut update ./my-project --ref v2.0.0
  • Requires a .diecut-answers.toml file in the project directory. This file is written during diecut new and records the template source and variable values.

Validate a template directory.

Terminal window
diecut check [PATH]
OptionDefaultDescription
[PATH].Path to the template
Terminal window
diecut check ./my-template
  • Exits with code 1 if errors are found.
  • Reports format detection, variable definitions, and any warnings.

Check if a template is ready for distribution.

Terminal window
diecut ready [PATH]
OptionDefaultDescription
[PATH].Path to the template
Terminal window
diecut ready ./my-template
  • Stricter than check. Includes additional distribution-specific validations.
  • Exits with code 1 if issues are found.

Convert a cookiecutter template to native diecut format.

Terminal window
diecut migrate <PATH> [OPTIONS]
OptionDefaultDescription
<PATH>Path to the cookiecutter template
-o, --output <DIR>Write to a new directory instead of migrating in-place
--dry-runfalseShow planned changes without writing
Terminal window
# Preview what would change
diecut migrate ./cookiecutter-template --dry-run
# Migrate to a new directory
diecut migrate ./cookiecutter-template --output ./diecut-template
# Migrate in-place
diecut migrate ./cookiecutter-template
  • Use --dry-run first to review planned changes before writing.
  • Without --output, the template is converted in-place.