duck-template 0.1.9

A cli tool for generating files from a template just with a json file
duck-template-0.1.9 is not a library.

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.

Features

feature what
JSON templates declarative project + file scaffold
Variants per-template layouts (cli, api, web, ...)
Local or remote configs path or URL
Dynamic flag injection flags become template vars
Modular commands init, create, create-variant

Commands

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 from source

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

Contributing

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

License

MIT. See LICENSE.