duck-template-0.1.8 is not a library.
π¦ duck-template
Fast, customizable Rust-powered project scaffolding β because smart devs donβt start from scratch.
duck-template helps you scaffold and manage projects using structured JSON configurations and flexible CLI commands. With variant support, remote configs, and dynamic flag injection, it gives you complete control over how projects and files are created.
β¨ Features
- π§± Template-based scaffolding using JSON
- ποΈ Variants for different project layouts (
api,web,cli, etc.) - π Local or remote configs (URL or file path)
- π§ Unified flag parsing with dynamic injection into templates
- β‘ Blazing fast β written in Rust
- π¦ Modular commands:
init,create, andcreate-variant
π¦ Installation
π Quick Start
π§ Initialize a New Project
This will:
- Create a directory
my-app/ - Inject the project name into template files
- Use your local
duck-template.json
ποΈ Create From a Variant
With a remote config:
With extra arguments:
β¨ Create a New Variant
This will:
- Package the folder into a new variant
- Append it to the config (if valid and writable)
π§© Configuration Format
Templates are defined in a duck-template.json file:
π οΈ Command Reference
init β Create a New Project Directory
| Flag | Description |
|---|---|
-n, --name |
Project name (used for folder name and inside templates). |
create β Generate Files from a Variant
| Flag | Description |
|---|---|
-v, --variant |
Name of the variant to generate |
-d, --outdir |
Output directory (defaults to ./) |
-c, --config |
Local or remote JSON config |
-a, --args |
Key=value overrides for template variables (author=Ahmed) |
create-variant β Package a Folder into a Variant
| Flag | Description |
|---|---|
-s, --source |
Source directory or file |
-n, --name |
Unique name for the variant |
-d, --description |
Short description of the variant |
-c, --config |
Optional path to an existing config to update |
π Output Example
Given:
With config:
Result:
output/
βββ src/
βββ main.ts // console.log("wiseman is wise");
π¬ Help & Version
Also works with subcommands:
π€ Contributions
Pull requests, issues, and suggestions are welcome! Fork, tweak, and share your own templates.
π¦ duck-template β smart scaffolding for smart developers.