{"id":44744601,"url":"https://github.com/clevyr/yampl","last_synced_at":"2026-02-15T21:35:55.754Z","repository":{"id":46236707,"uuid":"489413283","full_name":"clevyr/yampl","owner":"clevyr","description":"Template YAML values based on line-comments.","archived":false,"fork":false,"pushed_at":"2026-02-10T23:11:13.000Z","size":615,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-02-11T02:03:23.055Z","etag":null,"topics":["docker","gotemplate","kubernetes","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clevyr.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-05-06T15:55:30.000Z","updated_at":"2026-01-29T23:28:19.000Z","dependencies_parsed_at":"2024-03-25T07:24:30.761Z","dependency_job_id":"be6793a5-71e6-4c07-9a8e-e708c038e935","html_url":"https://github.com/clevyr/yampl","commit_stats":{"total_commits":275,"total_committers":3,"mean_commits":91.66666666666667,"dds":"0.16727272727272724","last_synced_commit":"d5da7f87207e9e97014b639ea3b763d03fc93c44"},"previous_names":["clevyr/go-yampl"],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/clevyr/yampl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clevyr%2Fyampl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clevyr%2Fyampl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clevyr%2Fyampl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clevyr%2Fyampl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clevyr","download_url":"https://codeload.github.com/clevyr/yampl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clevyr%2Fyampl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29490353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T19:29:10.908Z","status":"ssl_error","status_checked_at":"2026-02-15T19:29:10.419Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["docker","gotemplate","kubernetes","yaml"],"created_at":"2026-02-15T21:35:55.573Z","updated_at":"2026-02-15T21:35:55.744Z","avatar_url":"https://github.com/clevyr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yampl\n\n\u003cimg src=\"assets/logo.svg\" alt=\"Yampl Icon\" width=\"170\" align=\"right\"\u003e\n\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/clevyr/yampl)](https://github.com/clevyr/yampl/releases)\n[![Build](https://github.com/clevyr/yampl/actions/workflows/build.yml/badge.svg)](https://github.com/clevyr/yampl/actions/workflows/build.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/clevyr/yampl)](https://goreportcard.com/report/github.com/clevyr/yampl)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=clevyr_yampl\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=clevyr_yampl)\n\nYampl (yaml + tmpl) templates YAML values based on line-comments.\n\n## Installation\n\nYampl is available in brew or as a Docker container.\n\n### Homebrew (macOS, Linux)\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\n  ```shell\n  brew install clevyr/tap/yampl\n  ```\n\u003c/details\u003e\n\n### GitHub Actions\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\n  There are two actions available for CI/CD usage:\n  - **[clevyr/setup-yampl-action](https://github.com/clevyr/setup-yampl-action):** Installs yampl during a GitHub Action run.\n  - **[clevyr/yampl-action](https://github.com/clevyr/yampl-action):** Installs yampl, runs yampl with the given inputs, then optionally creates a commit for you.\n\n\u003c/details\u003e\n\n### Docker\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\n  yampl has a Docker image available at [`ghcr.io/clevyr/yampl`](https://ghcr.io/clevyr/yampl)\n\n  ```shell\n  docker pull ghcr.io/clevyr/yampl\n  ```\n\n  To use this image, you will need to volume bind the desired directory into the\n  Docker container. The container uses `/data` as its workdir, so if you wanted\n  to template `example.yaml` in the current directory, you could run:\n  ```shell\n  docker run --rm -it -v \"$PWD:/data\" ghcr.io/clevyr/yampl example.yaml ...\n  ```\n\u003c/details\u003e\n\n### APT Repository (Ubuntu, Debian)\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\n  1. If you don't have it already, install the `ca-certificates` package\n     ```shell\n     sudo apt install ca-certificates\n     ```\n\n  2. Add Clevyr's apt repository\n     ```\n     echo 'deb [trusted=yes] https://apt.clevyr.com /' | sudo tee /etc/apt/sources.list.d/clevyr.list\n     ```\n\n  3. Update apt repositories\n     ```shell\n     sudo apt update\n     ```\n\n  4. Install yampl\n     ```shell\n     sudo apt install yampl\n     ```\n\u003c/details\u003e\n\n### RPM Repository (CentOS, RHEL)\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\n  1. If you don't have it already, install the `ca-certificates` package\n     ```shell\n     sudo yum install ca-certificates\n     ```\n\n  2. Add Clevyr's rpm repository to `/etc/yum.repos.d/clevyr.repo`\n     ```ini\n     [clevyr]\n     name=Clevyr\n     baseurl=https://rpm.clevyr.com\n     enabled=1\n     gpgcheck=0\n     ```\n\n  3. Install yampl\n     ```shell\n     sudo yum install yampl\n     ```\n\u003c/details\u003e\n\n### AUR (Arch Linux)\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\nInstall [yampl-bin](https://aur.archlinux.org/packages/yampl-bin) with your [AUR helper](https://wiki.archlinux.org/index.php/AUR_helpers) of choice.\n\u003c/details\u003e\n\n\n## Usage\n\n[View the generated docs](docs/yampl.md) for flag and command reference.\nAlso, see [templating](#templating) and [example](#examples) sections.\n\n## Examples\n\n### Simple Examples\n\n1. Template with a single value:\n    ```shell\n    $ cat example.yaml\n    name: Clevyr #yampl {{ .name }}\n    $ yampl example.yaml -v name='Clevyr Inc.'\n    name: Clevyr Inc. #yampl {{ .name }}\n    ```\n\n2. Template with multiple values:\n    ```shell\n    $ cat example.yaml\n    image: nginx:stable #yampl {{ .repo }}:{{ .tag }}\n    $ yampl example.yaml -v repo=docker.io/nginx -v tag=1.27.0\n    image: docker.io/nginx:1.27.0 #yampl {{ .repo }}:{{ .tag }}\n    ```\n\u003e [!NOTE]\n\u003e All variables must be set for a node to be changed.\n\n3. Using a [Sprig](https://masterminds.github.io/sprig/) function:\n    ```shell\n    $ cat example.yaml\n    name: Clevyr #yampl {{ upper current }}\n    $ yampl example.yaml\n    name: CLEVYR #yampl {{ upper current }}\n    ```\n\n4. Using the [`repo`](#repo) helper function:\n    ```shell\n    $ cat example.yaml\n    image: nginx:1.26.1 #yampl {{ repo current }}:{{ .tag }}\n    $ yampl example.yaml -v tag=1.27.0\n    image: nginx:1.27.0 #yampl {{ repo current }}:{{ .tag }}\n    ```\n\n### Kubernetes Deployment\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick to expand\u003c/summary\u003e\n\n  Here is a simple Kubernetes Deployment with an Nginx image:\n\n  ```yaml\n  apiVersion: apps/v1\n  kind: Deployment\n  metadata:\n    name: nginx\n  spec:\n    selector:\n      matchLabels:\n        app: nginx\n    template:\n      metadata:\n        labels:\n          app: nginx\n      spec:\n        containers:\n          - name: nginx\n            image: nginx:1.26.1 #yampl nginx:{{ .tag }}\n            ports:\n            - containerPort: 80\n  ```\n\n  Notice the yaml comment on the same line as `image`.\n\n  If this file was called `nginx.yaml`, then you could replace the image tag by running:\n  ```shell\n  yampl -i nginx.yaml -v tag=1.27.0\n  ```\n\n  The file would be updated in-place:\n  ```yaml\n  apiVersion: apps/v1\n  kind: Deployment\n  metadata:\n    name: nginx\n  spec:\n    selector:\n      matchLabels:\n        app: nginx\n    template:\n      metadata:\n        labels:\n          app: nginx\n      spec:\n        containers:\n          - name: nginx\n            image: nginx:1.27.0 #yampl nginx:{{ .tag }}\n            ports:\n              - containerPort: 80\n  ```\n\n  If you wanted to repeat yourself even less, you could use the [`repo`](#repo) function to pull the existing repo through to the output.\n  For example, you could change the `image` line to:\n  ```yaml\n  image: nginx:1.27.0 #yampl {{ repo current }}:{{ .tag }}\n  ```\n\n  This would generate the same output, but you wouldn't have to type `nginx` twice.\n  This becomes more useful when using custom Docker registries where repo names can get long.\n\n\u003c/details\u003e\n\n## Templating\n\n### Variables\n\nAll variables passed in with the `-v` flag are available during templating.  \nFor example, the variable `-v tag=latest` can be used as `{{ .tag }}`.\n\n### Functions\n\nAll [Sprig functions](https://masterminds.github.io/sprig/) are available in templates, along with some extras:\n\n#### `current`\n\nReturns the current YAML node's value.\n\n#### `repo`\n\nSplits a Docker repo and tag into the repo component:\n```gotemplate\nrepo \"nginx:stable-alpine\"\n```\nThe above produces `nginx`.\n\n#### `tag`\n\nSplits a Docker repo and tag into the tag component:\n```gotemplate\ntag \"nginx:stable-alpine\"\n```\nThe above produces `stable-alpine`\n\n## Advanced Usage\n\n### Tags\n\nBy default, templated values are not explicitly quoted. This can cause\nproblems with tools that require specific types. If you require a\nspecific type for a field, you can add a tag to the template prefix.\n\nSupported tags:\n\n- `#yampl:bool`\n- `#yampl:str`\n- `#yampl:int`\n- `#yampl:float`\n- `#yampl:seq`\n- `#yampl:map`\n\n#### Examples\n\n1. String\n\n   The following could be interpreted as either a string or an int:\n\n   ```shell\n   $ cat example.yaml\n   num: #yampl {{ .num }}\n   $ yampl example.yaml -v num=2009\n   num: 2009 #yampl {{ .num }}\n   ```\n\n   If this field must be a string, you could add the `str` tag:\n\n   ```shell\n   $ cat example.yaml\n   num: #yampl:str {{ .num }}\n   $ yampl example.yaml -v num=2009\n   num: \"2009\" #yampl:str {{ .num }}\n   ```\n\n2. Sequence\n\n   ```shell\n   $ cat example.yaml\n   seq: #yampl:seq {{ .seq }}\n   $ yampl example.yaml -v seq='[a, b, c]'\n   seq: #yampl {{ .seq }}\n     - a\n     - b\n     - c\n   ```\n\n3. Map\n\n   ```shell\n   $ cat example.yaml\n   map: #yampl:map {{ .map }}\n   $ yampl example.yaml -v map='{message: hello world}'\n   map: #yampl {{ .map }}\n     message: hello world\n   ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclevyr%2Fyampl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclevyr%2Fyampl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclevyr%2Fyampl/lists"}