{"id":21954875,"url":"https://github.com/thefox/parameters","last_synced_at":"2026-05-02T01:33:20.831Z","repository":{"id":138668599,"uuid":"157070929","full_name":"TheFox/parameters","owner":"TheFox","description":"Automatic replace variables in configuration file templates from environment variables.","archived":false,"fork":false,"pushed_at":"2020-03-23T20:01:51.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T23:01:53.112Z","etag":null,"topics":["configuration-files","cpp","cpp14","dotenv","mit-license","symfony"],"latest_commit_sha":null,"homepage":"https://blog.fox21.at/2018/11/17/parameters.html","language":"C++","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/TheFox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG-v0.md","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":"2018-11-11T11:00:13.000Z","updated_at":"2020-03-23T20:01:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"76f89b68-2320-44f1-8730-0289d1a2be3c","html_url":"https://github.com/TheFox/parameters","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFox%2Fparameters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFox%2Fparameters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFox%2Fparameters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheFox%2Fparameters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheFox","download_url":"https://codeload.github.com/TheFox/parameters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245006491,"owners_count":20546136,"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":["configuration-files","cpp","cpp14","dotenv","mit-license","symfony"],"created_at":"2024-11-29T07:26:26.778Z","updated_at":"2026-05-02T01:33:20.781Z","avatar_url":"https://github.com/TheFox.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Parameters\n\nAutomatic replace variables in configuration file templates from environment variables.\n\nThe parameters program takes an input file template and a given regular expression for searching environment variables. The variables in the template file will be replaced by the values of found environment variables by the exact same name.\n\n## Project Outlines\n\nThe project outlines as described in my blog post about [Open Source Software Collaboration](https://blog.fox21.at/2019/02/21/open-source-software-collaboration.html).\n\n- The main purpose of this software is to handle one template file and generate another file out of that.\n- This list is open. Feel free to request features.\n\n## Examples\n\n### Simple example\n\nFirst set the environment variables. This can also come from GitLab CI variables:\n\n```bash\nexport SYMF_DB_USER=my_user\nexport SYMF_DB_PASS=my_super_secret_password\n```\n\nThen set up a dotenv template file (`.env.dist`):\n\n```bash\nDB_USER=@SYMF_DB_USER@\nDB_PASS=@SYMF_DB_PASS@\n```\n\nNow parameters will replace the variables:\n\n```bash\n$ parameters --input .env.dist --regexp ^SYMF_ \u003e .env\n```\n\nThis will take `.env.dist` as input file and `^SYMF_` as regular expression to search for variables in your shell environment. Searching the environment variables by a given regular expression is the same as running `env | grep ^SYMF_` in your shell.\n\nThe result in `.env` file:\n\n```bash\nDB_USER=my_user\nDB_PASS=my_super_secret_password\n```\n\n### Example using different envrionments\n\nYou can also use different environments like Testing, Staging, Production, etc.\n\n```bash\n$ parameters --input .env.dist --regexp ^SYMF_ --env testing \u003e .env\n```\n\n`testing` will be converted to `TESTING`.\n\n### Example using different instances\n\n```bash\n$ parameters --input .env.dist --regexp ^SYMF_ --instance shopa \u003e .env\n```\n\n`shopa` will be converted to `SHOPA`.\n\nAlso a combination is possible.\n\n```bash\n$ parameters --input .env.dist --regexp ^SYMF_ --env testing --instance shopa \u003e .env\n```\n\nRun `parameters --help` to see more parameters.\n\n## Dependencies\n\n- [CMake](https://cmake.org/) (For building)\n- [Boost](https://www.boost.org/) (Filesystem / Program Options)\n\n### Optional Dependencies\n\n- [termcolor](https://github.com/ikalnytskyi/termcolor)\n\n### Install dependencies on macOS\n\n```bash\n$ brew install boost\n```\n\n### Install dependencies on Debian 9\n\n```bash\n$ sudo apt-get install --no-install-recommends libboost-filesystem-dev libboost-program-options-dev\n```\n\n## Build from Source\n\nYou need a modern C++ compiler that supports C++14 and CMake 3.8 or later.\n\nThis will build the binary:\n\n```bash\n$ ./bin/build.sh\n```\n\nThen the binary is available in `build_release/bin`.\n\nAfter building the project, run:\n\n```bash\n$ ./bin/install.sh\n```\n\n## Install via Debian repository\n\nOnly Debian 9 (stretch) is supported.\n\nAdd the public GPG key to the apt sources keyring:\n\n```bash\n$ wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=bintray' | sudo apt-key add -\n```\n\nVerify key on the keyring. This should print out informations about the key:\n\n```bash\n$ apt-key list bintray@bintray.com\n```\n\nAdd apt source file and update:\n\n```bash\n$ echo \"deb https://dl.bintray.com/thefox/jar stretch main\" \u003e /etc/apt/sources.list.d/fox21at.list\n$ apt-get update\n```\n\nInstall the package:\n\n```bash\n$ sudo apt-get install parameters\n```\n\nNow you can run the program:\n\n```bash\n$ parameters --help\n```\n\n## Install under Debian via .deb file\n\nGo to the [GitHub releases page](https://github.com/TheFox/parameters/releases) and download the desired version file. Then run:\n\n```bash\n$ sudo dpkg --install parameters.deb\n```\n\n## Install via Homebrew\n\n1. Add the [`thefox/brewery`](https://github.com/TheFox/homebrew-brewery) tap to brew.\n\n\t```bash\n\t$ brew tap thefox/brewery\n\t```\n\n2. Actual installation\n\n\t```bash\n\t$ brew install parameters\n\t```\n\n## Tested under\n\n- macOS 10.13 High Sierra\n- macOS 10.14 Mojave\n- Debian 8 (jessie)\n- Debian 9 (stretch)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthefox%2Fparameters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthefox%2Fparameters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthefox%2Fparameters/lists"}