Skip to content

Getting Started

The quickest way to install diecut:

Terminal window
curl -fsSL https://raw.githubusercontent.com/raiderrobert/diecut/main/install.sh | sh

This auto-detects your OS and architecture, downloads the right binary, and installs to /usr/local/bin. Set DIECUT_INSTALL_DIR to change the install location.

You can also download a binary manually from GitHub Releases, or build from source with Cargo:

Terminal window
cargo install --path crates/diecut-cli

Generate a project from a local template:

Terminal window
diecut new ./my-template --output my-project

Generate from a GitHub repository:

Terminal window
diecut new gh:user/template-repo --output my-project

Use defaults without interactive prompts:

Terminal window
diecut new gh:user/template-repo --defaults --output my-project

Override specific variables from the command line:

Terminal window
diecut new ./my-template -d project_name=foo -d license=MIT

diecut can pull templates from local paths or any Git host:

SourceExample
Local pathdiecut new ./my-template
GitHubdiecut new gh:user/repo
GitLabdiecut new gl:user/repo
Bitbucketdiecut new bb:user/repo
Sourcehutdiecut new sr:user/repo
Any Git URLdiecut new https://git.example.com/repo.git

Git templates are cached locally at ~/.cache/diecut/templates/. You can override this with the DIECUT_CACHE_DIR environment variable.

diecut auto-detects cookiecutter templates and generates from them directly:

Terminal window
diecut new gh:audreyfeldroy/cookiecutter-pypackage --output my-package

The cookiecutter.json format is translated on the fly. For a permanent conversion, use diecut migrate.