{"id":23535027,"url":"https://github.com/ripta/tpl","last_synced_at":"2026-03-09T15:33:14.805Z","repository":{"id":57555831,"uuid":"117770538","full_name":"ripta/tpl","owner":"ripta","description":"Simplistic CLI for rendering go text/template files with data from YAML. ¯\\_(ツ)_/¯ ","archived":false,"fork":false,"pushed_at":"2025-04-29T07:35:19.000Z","size":1818,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-07T21:39:31.626Z","etag":null,"topics":["golang","template"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/ripta.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-01-17T02:15:52.000Z","updated_at":"2025-04-29T07:35:23.000Z","dependencies_parsed_at":"2024-06-20T01:29:09.935Z","dependency_job_id":"42053410-d817-4e98-8a58-bba167cd3ee1","html_url":"https://github.com/ripta/tpl","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/ripta/tpl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripta%2Ftpl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripta%2Ftpl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripta%2Ftpl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripta%2Ftpl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ripta","download_url":"https://codeload.github.com/ripta/tpl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripta%2Ftpl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30301109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T14:33:48.460Z","status":"ssl_error","status_checked_at":"2026-03-09T14:33:48.027Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["golang","template"],"created_at":"2024-12-26T01:14:26.804Z","updated_at":"2026-03-09T15:33:14.786Z","avatar_url":"https://github.com/ripta.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tpl\n\nA very simplistic CLI tool that allows rendering arbitrary text/template files,\npulling data in from any YAML file.\n\nThere's a docker image:\n\n```\ndocker pull ripta/tpl\n```\n\nOr, get it from the source:\n\n```\ngo get github.com/ripta/tpl\n```\n\nRun it like so:\n\n```\ntpl -values=test/data/a.yaml -out=rendered.txt test/templates/ok.tpl\n```\n\nMultiple templates can be provided on the command line. Each template is\nrendered individually using the same values file, and into the same output\nfile. The default `-` output file can be used to write to STDOUT.\n\nMultiple value files can be provided as comma-separated paths. Value files are\nevaluated in order; later values override earlier ones. For example:\n\n```\ntpl -values=test/data/b2.yaml,test/data/b1.yaml -out=rendered.txt test/templates/ok.tpl\n```\n\nIf `b2.yaml` and `b1.yaml` contain the same keys, then in the above example,\nvalues in `b1.yaml` will override those in `b2.yaml`. If a key exists in\n`b2.yaml`, but not in `b1.yaml`, then the value in `b2.yaml` are used.\n\nOptional values may be provided on the command line, but the key and value\nwould be strings. Command line values override any values that appear in value\nfiles, with the same override rules. For example:\n\n```\ntpl -value=foo=bar -value=baz=1234 test/templates/ok.tpl\n```\n\n## Nested directories\n\nNested directory structures are supported. Assuming the following templates:\n\n```\ntest/templates/deep/ok2.txt.tpl\ntest/templates/fail.txt.tpl\ntest/templates/ok.txt.tpl\n```\n\nthen `tpl ... -out foobar test/templates` will emit:\n\n```\nfoobar/templates/deep/ok2.txt\nfoobar/templates/fail.txt\nfoobar/templates/ok.txt\n```\n\nwhile `tpl ... -out foobar test/templates/*` will emit:\n\n```\nfoobar/deep/ok2.txt\nfoobar/fail.txt\nfoobar/ok.txt\n\n\n## Plugins\n\nAlthough it's possible to render captured output from arbitrary commands into your\ntemplates with `exec`, custom text/template functions written in Go can be built\ninto a plugin for direct invocation within templates.\n\nFor example:\n```\npackage main\n\nimport (\n\t\"fmt\"\n\t\"text/template\"\n)\n\nfunc FuncMap() template.FuncMap {\n\tf := make(template.FuncMap)\n\tf[\"foo\"] = foo\n\treturn f\n}\n\nfunc foo() string {\n\treturn fmt.Sprint(\"foo\")\n}\n```\nAssuming the above code is compiled into myfuncs.so (see how below), tpl can evaluate\n`{{ myfuncs_foo }}` in templates. That is to say, tpl prefixes all functions defined \nin plugins with the file's name followed by an underscore.\n\nTo build this plugin, run:\n```\ngo build -buildmode plugin -o test/plugins/myfuncs.so test/plugins/myfuncs.go\n```\n\nIn order for tpl to load your plugins, you must pass the `-plugins-dir $dir` option\nor export the `TPL_PLUGINS` environment variable, either of which should specify the\nlocation of your plugins directory:\n```\ntpl -plugins-dir test/plugins -out plugin.txt test/templates/plugin.txt.tpl\n```\n\n\n## Releasing\n\n```\nVERSION=6.0\n\nmake test\ngit tag -a v$VERSION\n\nmake build\nmake push\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fripta%2Ftpl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fripta%2Ftpl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fripta%2Ftpl/lists"}