{"id":17323768,"url":"https://github.com/elasticdog/bw-ssh-add","last_synced_at":"2025-02-25T17:31:08.230Z","repository":{"id":252483946,"uuid":"840573770","full_name":"elasticdog/bw-ssh-add","owner":"elasticdog","description":"Add SSH keys to your agent using passphrases stored in Bitwarden","archived":false,"fork":false,"pushed_at":"2024-08-12T20:01:44.000Z","size":35,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T19:51:22.353Z","etag":null,"topics":["authentication","bitwarden","bitwarden-cli","ssh","ssh-add","ssh-agent"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elasticdog.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}},"created_at":"2024-08-10T03:53:46.000Z","updated_at":"2025-02-07T06:24:07.000Z","dependencies_parsed_at":"2024-08-10T05:33:15.683Z","dependency_job_id":"daf76fae-a9b8-47a3-a149-e6c22894b6ee","html_url":"https://github.com/elasticdog/bw-ssh-add","commit_stats":null,"previous_names":["elasticdog/bw-ssh-add"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elasticdog%2Fbw-ssh-add","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elasticdog%2Fbw-ssh-add/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elasticdog%2Fbw-ssh-add/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elasticdog%2Fbw-ssh-add/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elasticdog","download_url":"https://codeload.github.com/elasticdog/bw-ssh-add/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240713101,"owners_count":19845597,"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":["authentication","bitwarden","bitwarden-cli","ssh","ssh-add","ssh-agent"],"created_at":"2024-10-15T14:08:32.693Z","updated_at":"2025-02-25T17:31:08.221Z","avatar_url":"https://github.com/elasticdog.png","language":"Shell","readme":"# bw-ssh-add\n\n**Add SSH keys to your agent using passphrases stored in Bitwarden.**\n\n---\n\nA script to add a passphrase-protected SSH key to your local [`ssh-agent`][1] by\nleveraging credentials stored in [Bitwarden][2]. It securely retrieves the\npassphrase via the [Bitwarden CLI][3], then uses [`expect`][4] to automate the\nauthentication process with [`ssh-add`][5].\n\n[1]: https://www.ssh.com/academy/ssh/agent\n[2]: https://bitwarden.com/\n[3]: https://github.com/bitwarden/clients/tree/main/apps/cli\n[4]: https://core.tcl-lang.org/expect/home\n[5]: https://www.ssh.com/academy/ssh/add-command\n\n## Usage\n\n```bash\nbw-ssh-add \u003cBITWARDEN-ITEM-ID\u003e [SSH-ADD-ARGUMENTS...]\n```\n\n- The first argument serves as input for `bw get password`, either as a search\n  term or as an item's globally unique identifier, to retrieve the key's\n  passphrase.\n- Any additional arguments are passed through to `ssh-add` unchanged. Refer to\n  the [`ssh-add` man page][6] for details on available options.\n\n[6]: https://man.openbsd.org/ssh-add.1\n\nThe script sets an expiration time for the added key:\n\n- Default: **17:00:00** (5:00 PM local time)\n- If it's already past 5:00 PM: **3 hours**\n- Customize the end-of-day time using the `BW_SSH_ADD_EOD` environment variable\n  (format: **HH:MM:SS**)\n- To remove the maximum lifetime, set `BW_SSH_ADD_EOD` to an **empty string**\n\n### Examples\n\n```bash\nbw-ssh-add \"My SSH Key\"\nbw-ssh-add 99ee88d2-6046-4ea7-92c2-acac464b1412\nbw-ssh-add \"Work Laptop Key\" -t 3600\nBW_SSH_ADD_EOD=\"18:30:00\" bw-ssh-add \"Custom EOD Key\"\nBW_SSH_ADD_EOD=\"\" bw-ssh-add \"No Expiry Key\"\n```\n\n## Installation\n\n1. Ensure you have the required dependencies installed and configured:\n\n   - Bitwarden CLI (`bw`)\n   - `expect` command\n   - SSH agent\n\n2. Add the _bw-ssh-add_ script to your \\$PATH:\n\n   ```bash\n   git clone https://github.com/elasticdog/bw-ssh-add.git\n   cd bw-ssh-add/\n   sudo ln -s ${PWD}/bw-ssh-add /usr/local/bin/bw-ssh-add\n   ```\n\n## License\n\nbw-add-ssh is released under the [Zero Clause BSD License][0BSD] (SPDX: 0BSD).\n\nCopyright \u0026copy; 2024 [Aaron Bull Schaefer][EMAIL] and contributors\n\n[0BSD]: https://github.com/elasticdog/bw-ssh-add/blob/main/LICENSE\n[EMAIL]: mailto:aaron@elasticdog.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felasticdog%2Fbw-ssh-add","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felasticdog%2Fbw-ssh-add","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felasticdog%2Fbw-ssh-add/lists"}