{"id":40003980,"url":"https://github.com/navrocky/muenvsubst","last_synced_at":"2026-01-19T02:03:36.775Z","repository":{"id":222508235,"uuid":"757471872","full_name":"navrocky/muenvsubst","owner":"navrocky","description":"Substitutes environment variables like envsubst do but with powerful template engine","archived":false,"fork":false,"pushed_at":"2025-04-22T12:35:19.000Z","size":67,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T13:40:51.314Z","etag":null,"topics":["cplusplus","envsubst","inja","jinja","templating"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/navrocky.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-02-14T15:07:57.000Z","updated_at":"2025-04-22T12:35:23.000Z","dependencies_parsed_at":"2025-02-11T12:21:45.374Z","dependency_job_id":"d59c7626-7a98-4977-a45c-f9aaf187717e","html_url":"https://github.com/navrocky/muenvsubst","commit_stats":null,"previous_names":["navrocky/muenvsubst"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/navrocky/muenvsubst","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navrocky%2Fmuenvsubst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navrocky%2Fmuenvsubst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navrocky%2Fmuenvsubst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navrocky%2Fmuenvsubst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/navrocky","download_url":"https://codeload.github.com/navrocky/muenvsubst/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/navrocky%2Fmuenvsubst/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28557784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T00:46:33.223Z","status":"online","status_checked_at":"2026-01-19T02:00:08.049Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","envsubst","inja","jinja","templating"],"created_at":"2026-01-19T02:03:24.304Z","updated_at":"2026-01-19T02:03:36.756Z","avatar_url":"https://github.com/navrocky.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MuEnvSubst\n\nSubstitutes environment variables using one of the templating engines, as \n[envsubst](https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html) does, but using a powerfull templating engine. \n\nThis is a list of supported template engines:\n\n- `inja` - [Inja templates](https://pantor.github.io/inja/)\n\nOne of the advantages of this utility is that it is built very small static binary without any dependencies.\nArchitecture of binary is Linux x86 (32 bit). It can be run in any Linux x86 and x86_64, both new and very old versions.\n\n## Installation\n\nDownload and copy binary to any destination specified in `PATH` (~/bin, /usr/local/bin, /usr/bin). \nDo not forget to set execution flag on binary with `chmod`.\n\n```sh\nsudo curl https://github.com/navrocky/muenvsubst/releases/download/1.5.0/muenvsubst -Lo /usr/local/bin/muenvsubst\nsudo chmod +x /usr/local/bin/muenvsubst\n```\n\n## Usage\n\n```\nSubstitutes environment variables using Inja templating engine, as envsubst \ndoes. \n\nUSAGE: ./muenvsubst [ -h, --help \u003carg\u003e ] [ -i, --in \u003carg\u003e ] [ -d, \n       --include-dir \u003carg\u003e ] [ -o, --out \u003carg\u003e ] [ -v, --version ] \n\nOPTIONAL:\n -h, --help \u003carg\u003e        Print this help. \n\n -i, --in \u003carg\u003e          Input file \n\n -d, --include-dir \u003carg\u003e The directory where the included files are searched \n                         for. This argument can be specified more than once. \n\n -o, --out \u003carg\u003e         Output file \n\n -v, --version           Output version information and exit \n```\n\n## Inja syntax\n\n[Inja](https://pantor.github.io/inja/) inspired by Python's Jinja and supports subset of original Jinja syntax. \n\nInja syntax documented [here](https://pantor.github.io/inja/) and original Jinja syntax documented \n[here](https://jinja.palletsprojects.com/en/stable/templates/).\n\nAlso supported function [pipe](https://jinja.palletsprojects.com/en/stable/templates/#filters) calling syntax. \nThese are equal expressions:\n\n```\n{{ split(\"A,B,C\", \",\") }}\n{{ \"A,B,C\" | split(\",\") }}\n\n{{ sh(\"198c126c-2691-463f-9708-1ee485ce4d68\", \"sed 's/-//g'\") }}\n{{ \"198c126c-2691-463f-9708-1ee485ce4d68\" | sh(\"sed 's/-//g'\") }}\n```\n\n## Additional Inja functions\n\n- [error](functions.md#error) - throws an error\n- [fromBase64](functions.md#fromBase64) - decode base64 string\n- [fromJson](functions.md#fromJson) - parse JSON string to object\n- [sh](functions.md#sh) - execute shell script\n- [split](functions.md#split) - splits text by delimiter\n- [toBase64](functions.md#toBase64) - encode base64 string\n- [toBool](functions.md#toBool) - convert any value to boolean\n- [toJson](functions.md#toJson) - serialize value to JSON string\n- [trim](functions.md#trim) - trims text\n\n## More Inja examples\n\n### Simple variable substitution\n\n```sh\necho \"Hello, {{ USER }}!\" | muenvsubst\n```\n\nthen output will be: \n\n```\nHello, John!\n```\n\n### Using variable and function\n\n```sh\nmuenvsubst \u003c\u003cEOF\n{%- set username = upper(USER) -%}\nHello, {{ username }}!\nEOF\n```\n\nthen output will be: \n\n```\nHello, JOHN!\n```\n  \n### Render conditional block\n\n```sh\nUSE_GREETER=no USE_GOODBYER=yes muenvsubst \u003c\u003c EOF\n## if USE_GREETER==\"yes\"\nHello, {{ USER }}!\n## endif\n## if USE_GOODBYER==\"yes\"\nGoodbye, {{ USER }}!\n## endif\nEOF\n```\n\nthen output will be: \n\n```\nGoodbye, John!\n```\n\n### Safe check of a boolean variable\n\n```sh\nmuenvsubst \u003c\u003c EOF\n## if default(USE_GREETER, null) | toBool\nHello, {{ USER }}!\n## endif\nEOF\n```\n\n### Using split and loop\n  \n```sh\nUSERS=\"John,Mark,Peter\" muenvsubst \u003c\u003c EOF\n{%- for user in split(USERS,\",\") -%}\nHello, {{ user }}!\n{%- endfor -%}\nEOF\n```\n\nthen output will be: \n\n```\nHello, John!\nHello, Mark!\nHello, Peter!\n```\n\n### Includes\n\nContent of `greeter.j2` file:\n```\nHello, {{ USER }}!\n```\n\nRender template:\n\n```sh\nmuenvsubst \u003c\u003c EOF\n## include \"greeter.j2\"\nEOF\n```\n\nthen output will be: \n\n```\nHello, John!\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavrocky%2Fmuenvsubst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnavrocky%2Fmuenvsubst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnavrocky%2Fmuenvsubst/lists"}