Skip to content

kenjones-cisco/dinamo

Repository files navigation

Dynamic Generator

Lightweight command-line utility for generating file(s) from using go templates.

Status

GoDoc GoCard Coverage Status Build Status Maintainability MIT License

Install

  • Download pre-built binaries using Published Releases.

  • Alternatively install using go install:

go install github.com/kenjones-cisco/dinamo/cmd/dinamo@latest

Features

  • Generate file(s) using a template
  • Supports multiple data sources, key-value arguments, environment variables, YAML files, and JSON files
  • Supports sprig template functions

Usage

See detailed Usage

# create output.txt from config.tmpl using the key-value pairs
dinamo gen -t config.tmpl -f output.txt key1=value1 key2=value2

# create output.txt from config.tmpl using the JSON data file source.json
dinamo gen -t config.tmpl -f output.txt -d source.json

# create output.txt from config.tmpl using the YAML data file source.yaml
dinamo gen -t config.tmpl -f output.txt -d source.yaml

# create output.txt from config.tmpl using environment variables
dinamo gen -t config.tmpl -f output.txt -e

# create output.txt from config.tmpl using the key-value pairs and the YAML data file source.yml
dinamo gen -t config.tmpl -f output.txt -d source.yml key1=value1 key2=value2

# create output.txt from config.tmpl using the key-value pairs and the JSON data file source.json
dinamo gen -t config.tmpl -f output.txt -d source.json key1=value1 key2=value2

# create output.txt from config.tmpl using the key-value pairs and environment variables
dinamo gen -t config.tmpl -f output.txt -e key1=value1 key2=value2

# create output.txt from config.tmpl using the key-value pairs, environment variables, and the YAML data file source.yml
dinamo gen -t config.tmpl -f output.txt -e -d source.yml key1=value1 key2=value2

Contributions

Contributing guidelines are in CONTRIBUTING.md.