Skip to content

Getting Started

The quickest way:

Terminal window
curl -fsSL https://raw.githubusercontent.com/raiderrobert/diecut/main/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 crates/diecut-cli

Or grab a binary from GitHub Releases.

Use the built-in rust-cli example template:

Terminal window
diecut new ./examples/rust-cli -o my-cli

diecut reads the template config and prompts you for five variables:

Project name [my-cli]: my-cli
Short description [A command-line application]:
Author name: Jane Doe
License [MIT]: MIT
1. MIT
2. Apache-2.0
3. MIT OR Apache-2.0
Rust edition [2021]: 2021
1. 2021
2. 2024

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

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

The generated Cargo.toml has your variables applied:

[package]
name = "my-cli"
version = "0.1.0"
edition = "2021"
description = "A command-line application"
authors = ["Jane Doe"]
license = "MIT"

diecut read the diecut.toml config, prompted you for variables, and rendered every .tera file through the Tera template engine. The .tera suffix was stripped from output filenames. Files without .tera were copied as-is. Your answers were saved to .diecut-answers.toml for future updates.