{"id":13418740,"url":"https://github.com/gliderlabs/sigil","last_synced_at":"2025-10-24T19:38:26.363Z","repository":{"id":32170876,"uuid":"35744167","full_name":"gliderlabs/sigil","owner":"gliderlabs","description":"Standalone string interpolator and template processor","archived":false,"fork":false,"pushed_at":"2024-09-14T07:39:31.000Z","size":224,"stargazers_count":413,"open_issues_count":3,"forks_count":49,"subscribers_count":14,"default_branch":"main","last_synced_at":"2024-09-14T18:58:52.875Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gliderlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2015-05-16T23:28:21.000Z","updated_at":"2024-09-14T07:39:34.000Z","dependencies_parsed_at":"2024-01-13T22:22:51.269Z","dependency_job_id":"2d6d4623-c16a-4a34-908c-f86d4fd415f3","html_url":"https://github.com/gliderlabs/sigil","commit_stats":{"total_commits":152,"total_committers":13,"mean_commits":"11.692307692307692","dds":"0.48684210526315785","last_synced_commit":"88de52ea13d749295699c6abbd873b9e3fe8d168"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gliderlabs%2Fsigil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gliderlabs%2Fsigil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gliderlabs%2Fsigil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gliderlabs%2Fsigil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gliderlabs","download_url":"https://codeload.github.com/gliderlabs/sigil/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685628,"owners_count":20979085,"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":[],"created_at":"2024-07-30T22:01:06.401Z","updated_at":"2025-10-24T19:38:21.333Z","avatar_url":"https://github.com/gliderlabs.png","language":"Go","funding_links":[],"categories":["Go","General Purpose Preprocessor"],"sub_categories":["Snippets Manager"],"readme":"# Sigil\n\nStandalone string interpolator and template processor\n\n```shell\necho '${name} is{{ range seq ${count:-3} }} cool{{ end }}!' | sigil -p name=Sigil\n```\n\n```text\nSigil is cool cool cool!\n```\n\nSigil is a command line tool for template processing and POSIX-compliant\nvariable expansion. It was created for configuration templating, but can be used\nfor any text processing.\n\n## Getting Sigil\n\n```shell\ncurl -L \"https://github.com/gliderlabs/sigil/releases/download/v0.10.0/gliderlabs-sigil_0.10.0_$(uname -sm|tr \\  _).tgz\" \\\n    | tar -zxC /usr/local/bin\n```\n\nOther releases can be downloaded from [Github Releases](https://github.com/gliderlabs/sigil/releases).\n\n## Using Sigil\n\nTemplate text can be provided via STDIN or from a file if provided with the `-f`\nflag. Any other arguments are key-values in the form `\u003ckey\u003e=\u003cvalue\u003e`. They are\nused as variables.\n\n* `echo 'Hello, $name' | sigil -p name=Jeff`\n* `sigil -p -f config.tmpl var1=foo \"var2=Hello world\"`\n\n### Variables\n\n#### POSIX style\n\nThere are two forms of variable syntax in Sigil. The first is POSIX style, which\namong other features allows default values or enforces required values:\n\n* `$variable` - normal POSIX style\n* `${variable:-\"default\"}` - expansion with default value\n* `${variable:?}` - fails when not set\n\nEnvironment variables are also available as POSIX style variables. This makes\nSigil great for quick and simple string interpolation.\n\n#### Template style\n\nThe other syntax to use variables is consistent with the rest of the templating\nsyntax. It uses `{{` and `}}` to define template expressions. Variable expansion\nin this form is simply used as:\n\n* `{{ $variable }}`\n\nYou can do much more with this syntax, such as modifier pipelines. All of which\nis explained below.\n\n#### Custom Delimiters\n\nSometimes you want to use sigil to generate text, which uses golang templating itself.\nFor example if you want to generate [packer](https://www.packer.io/docs/) configuration\nyour template might contain a lot of `{{` and `}}`.\n\nInstead of replacing all `{{` with `{{“{{”}}`, you can change the delimiters,\nby setting the `SIGIL_DELIMS` environment variable. It is the left and right\ndelimiter strings, separated by a coma.\n\n```shell\nSIGIL_DELIMS={{{,}}}  sigil -i 'hello {{{ $name }}}' name=packer\n```\n\n### Functions\n\nThere are a number of builtin functions that can be used as modifiers,\nconditional tests, expansion data sources, and more. There are two references\nfor functions available:\n\n* [Sigil builtins](http://godoc.org/github.com/gliderlabs/sigil/builtin)\n* [Go template builtins](http://golang.org/pkg/text/template/#hdr-Functions)\n\nHere are a few examples:\n\n* `{{ $variable | capitalize }}`\n* `{{ include \"file.tmpl\" \"var1=foo\" \"var2=bar\" }}`\n* `{{ file \"example.txt\" | replace \"old\" \"new\" }}`\n* `{{ json \"file.json\" | pointer \"/Widgets/0/Name\" }}`\n\n### Conditionals\n\n* `{{ if expr }} true {{ end }}`\n* `{{ if expr }} true {{ else }} false {{ end }}`\n* `{{ if expr }} true {{ else if expr }} also true {{ end }}`\n\n### Loops / Iteration\n\n* `{{ range expr }} element: {{.}} {{ end }}`\n* `{{ range expr }} elements {{ else }} no elements {{ end }}`\n\n### Full Syntax\n\nLots more is possible with this template syntax. Sigil is based on Go's\n[text/template package](http://golang.org/pkg/text/template/). You can read full\ndocumentation there.\n\n## License\n\nBSD\n![beacon](https://ga-beacon.appspot.com/UA-58928488-2/sigil/readme?pixel \"beacon\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgliderlabs%2Fsigil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgliderlabs%2Fsigil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgliderlabs%2Fsigil/lists"}