Skip to content

Getting Started

The quickest way:

Terminal window
curl -fsSL https://diecut.dev/install.sh | sh

Auto-detects your OS and architecture. Set DIECUT_INSTALL_DIR to change the install location.

Build from source:

Terminal window
cargo install --path .

Or grab a binary from GitHub Releases.

Use one of the starter templates:

Terminal window
diecut new gh:raiderrobert/diecut-templates/rust-cli -o my-cli

diecut reads the template config and prompts you for variables:

Project name [my-cli]: my-cli
Author name: Jane Doe
License [MIT]:
1. MIT
2. Apache-2.0
3. MIT OR Apache-2.0

Press Enter to accept the defaults. Once done, you get a ready-to-build project:

my-cli/
Cargo.toml
src/
main.rs
.gitignore
README.md
.diecut-answers.toml

The generated Cargo.toml has your variables applied:

[package]
name = "my-cli"
version = "0.1.0"
edition = "2021"
authors = ["Jane Doe"]
license = "MIT"

diecut cloned the template repo, navigated to the rust-cli subdirectory, read the diecut.toml config, prompted you for variables, and rendered every .die file through the Tera template engine. The .die suffix was stripped from output filenames. Files without .die were copied as-is. Your answers were saved to .diecut-answers.toml.