duck-template-0.1.2 is not a library.
π¦ duck-template
A fast, customizable CLI tool for scaffolding project templates from structured JSON configurations.
duck-template lets you define reusable project templates in JSON and generate boilerplate code with ease using a simple, flexible command-line interface.
β¨ Features
- π§± Template-based project scaffolding
- βοΈ Flexible
initandcreatecommands - π§ Unified flag parsing via
get_flag_value - π¦ JSON-driven configuration system
- πͺΆ Written in Rust β lightweight and blazing fast
- π¬ Helpful logs and friendly error messages
π¦ Installation
π Usage
π§ Initialize a new project
This will:
- Create a new folder using your template
- Inject values like
--nameinto templated files - Use your local or default
duck-template.json
ποΈ Create a variant
This will:
- Pick a variant defined in your JSON config
- Generate all related files and folders into the specified
outdir
π§© Configuration
The CLI expects a duck-template.json config file like:
Key fields:
variants: List of available build targetsoutdir: Target directory for outputtemplate: File injection with variable placeholders ({{name}})
π§ͺ Example
Given this config:
Youβll get:
output/
βββ src/
βββ main.ts // console.log("wiseman is wise");
π οΈ Commands
| Command | Description |
|---|---|
init |
Initializes a new template project |
create |
Generates output from a defined variant |
--help |
Displays help information |
--version |
Prints the current version |
π License
Licensed under either:
- MIT License
- Apache License, Version 2.0
π¬ Feedback / Contributions
Feel free to open issues, request features, or submit a pull request.
π¦ duck-template β because smart devs donβt start from scratch.