# CLI Utility for Rendering Templates with TOML Args This is a CLI utility written in Rust that allows you to render templates using args specified in a TOML file. The tool uses the [clap](https://github.com/clap-rs/clap) and [handlebars](https://github.com/sunng87/handlebars-rust) libraries for command line argument parsing and template rendering respectively. ## Installation To use this tool, you need to have [Rust](https://www.rust-lang.org/) installed on your system. You can then install the tool using `cargo`, Rust's package manager. ```bash cargo install tompl ``` ## Usage ```bash tompl render --input ./path/to/config.toml --output ./out/rendered.txt ``` ## TOML File Format The TOML file should have the following format: ```toml template = "./path/to/template.txt" [params] param1 = "value1" nparam2 = "value2" user = "{{env.USER}}" ``` - `template`: The path to the template file that you want to render. - `params`: A table containing the arguments that you want to pass to the template. You can use the `env` parameter in the `params` table to access environment variables. ## Example Assuming that the `config.toml` file has the following contents: ```toml template = "./template.txt" [params] name = "John" age = 30 ``` And the `template.txt` file has the following contents: ```txt Hello, {{name}}! You are {{age}} years old. Environment variables: {{#each env}} - {{@key}}: {{this}} {{/each}} ``` The above command will render the template using the arguments specified in the TOML file and write the output to the `output.txt` file