guidon-cli

guidon-cli is the tool using the guidon library to render project templates.
It's executable is named guic (as in guidon-cli...).

Features

Usage

```bash $ guic --help

Apply template to project structure

USAGE: guic [FLAGS] [OPTIONS]

FLAGS: --auto_proxy [git] If set to true, git tries to detect proxy configuration -g Git source : use this flag if the template is hosted in a git repo -h, --help Prints help information --review Review variables before rendering template. Not yet implemented. -k, --unsecure [git] If set to true, certificate validity is not checked -V, --version Prints version information -v Verbose mode (-v: logs, -vv: more logs, -vvv: logs... and logs...)

OPTIONS: -m, --mode Render mode. If lax, missing values are defaulted to an empty string, if strict an error is raised for a missing value, if strict_ask, user is prompted for missing values [default: strict]. strict_ask is currently not implemented. -p, --password [git] Password if a password or an access token is required to access a private repo -r, --rev [git option] Revision of the repository to use. Can be a tag (1.0), a branch (origin/my_branch) or a revision id. By default the value is set to master -u, --user [git] User if a user is required for accessing a private repo

ARGS: Path of the template directory, or URL of the repo if the git flag is provided. Output path for the target ```

Apply from local folder

bash $ guic /path/to/template /path/to/target

Apply from git repo

Simple use case

bash $ guic -g https://url.to.my/git/repo /path/to/target

Private repo

With self-signed certificate and access token.
bash $ guic -g -k -p access_token https://url.to.my/git/repo /path/to/target

Templates

A basic template structure is the following : a_folder/ parent folder |- template.toml configuration file (key / values) |- template/ folder containing templates files | - file1.txt.hbs a template file (hbs extension) | - file{{key1}} the {{key1}} part will be replaced | - dir1 | |- file2.txt.hbs a template file | |- file3.txt this file will be copied to destination | - {{dirkey}} this folder will be renamed | |- {{filekey}}.hbs this file will be renamed and rendered

And a file1.txt.hbs file like : This is a {{key2}}, but it could have been a {{key3}}.

With a template.toml file like the following : toml [variables] key1 = ".bak" key2 = "plop" key3 = "toto" dirkey = "THE/FOLDER" filekey = "my_file.ini" The output structure will be: target_folder/ |- file1.txt |- file.bak |- dir1/ | |- file2.txt | |- file3.txt |- THE/ |- FOLDER/ |- my_file.ini and the file1.txt content will be: This is a plop, but it could have been a toto.

 Installation

via Cargo

bash $ cargo install --force guidon-cli

Prebuilt binaries

TODO