Commands
diecut new
Section titled “diecut new”Generate a new project from a template.
Synopsis
Section titled “Synopsis”diecut new <TEMPLATE> [OPTIONS]Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
<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) |
--defaults | false | Use default values without prompting |
--overwrite | false | Overwrite output directory if it exists |
--no-hooks | false | Skip running hooks |
Examples
Section titled “Examples”# From a local templatediecut new ./my-template --output my-project
# From a GitHub shorthanddiecut new gh:user/template-repo --output my-project
# Use defaults without promptingdiecut new gh:user/repo --defaults --output my-project
# Override specific variablesdiecut new ./my-template -d project_name=foo -d license=MIT- Git-hosted templates are cloned and cached locally on first use.
- The
--dataflag can be repeated to set multiple variables. - When
--defaultsis set, any variable without a default value causes an error.
diecut list
Section titled “diecut list”List cached templates.
Synopsis
Section titled “Synopsis”diecut listOptions
Section titled “Options”None.
Examples
Section titled “Examples”diecut list- Templates are cached at
~/.cache/diecut/templates/. Override with theDIECUT_CACHE_DIRenvironment variable.
diecut update
Section titled “diecut update”Update a previously generated project from its template.
Synopsis
Section titled “Synopsis”diecut update [PATH] [OPTIONS]Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
[PATH] | . | Path to the project |
--ref <REF> | latest | Git ref (branch, tag, commit) to update to |
Examples
Section titled “Examples”# Update the project in the current directorydiecut update
# Update a project at a specific pathdiecut update ./my-project
# Pin the update to a tagdiecut update ./my-project --ref v2.0.0- Requires a
.diecut-answers.tomlfile in the project directory. This file is written duringdiecut newand records the template source and variable values.
diecut check
Section titled “diecut check”Validate a template directory.
Synopsis
Section titled “Synopsis”diecut check [PATH]Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
[PATH] | . | Path to the template |
Examples
Section titled “Examples”diecut check ./my-template- Exits with code 1 if errors are found.
- Reports format detection, variable definitions, and any warnings.
diecut ready
Section titled “diecut ready”Check if a template is ready for distribution.
Synopsis
Section titled “Synopsis”diecut ready [PATH]Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
[PATH] | . | Path to the template |
Examples
Section titled “Examples”diecut ready ./my-template- Stricter than
check. Includes additional distribution-specific validations. - Exits with code 1 if issues are found.
diecut migrate
Section titled “diecut migrate”Convert a cookiecutter template to native diecut format.
Synopsis
Section titled “Synopsis”diecut migrate <PATH> [OPTIONS]Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
<PATH> | — | Path to the cookiecutter template |
-o, --output <DIR> | — | Write to a new directory instead of migrating in-place |
--dry-run | false | Show planned changes without writing |
Examples
Section titled “Examples”# Preview what would changediecut migrate ./cookiecutter-template --dry-run
# Migrate to a new directorydiecut migrate ./cookiecutter-template --output ./diecut-template
# Migrate in-placediecut migrate ./cookiecutter-template- Use
--dry-runfirst to review planned changes before writing. - Without
--output, the template is converted in-place.