duck-template-0.1.1 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
- โ๏ธ Powerful
initandcreatecommands - ๐ฆ JSON-based configuration support
- ๐ชถ Written in Rust โ lightweight and blazing fast
- ๐ฌ Helpful logging and error messages
๐ฆ Installation
๐ Usage
Initialize a new project
This will:
- Read your
duck-template.jsonconfig - Create a new output folder with the structure defined in the template
- Inject any CLI-provided values (e.g.
--name) into the template
Create a variant from your config
This will:
- Select a template variant defined in your config file
- Generate the corresponding output structure
๐งฉ Configuration
The CLI expects a JSON config file like this:
You can define:
variants: groups of files or foldersoutdir: where the output should be createdtemplate: reuse external files and inject dynamic variables
๐งช Example
// duck-template.json
Results in:
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 |
Shows the help menu |
version |
Prints the CLI version |
๐ License
Licensed under either of:
- MIT License
- Apache License, Version 2.0
๐ฌ Feedback / Contributions
Feel free to open issues, request features, or contribute via pull requests.
๐ฆ duck-template โ because smart devs don't start from scratch every time.