genify
Turn one file into a complete project
The main idea is to have a single source file that can be used to generate or update a full project structure quickly and consistently using different configuration files.
There are two modes:
- CLI interactive mode – for manual use and quick input.
- Code mode – for automated and configurable project generation.
Features:
- Create files from templates based on config.
- Replace content using regular expressions.
- Append or prepend content to existing files.
- Easily update multiple projects using shared configs.
Installation
Cargo
- Install the rust toolchain in order to have cargo installed by following this guide.
- run
cargo install genify --features cli
Get Started
CLI
Turn one file into a complete project
Usage: genify [OPTIONS] <PATH>
Arguments:
<PATH> Path to a config file or http(s) URL
Options:
-n, --no-interaction Do not ask any interactive question
-h, --help Print help
-V, --version Print version
example.toml
[]
= "value"
= "tmp"
= "val"
= "{{ val }}"
= "1"
[[]]
= "file"
= "{{ dir }}/some.txt" # if the file exists will be error
= "{{ val }} {{ value }} {{ other | pascal_case }} {{ override }} - should be replaced"
[[]]
= "replace"
= "{{ dir }}/some.txt"
= "should.*replaced"
= "replaced {{ value }}"
[[]]
= "prepend"
= "{{ dir }}/some.txt"
= "prepend {{ value }}"
[[]]
= "append"
= "{{ dir }}/some.txt"
= "append {{ value }}"
genify example.toml
tmp/some.txt
prepend value
val value Val 1 - replaced value
append value
Supported Variable Types
| Type | Description | CLI Interactive Support |
|---|---|---|
| String | Text value | ✅ Supported |
| Integer | Whole number | ✅ Supported |
| Float | Decimal number | ✅ Supported |
| Boolean | true or false | ✅ Supported |
| Array | List of values | ❌ Not supported |
| Map | Key-value pairs | ❌ Not supported |
Note: In interactive CLI mode, all types are supported except Array and Map, will be used default values.
Code