{"id":18053308,"url":"https://github.com/luzifer/envrun","last_synced_at":"2025-04-10T19:42:41.897Z","repository":{"id":57613179,"uuid":"51207564","full_name":"Luzifer/envrun","owner":"Luzifer","description":"Helper utility to inject environment variables stored in a file into processes","archived":false,"fork":false,"pushed_at":"2024-12-12T10:56:44.000Z","size":1155,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T17:21:19.745Z","etag":null,"topics":["encryption","environment-variables","golang","helper"],"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/Luzifer.png","metadata":{"files":{"readme":"README.md","changelog":"History.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},"funding":{"custom":["https://www.paypal.me/luzifer"],"github":["Luzifer"],"ko_fi":"luziferus"}},"created_at":"2016-02-06T15:23:42.000Z","updated_at":"2024-12-12T10:56:48.000Z","dependencies_parsed_at":"2022-08-30T02:01:47.033Z","dependency_job_id":"38e727a7-6646-43a3-ac6d-fe93bc6b3511","html_url":"https://github.com/Luzifer/envrun","commit_stats":{"total_commits":53,"total_committers":1,"mean_commits":53.0,"dds":0.0,"last_synced_commit":"788a71cd98c67e69977ec90d75581f4918d56ed1"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fenvrun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fenvrun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fenvrun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Luzifer%2Fenvrun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Luzifer","download_url":"https://codeload.github.com/Luzifer/envrun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248281419,"owners_count":21077423,"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":["encryption","environment-variables","golang","helper"],"created_at":"2024-10-30T23:16:46.458Z","updated_at":"2025-04-10T19:42:41.868Z","avatar_url":"https://github.com/Luzifer.png","language":"Go","readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/Luzifer/envrun)](https://goreportcard.com/report/github.com/Luzifer/envrun)\n![](https://badges.fyi/github/license/Luzifer/envrun)\n![](https://badges.fyi/github/downloads/Luzifer/envrun)\n![](https://badges.fyi/github/latest-release/Luzifer/envrun)\n\n# Luzifer / envrun\n\n`envrun` is a small helper utility to inject environment variables stored in a file into processes.\n\nIt reads a `.env` file (configurable) from the current directory and then either takes its own environment variables or a clean set and adds the env variables found in `.env` to it. The resulting set is passed to the command you put as arguments to `envrun`.\n\n## Examples\n\nTo visualize the effect of the utility the test command is `python test.py` with this simple python script:\n\n```python\nimport os\n\nfor k in os.environ.keys():\n  print \"{} = {}\".format(k, os.environ[k])\n```\n\nIt just prints the current environment to `STDOUT` and exits.\n\n```console\n$ cat .env\nMY_TEST_VAR=hello world\nANOTHER_VAR=foo\n\n$ python test.py | grep MY_TEST_VAR\n## No output on this command\n\n$ envrun --help\nUsage of envrun:\n      --clean                  Do not pass current environment to child process\n      --encryption string      Encryption method used for encrypted env-file (Available: gpg-symmetric, openssl-md5, openssl-sha256) (default \"openssl-md5\")\n      --env-file string        Location of the environment file (default \".env\")\n      --log-level string       Log level (debug, info, warn, error, fatal) (default \"info\")\n  -p, --password string        Password to decrypt environment file\n      --password-file string   Read encryption key from file\n      --version                Prints current version and exits\n\n$ envrun python test.py | grep MY_TEST_VAR\nMY_TEST_VAR = hello world\n\n$ envrun python test.py | wc -l\n      45\n\n$ envrun --clean python test.py | wc -l\n       3\n\n$ envrun --clean python test.py\n__CF_USER_TEXT_ENCODING = 0x1F5:0x0:0x0\nANOTHER_VAR = foo\nMY_TEST_VAR = hello world\n```\n\n## Encrypted `.env`-file\n\nIn case you don't want to put the environment variables into a plain text file onto your disk you can use an encrypted file and provide a password to `envrun`:\n\n### GnuPG symmetric encryption\n\nIn this example an armored (`-a`) encryption is used. This is not required and you can leave out the `-a` flag.\n\n```console\n$ echo \"MYVAR=myvalue\" | gpg --passphrase justatest --batch --quiet --yes -c -a -o .env\n\n$ cat .env\n-----BEGIN PGP MESSAGE-----\n\njA0ECQMCIsGVKNlJw1Py0kMB542XJvekKyuPi2LHQrnFlhD5ALm6orvE3WFAzp7D\nkAisTMr10fmjLuENfQhxqd9MB0Kd2mfd3b1mgOzei5IMDLJc\n=7k9M\n-----END PGP MESSAGE-----\n\n$ envrun -p justatest --encryption gpg-symmetric --clean -- env\nMYVAR=myvalue\nINFO[0000] Process exitted with code 0\n```\n\n### OpenSSL AES256 encryption\n\n```console\n$ echo 'MYVAR=myvalue' | openssl enc -e -aes-256-cbc -pass pass:justatest -base64 -out .env\n\n$ cat .env\nU2FsdGVkX18xcVIMejjwWzh1DppzptJCHhORH/JDj10=\n\n$ envrun -p justatest --clean -- env\nMYVAR=myvalue\nINFO[0000] Process exitted with code 0\n```\n","funding_links":["https://www.paypal.me/luzifer","https://github.com/sponsors/Luzifer","https://ko-fi.com/luziferus"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluzifer%2Fenvrun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluzifer%2Fenvrun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluzifer%2Fenvrun/lists"}