{"id":17381705,"url":"https://github.com/TektonOps/subvars","last_synced_at":"2025-02-27T10:30:24.936Z","repository":{"id":48730671,"uuid":"383528614","full_name":"TektonOps/subvars","owner":"TektonOps","description":"Substitute  environment variables from command line for template driven configuration files.","archived":false,"fork":false,"pushed_at":"2023-12-24T00:58:27.000Z","size":617,"stargazers_count":21,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-07T03:48:40.629Z","etag":null,"topics":["cli","configuration","docker","environment-variables","golang","gotemplate","linux","macos","template","windows"],"latest_commit_sha":null,"homepage":"https://subvars.lmno.pk","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TektonOps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-07-06T16:12:01.000Z","updated_at":"2024-09-07T00:55:35.000Z","dependencies_parsed_at":"2023-12-21T09:51:19.025Z","dependency_job_id":null,"html_url":"https://github.com/TektonOps/subvars","commit_stats":null,"previous_names":["tektonops/subvars"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TektonOps%2Fsubvars","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TektonOps%2Fsubvars/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TektonOps%2Fsubvars/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TektonOps%2Fsubvars/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TektonOps","download_url":"https://codeload.github.com/TektonOps/subvars/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219842815,"owners_count":16556562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","configuration","docker","environment-variables","golang","gotemplate","linux","macos","template","windows"],"created_at":"2024-10-16T07:01:29.900Z","updated_at":"2024-10-16T07:04:40.953Z","avatar_url":"https://github.com/TektonOps.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003ch2 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003cp align=\"center\"\u003e\u003cimg width=30% src=\"https://raw.githubusercontent.com/kha7iq/subvars/master/.github/img/logo.png\"\u003e\u003c/p\u003e\n\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n   \u003ca href=\"https://github.com/kha7iq/subvars/releases\"\u003e\n   \u003cimg alt=\"Release\" src=\"https://img.shields.io/github/v/release/kha7iq/subvars\"\u003e\n   \u003ca href=\"https://goreportcard.com/report/github.com/kha7iq/subvars\"\u003e\n   \u003cimg alt=\"Go Report Card\" src=\"https://goreportcard.com/badge/github.com/kha7iq/subvars\"\u003e\n   \u003ca href=\"#\"\u003e\n   \u003cimg alt=\"Build\" src=\"https://img.shields.io/github/actions/workflow/status/kha7iq/subvars/.github%2Fworkflows%2Fbuild.yml\"\u003e\n   \u003ca href=\"https://github.com/kha7iq/subvars/issues\"\u003e\n   \u003cimg alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/kha7iq/subvars?style=flat-square\u0026logo=github\u0026logoColor=white\"\u003e\n   \u003ca href=\"https://github.com/kha7iq/subvars/blob/master/LICENSE.md\"\u003e\n   \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/kha7iq/subvars\"\u003e\n   \u003ca href=\"https://codecov.io/gh/kha7iq/subvars\"\u003e\n  \u003cimg src=\"https://codecov.io/gh/kha7iq/subvars/branch/master/graph/badge.svg\"/\u003e\n\u003c/a\u003e\n\n   \u003ca href=\"https://pkg.go.dev/github.com/kha7iq/subvars\"\u003e\n   \u003cimg alt=\"Go Dev Reference\" src=\"https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat\"\u003e\u003c/a\u003e\u003c/a\u003e\u003c/a\u003e\u003c/a\u003e\u003c/a\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://subvars.lmno.pk\"\u003eDocumentation\u003c/a\u003e •\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e •\n  \u003ca href=\"#configuration\"\u003eConfiguration\u003c/a\u003e •\n  \u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e •\n  \u003ca href=\"#show-your-support\"\u003eShow Your Support\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## About\nSubstitute Variables (subvars) is a small utility which provides a way to render any [Go templates](https://golang.org/pkg/text/template/) \nfrom command line recognizing the object being passed in and drawing attributes from the object to create wanted text. \nIt is very useful for template driven configuration files.\n\nIt uses [sprig v3](https://github.com/Masterminds/sprig) for [template functions](https://masterminds.github.io/sprig) \nwhich provides additional functions apart from standard library.\n\n`subvars` reads input from `stdin` and renders output to `stdout`. \nYou can pipe the input or `\u003c` direct it to subvars.\n\nOptions to [render all files](https://subvars.lmno.pk/03-usage-examples/) in a given folder\nand output to another folder preserving folder and file structure is available via `dir` subcommand.\n\n\n## Installation\n\n### MacOS \u0026 Linux Homebrew\n\n```bash\nbrew install kha7iq/tap/subvars\n```\n\n### Linux\n\n* AUR\n```bash\nyay -S subvars\n```\n\n* Binary\n```bash\nexport SUBVARS_VERSION=\"0.1.5\"\nwget -q https://github.com/kha7iq/subvars/releases/download/v${SUBVARS_VERSION}/subvars_Linux_x86_64.tar.gz \u0026\u0026 \\\ntar -xf subvars_Linux_x86_64.tar.gz \u0026\u0026 \\\nchmod +x subvars \u0026\u0026 \\\nsudo mv subvars /usr/local/bin/subvars\n```\n\n### Windows\n\n```powershell\nscoop bucket add subvars https://github.com/kha7iq/scoop-bucket.git\nscoop install subvars\n```\n\nAlternatively you can head over to [release pages](https://github.com/kha7iq/subvars/releases)\nand download the binary for windows \u0026 all other supported platforms.\n\n### Docker\n\nDocker container is available you can pull the `latest` version or provide specific `tag`\nCheckout [release](https://github.com/kha7iq/subvars/releases) page for available versions.\n\nRunning Container\n\n```bash\ndocker pull khaliq/subvars:latest\n\ndocker run -it --rm khaliq/subvars:latest --help\n```\n\n\n## Usage\n\n```bash\n❯ subvars --help\n\nNAME:\n   subvars - Substitute environment variables defined as go templates.\n\nUSAGE:\n   subvars [global options] command [command options] [arguments...]\n\nVERSION:\n   0.1.2\n\nCOMMANDS:\n   dir, d   Directory lets you render all files in a folder \u0026 subfolder.\n   help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --prefix value, --pr value    Match only variables with given prefix pattern [$SUBVARS_PREFIX]\n   --missingkey value, -m value  Behavior for missing key when parsing variables. Available options 'invalid', 'error' or 'zero' (default: \"invalid\") [$SUBVARS_MISSINGKEY]\n   --help, -h                    show help (default: false)\n   --version, -v                 print the version (default: false)\n```\n\n```bash\necho \"Hey! {{ .USER | upper }} your home folder is {{ .HOME }}\" | subvars\n```\n\n```bash\nsubvars dir --input examples --out conf\n```\n\nCheck [Usage Documentation](https://subvars.lmno.pk/03-usage-examples/) for detailed examples.\n\n## Configuration\n\nAll the flags have corresponding environment variables associated with it. You\ncan either provide the value with flags or export to a variable.\n\nView the [Configuration Page](https://subvars.lmno.pk/02-configuration/) for more\ndetails.\n\n\n## Contributing\n\nContributions, issues and feature requests are most welcome!\u003cbr/\u003eFeel free to check\n[issues page](https://github.com/kha7iq/subvars/issues). You can also take a look\nat the [contributing guide](https://github.com/kha7iq/subvars/blob/master/CONTRIBUTING.md).\n\n## Show your support\n\nGive a ⭐️  if you like this project!\n\nFork it ⚙️\n\nMake it better 🕶️\n\n## Acknowledgments\n\nThis tool was inspired by the original [python envtpl](https://github.com/andreasjansson/envtpl) \nproject and [subfuzion](https://github.com/subfuzion/envtpl/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTektonOps%2Fsubvars","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTektonOps%2Fsubvars","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTektonOps%2Fsubvars/lists"}