A pure Bash implementation of Mustache templates for logic-less text generation in shell scripts.
Mo is a Mustache template engine implemented entirely in Bash, allowing shell scripts to generate dynamic text using logic-less templates. It solves the problem of embedding variable data into text files without complex scripting by leveraging the Mustache syntax and Bash's environment variables.
Shell script developers and DevOps engineers who need to generate configuration files, reports, or documentation dynamically within Bash environments.
Developers choose Mo for its zero external dependencies, seamless integration with Bash scripts, and adherence to Mustache standards, making it a lightweight and portable alternative to heavier templating tools.
Mustache templates in pure bash
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Implemented entirely in Bash with only coreutils, making it highly portable across Unix-like systems without installing additional packages, as emphasized in the requirements section.
Templates pull directly from environment variables or sourced files, allowing easy data injection from shell scripts and command outputs, demonstrated in the demo scripts.
Adds features like @key for loop indices and function arguments with flags, going beyond basic Mustache for more flexible templating, as shown in the enhancements section.
Can be installed globally or locally with a simple curl command, and sourced as a library in projects, with clear steps provided in the installation guide.
Only supports strings, numbers, and flat arrays; cannot handle nested objects or complex data, restricting template complexity, as admitted in the concessions about Bash's limitations.
Missing a key Mustache feature for web safety, as triple braces and ampersands don't escape HTML, posing risks for generating web content, noted in the failed specs.
Requires sourcing the script to use arrays, adding an extra step compared to simple variable substitution, which can be error-prone and is highlighted in the how-to examples.
Fails some official Mustache spec tests, such as for lambdas and dotted names, limiting interoperability with other Mustache tools, as detailed in the developing section.