Skip to main content

Duck Template

Rust-powered project scaffolder. JSON-driven templates with variants, remote configs, and flag injection.

Rust · CLI

Scaffold projects the way your team actually writes them

Define a JSON template, commit it with your code, reuse it across every new project. Variants handle differences between api, web, and cli shapes without forking.

JSON-driven

A single `duck-template.json` drives the whole scaffold — files, variables, conditional blocks, variants.

Variants

One template, many layouts. Call `create-variant` to package a directory as a reusable variant (api, web, cli).

Remote configs

Templates can live in a git repo or any URL. Point duck-template at a link and it fetches + renders.

CLI subcommands

`init`, `create`, `create-variant`. Each has its own flags; all plug into the shared template engine.

Flag injection

Arbitrary CLI flags are parsed once and forwarded into template context. Define `{{project_name}}` and pass `--project_name`.

Rust binary

Single statically linked binary. No Node runtime. `cargo install duck-template` and you are done.

Quick setup

Install via cargo. Run `init`. Commit your template.

# Install
cargo install duck-template

# New project
duck-template init --name my-app

# From a variant
duck-template create --variant api --name my-api

Free & open source

gentleduck is MIT licensed and will always be free and open source. Every package ships with full source access — fork it, modify it, own it.

Become a Sponsor