Getting Started
Installation
Section titled “Installation”The quickest way to install diecut:
curl -fsSL https://raw.githubusercontent.com/raiderrobert/diecut/main/install.sh | shThis 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:
cargo install --path crates/diecut-cliQuick start
Section titled “Quick start”Generate a project from a local template:
diecut new ./my-template --output my-projectGenerate from a GitHub repository:
diecut new gh:user/template-repo --output my-projectUse defaults without interactive prompts:
diecut new gh:user/template-repo --defaults --output my-projectOverride specific variables from the command line:
diecut new ./my-template -d project_name=foo -d license=MITTemplate sources
Section titled “Template sources”diecut can pull templates from local paths or any Git host:
| Source | Example |
|---|---|
| Local path | diecut new ./my-template |
| GitHub | diecut new gh:user/repo |
| GitLab | diecut new gl:user/repo |
| Bitbucket | diecut new bb:user/repo |
| Sourcehut | diecut new sr:user/repo |
| Any Git URL | diecut 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.
Cookiecutter compatibility
Section titled “Cookiecutter compatibility”diecut auto-detects cookiecutter templates and generates from them directly:
diecut new gh:audreyfeldroy/cookiecutter-pypackage --output my-packageThe cookiecutter.json format is translated on the fly. For a permanent conversion, use diecut migrate.