{"id":13577322,"url":"https://github.com/sorah/envchain","last_synced_at":"2025-05-15T17:03:14.977Z","repository":{"id":17154932,"uuid":"19921794","full_name":"sorah/envchain","owner":"sorah","description":"Environment variables meet macOS Keychain and gnome-keyring \u003c3","archived":false,"fork":false,"pushed_at":"2024-04-23T18:12:12.000Z","size":56,"stargazers_count":1211,"open_issues_count":9,"forks_count":34,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-05-14T08:13:12.577Z","etag":null,"topics":["credentials","gnome-keyring","keychain","secret","security"],"latest_commit_sha":null,"homepage":"","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/sorah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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":{"ko_fi":"sorah","github":["sorah"]}},"created_at":"2014-05-18T21:42:08.000Z","updated_at":"2025-05-11T07:35:06.000Z","dependencies_parsed_at":"2024-06-19T02:07:05.397Z","dependency_job_id":null,"html_url":"https://github.com/sorah/envchain","commit_stats":{"total_commits":53,"total_committers":9,"mean_commits":5.888888888888889,"dds":"0.28301886792452835","last_synced_commit":"d244e6a655d9a52d2bc1ea546c6708293816fa0b"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fenvchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fenvchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fenvchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sorah%2Fenvchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sorah","download_url":"https://codeload.github.com/sorah/envchain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254129556,"owners_count":22019631,"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":["credentials","gnome-keyring","keychain","secret","security"],"created_at":"2024-08-01T15:01:20.501Z","updated_at":"2025-05-15T17:03:14.958Z","avatar_url":"https://github.com/sorah.png","language":"C","funding_links":["https://ko-fi.com/sorah","https://github.com/sponsors/sorah","https://ko-fi.com/J3J8CKMUU'"],"categories":["C","security"],"sub_categories":[],"readme":"# envchain - set environment variables with macOS keychain or D-Bus secret service\n\n## What?\n\nSecrets for common computing environments, such as `AWS_SECRET_ACCESS_KEY`, are\nset with environment variables.\n\nA common practice is to set them in shell's intialization files such as `.bashrc` and `.zshrc`.\n\nPutting these secrets on disk in this way is a grave risk.\n\n`envchain` allows you to secure credential environment variables to your secure vault, and set to environment variables only when you called explicitly.\n\nCurrently, `envchain` supports macOS keychain and D-Bus secret service (gnome-keyring) as a vault.\n\nDon't give any credentials implicitly!\n\n## Requirement (macOS)\n\n- macOS\n  - Confirmed to work on OS X 10.11 (El Capitan), macOS 10.12 (Sierra).\n  - OS X 10.7 (Lion) or later is required, but not confirmed\n\n## Requirement (Linux)\n\n- readline\n- libsecret\n- D-Bus Secret Service\n    - GNOME keyring\n    - KeePassXC\n\n## Installation\n\n### From Source\n\n```\n$ make\n\n$ sudo make install\n(or)\n$ cp ./envchain ~/bin/\n```\n\n### Homebrew (OS X)\n\n```\nbrew install envchain\n```\n\n## Usage\n\n### Saving variables\n\nEnvironment variables are set within a specified _namespace._ You can set variables in a single command:\n\n```\nenvchain --set NAMESPACE ENV [ENV ..]\n```\n\nYou will be prompted to enter the values for each variable.\nFor example, we can set two variables... `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` here, within a namespace called `aws`:\n\n```\n$ envchain --set aws AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY\naws.AWS_ACCESS_KEY_ID: my-access-key\naws.AWS_SECRET_ACCESS_KEY: secret\n```\n\nHere we define a single new variable within a different namespace:\n\n```\n$ envchain --set hubot HUBOT_HIPCHAT_PASSWORD\nhubot.HUBOT_HIPCHAT_PASSWORD: xxxx\n```\n\nThese will all appear as application passwords with `envchain-NAMESPACE` in the data store (Keychain in macOS, gnome-keyring in common Linux distros).\n\n### Execute commands with defined variables\n\n```\n$ env | grep AWS_ || echo \"No AWS_ env vars\"\nNo AWS_ env vars\n$ envchain aws env | grep AWS_\nAWS_ACCESS_KEY_ID=my-access-key\nAWS_SECRET_ACCESS_KEY=secret\n$ envchain aws s3cmd blah blah blah\n⋮\n```\n\n```\n$ envchain hubot env | grep AWS_ || echo \"No AWS_ env vars for hubot\"\nNo AWS_ env vars for hubot\n$ envchain hubot env | grep HUBOT_\nHUBOT_HIPCHAT_PASSWORD: xxxx\n```\n\nYou may specify multiple namespaces at once, with separating by commas:\n\n```\n$ envchain aws,hubot env | grep 'AWS_\\|HUBOT_'\nAWS_ACCESS_KEY_ID=my-access-key\nAWS_SECRET_ACCESS_KEY=secret\nHUBOT_HIPCHAT_PASSWORD: xxxx\n```\n\n\n### More options\n\n#### `--list`\n\nList namespaces that have been created\n```\n$ envchain --list\naws\nhubot\n```\n\n#### `--noecho`\n\nDo not echo user input\n```\n$ envchain --set --noecho foo BAR\nfoo.BAR (noecho):\n```\n#### `--require-passphrase`\n\nAlways ask for keychain passphrase\n```\n$ envchain --set --require-passphrase name\n```\n\n#### `--no-require-passphrase`\n\nDo not ask for keychain passphrase\n```\n$ envchain --set --no-require-passphrase name\n```\n\n## Sponsor\n\n\u003ca href='https://ko-fi.com/J3J8CKMUU' target='_blank'\u003e\u003cimg height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi3.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\u003c/a\u003e\n\n### Screenshot\n\n#### OS X Keychain\n\n![](http://img.sorah.jp/20140519_060147_dqwbh_20140519_060144_s1zku_Keychain_Access.png)\n\n#### Seahorse (gnome-keyring)\n\n![](https://img.sorah.jp/2016-06-08_19-46-10_ff9c444.png)\n\n## Author\n\n- Sorah Fukumori \u003cher@sorah.jp\u003e\n- eagletmt\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorah%2Fenvchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsorah%2Fenvchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsorah%2Fenvchain/lists"}