{"id":27390268,"url":"https://github.com/ailispaw/yaml2bash","last_synced_at":"2026-04-06T05:32:10.120Z","repository":{"id":89119997,"uuid":"90201428","full_name":"ailispaw/yaml2bash","owner":"ailispaw","description":"Converts YAML into Bash Script","archived":false,"fork":false,"pushed_at":"2017-05-20T23:38:22.000Z","size":65,"stargazers_count":4,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T19:51:47.546Z","etag":null,"topics":["bash","docker","yaml"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ailispaw.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,"zenodo":null}},"created_at":"2017-05-03T23:18:38.000Z","updated_at":"2021-02-04T10:53:51.000Z","dependencies_parsed_at":"2023-06-14T01:00:15.449Z","dependency_job_id":null,"html_url":"https://github.com/ailispaw/yaml2bash","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/ailispaw/yaml2bash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ailispaw%2Fyaml2bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ailispaw%2Fyaml2bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ailispaw%2Fyaml2bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ailispaw%2Fyaml2bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ailispaw","download_url":"https://codeload.github.com/ailispaw/yaml2bash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ailispaw%2Fyaml2bash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31461527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"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":["bash","docker","yaml"],"created_at":"2025-04-13T19:39:32.990Z","updated_at":"2026-04-06T05:32:10.115Z","avatar_url":"https://github.com/ailispaw.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yaml2bash\n\nConverts YAML into Bash Script\n\n## Usage\n\n```\nUsage: yaml2bash [-m] [-p \u003cprefix\u003e] [\u003cfilename\u003e] [-v] [-h]\n\nOptions:\n    -m          : handle as a file contains multiple documents\n    -p \u003cprefix\u003e : specify a prefix for variables, or \"Y2B\" by default\n    \u003cfilename\u003e  : specify a YAML file to parse, or it will wait for stdin\n    -v          : show the current version and exit\n    -h          : show this help message and exit\n```\n\nIn a bash script;\n\n```bash\n#!/usr/bin/env bash\nset -e\n\neval $(yaml2bash ./test/test.yaml)\n\n# To refer an individual variable\necho $Y2B_hostname\ny2b_value Y2B[hostname]\necho $Y2B_users_1_name\ny2b_value Y2B[users][1][name]\n\n# To traverse YAML structure\ny2b_traverse Y2B\n\n# To count chidren of an individual variable\ny2b_count Y2B\ny2b_count Y2B[users]\n\n# To retrieve indexes of an array or keys of a mapping\ny2b_keys Y2B\ny2b_keys Y2B[users]\n\n# In addition,\n# To convert YAML into JSON\ny2b_json Y2B\n```\n\n## Docker\n\nYou can use Docker to execute yaml2bash as well.\n\n```bash\n$ docker run -i --rm ailispaw/yaml2bash \u003c ./test/test.yaml\n```\n\nhttps://hub.docker.com/r/ailispaw/yaml2bash\n\n## Caveats\n\n- The converted variables work only with Bash version 4.\n- It doesn't support YAML's Alias, Tag and Complex Mapping Key. ([#1](https://github.com/ailispaw/yaml2bash/issues/1))\n\n## Special Thanks to\n\nIt's inspired by the following projects.\n\n- https://github.com/clearlinux/micro-config-drive\n- https://johnlane.ie/yay-use-yaml-in-bash-scripts.html\n\n## License\n\nCopyright (c) 2017 A.I. \u0026lt;ailis@paw.zone\u0026gt;\n\nLicensed under the GNU General Public License, version 2 (GPL-2.0)  \nhttp://opensource.org/licenses/GPL-2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Failispaw%2Fyaml2bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Failispaw%2Fyaml2bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Failispaw%2Fyaml2bash/lists"}