go-easygen
easygen
Go

Easy to use universal code/text generator

Last updated Feb 3, 2026
67
Stars
9
Forks
9
Issues
0
Stars/day
Attention Score
21
Language breakdown
Go 95.4%
HTML 3.8%
Shell 0.8%
โ–ธ Files click to expand
README

easygen

All Contributors

MIT License GoDoc Go Report Card Build Status PoweredBy WireFrame

The easy to use universal code/text generator

easygen is to json what xslt is to xml, but much more powerful and versatile.
easygen has been such a great help to us, making so many mundane tasks easier (and fun) to do.

TOC

- $ easygen - The binary executables - Distro package - Debian package

easygen - Easy to use universal code/text generator

Command easygen is an easy to use universal code/text generator.

It can be used as a text or html generator for arbitrary purposes with arbitrary data and templates. It is a good GSL replacement, as it

- is more easy to define driving data, in form of YML instead of XML - has more powerful template engine that based on Go template. You can also write your own function in Go to customize your template. - there are lots of transformation support functions builtin inside it, check out the full list with sample usages and results here. - apart from the above sample usages, it has extensive documentations like this. Check out the wiki for the full list.

You can even use easygen as a generic Go template testing tool using the -ts commandline option, and much more.

Note this document is for easygen versions 4.0+. For historic versions check out the Different Versions section.

Usage

$ easygen

easygen version 5.3.0

Usage: easygen [flags] templatename [datafilename [data_filename...]]

Flags:

-debug level debugging level -ej extension extension of json file (default ".json") -et extension extension of template file (default ".tmpl") -ey extension extension of yaml file (default ".yaml") -ts string template string (in text)

template_name: The name for the template file. - Can have the extension (specified by -et) or without it. - Can include the path as well. - Can be a comma-separated list giving many template files, in which case at least one data_filename must be given.

data_filename(s): The name for the .yaml or .json data. - If omitted derive from the template_name. - Can have the extension or without it. If withot extension, will try the .yaml file first then .json - Can include the path as well. - Can have more than one data files given on cli, separated by spaces, in which case multiple outputs will be produced based on the inputs. - Can be a comma-separated list giving many data files, in which case data will be merged together as if provided from a single file. - If there is a single data_filename, and it is "-", then read the data (.yaml or .json format) from stdin.

Flag defaults can be overridden by corresponding environment variable, e.g.: EASYGENEY=.yml EASYGENET=.tpl easygen ...

Details

It can be used as a code generator, for example, command line parameter handling code generator, or anything that is structurally repetitive, like the following:

Ready to get started? Then check out Getting Started to start building your way to turn your data into any form, any way you want.

Install Debian/Ubuntu package

sudo apt install -y easygen

Download/install binaries

  • The latest binary executables are available
as the result of the Continuous-Integration (CI) process.
  • I.e., they are built automatically right from the source code at every git release by GitHub Actions.
  • There are two ways to get/install such binary executables
* Using the binary executables directly, or * Using packages for your distro

The binary executables

  • The latest binary executables are directly available under
https://github.com/go-easygen/easygen/releases/latest
  • Pick & choose the one that suits your OS and its architecture. E.g., for Linux, it would be the easygenverxxlinux_amd64.tar.gz file.
  • Available OS for binary executables are
* Linux * Mac OS (darwin) * Windows
  • If your OS and its architecture is not available in the download list, please let me know and I'll add it.
  • The manual installation is just to unpack it and move/copy the binary executable to somewhere in PATH. For example,
sh
tar -xvf easygen*linux_amd64.tar.gz
sudo mv -v easygen*linux_amd64/easygen /usr/local/bin/
rmdir -v easygen*linux_amd64

Distro package

* Alpine Linux * Debian * RedHat

The repo setup instruction url has been given above. For example, for Debian --

Debian package

curl -1sLf \
  'https://dl.cloudsmith.io/public/suntong/repo/setup.deb.sh' \
  | sudo -E bash

That's it. You then can do your normal operations, like

sudo apt update apt-cache policy easygen

sudo apt install -y easygen

Install Source

To install the source code instead:

go install github.com/go-easygen/easygen@latest

Author

Tong SUN suntong from cpan.org

Powered by WireFrame PoweredBy WireFrame the one-stop wire-framing solution for Go cli based projects, from init to deploy.

Contributors โœจ

Thanks goes to these wonderful people (emoji key):


suntong

๐Ÿ’ป ๐Ÿค” ๐ŸŽจ ๐Ÿ”ฃ โš ๏ธ ๐Ÿ› ๐Ÿ“– ๐Ÿ“ ๐Ÿ’ก โœ… ๐Ÿ”ง ๐Ÿ“ฆ ๐Ÿ‘€ ๐Ÿ’ฌ ๐Ÿšง ๐Ÿš‡

Gerrit Renker

๐Ÿ’ป ๐Ÿค” ๐Ÿ› ๐Ÿ““ ๐Ÿ“ข ๐Ÿ–‹ ๐Ÿ“

Benjamin Ruston

๐Ÿ’ป ๐Ÿ› ๐Ÿ““

sanjaymsh

๐Ÿ“ฆ

Anthony Fok

๐Ÿ› ๐Ÿ‘€ ๐Ÿšง ๐Ÿ““

Deleted user

๐Ÿ› ๐Ÿค” ๐Ÿ““

Zbigniew Romanowski

๐Ÿ› ๐Ÿค” ๐Ÿ““

This project follows the all-contributors specification. Contributions of any kind welcome!

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท go-easygen/easygen ยท Updated daily from GitHub