Skip to content

gentleeduck/duck-template

duck-template

duck-template

Fast, JSON-driven Rust scaffolder for projects, files, and variants.

MIT - Changelog - Contributing - crates.io - docs.rs

crates.io docs.rs MIT


Install

cargo install duck-template

Quick start

duck-template init
duck-template create my-app --variant cli
duck-template create-variant web

The generator reads a template descriptor (local file or remote URL) and emits the project tree from JSON. Flags are injected dynamically into template placeholders.

Commands

Command What
duck-template init interactive setup
duck-template create <name> [--variant] generate from current template
duck-template create-variant <name> add a variant under the template

Schema

A template is a JSON file with this shape:

{
  "name": "my-template",
  "variants": {
    "cli":  { "files": [ ] },
    "web":  { "files": [ ] }
  },
  "flags": { "name": "string", "rust_version": "string" }
}

See public/schema.json for the full schema.

Build

git clone https://github.com/gentleeduck/duck-template
cd duck-template
cargo build --release
./target/release/duck-template --help

Docs

Contributing

PR checklist + style notes in CONTRIBUTING.md. Security: SECURITY.md. Behaviour: CODE_OF_CONDUCT.md.

License

MIT. See LICENSE.

About

duck-template lets you define reusable project templates in JSON and generate boilerplate code with ease using a simple, flexible command-line interface.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors