{"id":37139984,"url":"https://github.com/ethrgeist/git-credential-1password","last_synced_at":"2026-01-14T16:24:17.092Z","repository":{"id":237034688,"uuid":"793526342","full_name":"ethrgeist/git-credential-1password","owner":"ethrgeist","description":"A Git credential helper that utilizes the 1Password CLI to authenticate a Git over http(s) connection.","archived":false,"fork":false,"pushed_at":"2025-09-24T10:46:00.000Z","size":55,"stargazers_count":88,"open_issues_count":2,"forks_count":14,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-24T12:31:52.439Z","etag":null,"topics":["1password","1password-cli","git","git-credential-helper","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","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/ethrgeist.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-29T11:45:59.000Z","updated_at":"2025-09-24T10:44:54.000Z","dependencies_parsed_at":"2024-04-29T18:03:14.073Z","dependency_job_id":"0e1be5e7-0d42-4c25-85f7-500c6a2236f3","html_url":"https://github.com/ethrgeist/git-credential-1password","commit_stats":null,"previous_names":["ethrgeist/git-credential-1password"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ethrgeist/git-credential-1password","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethrgeist%2Fgit-credential-1password","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethrgeist%2Fgit-credential-1password/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethrgeist%2Fgit-credential-1password/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethrgeist%2Fgit-credential-1password/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethrgeist","download_url":"https://codeload.github.com/ethrgeist/git-credential-1password/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethrgeist%2Fgit-credential-1password/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28425703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T15:24:48.085Z","status":"ssl_error","status_checked_at":"2026-01-14T15:23:41.940Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["1password","1password-cli","git","git-credential-helper","golang"],"created_at":"2026-01-14T16:24:16.538Z","updated_at":"2026-01-14T16:24:17.085Z","avatar_url":"https://github.com/ethrgeist.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-credential-1password\n\nThis is a simple Git credential helper that uses the [1Password](https://1password.com/) password manager to retrieve credentials.\n\nDuring my professional work, I came across git servers that did not support SSH and, as a result, did not support SSH keys.\nIn order to avoid [storing passwords in plaintext](https://stackoverflow.com/questions/35942754/how-can-i-save-username-and-password-in-git/35942890#35942890)\nin the git configuration, I decided to use a password manager to save my credentials.\n\nSeriously, do not do that! any run-away-script could grab these and exfiltrate them in various ways, since the `.gitconfig` is\nusually in a well-defined place.\n\n## 🔐 Features\n\nThis credential helper expects a 1Password item with the following fields:\n\n- `username`: The username to use for authentication.\n- `password`: The password to use for authentication, could also be a personal access token.\n\nItem name must the same as the hostname of the repository you are authenticating against, e.g. `github.com` or\n`gitlab.example.net`. If the credentials are unknown, a new item will be created.\n\nThe [arguments](https://git-scm.com/docs/gitcredentials) `get`, `store`, and `erase` are supported.\n\n**⚠️ Danger: `erase` will remove the 1Password item matching the hostname! It's disabled by default, see optional configuration**\n\n### 🚧 Why Go?\n\nIt's portable and very lightweight, so it's easy to build and run on different systems. Also, it's a compiled language,\nso you don't have to worry about the user having the correct runtime installed.\n\n### 📦 Why no binary releases?\n\nI don't want to distribute binaries that could be used to steal your 1Password data and I don't want you to have to trust me.\n\nThe program logic is very simple and commented, so you can easily audit the code.\n\nAlso, it's effort to ensure that builds run on different systems, signing binaries and so on.\n\n### 🔄 Alternatives?\n\nIf your target system uses Oauth, you might want to try [git-credential-oauth](https://github.com/hickford/git-credential-oauth),\nalthough it is a bit more complex to set up.\n\n## 🏗️ Installation\n\nClone this repository and build the binary, simplest way could be:\n\n```bash\ngo build -o git-credential-1password\n```\n\nThen copy the binary to a directory in your PATH.\n\nYou must have installed and configured the [1Password CLI](https://support.1password.com/command-line-getting-started/)\nfor this to work.\n\nYou can test the 1Password CLI by running:\n\n```bash\nop whoami\n```\n\nThis should prompt you to unlock your vault and then print account information.\n\nThis helper has no external dependencies other than the 1Password CLI.\n\nVerify that `git` can find the helper by running:\n\n```bash\ngit credential-1password\n```\n\nIf you have problems, make sure that the binary is [located in the path](https://superuser.com/a/284351/62691) and\n[is executable](https://askubuntu.com/a/229592/18504).\n\n## ⚙️ Usage\n\n*Fun fact: Did you know that you can use the [default Golang flags](https://www.antoniojgutierrez.com/posts/2021-05-14-short-and-long-options-in-go-flags-pkg/) with `-` and `--`? Well, now you do!*\n\nTo use this credential helper, you need to configure Git to use it. You can do this by running:\n\n```bash\ngit config --global credential.helper \"1password\"\n```\n\nDepending on your setup, it might be a better strategy to just set it as helper for a single host:\n\n```bash\ngit config --global credential.https://gitlab.example.net.helper \"1password\"\n```\n\nThen, when you push to a repository that requires authentication, 1Password will prompt you to unlock your vault and will\nthen use the credentials stored in the item with the same name as the hostname.\n\n*Note: Depending on your OS, you might get prompted in different ways for your credentials.*\n\n## Optional Configuration\n\nIf you want to use a specific account or vault, you can add `--account` and/or `--vault` to the command line arguments. If omitted,\nthe default account and vault will be used.\n\n```bash\ngit config --global credential.helper \"1password --account=myaccount --vault='myvault with spaces'\"\n```\n\n*Note: Sometimes accessing a vault by the account mail address does not work, so you might have to use the account ID.*\n\n`erase` is disabled by default, as it will remove the matching 1Password item. If you want to enable it, you can\nadd `-erase=true` to the command line arguments.\n\n```bash\ngit config --global credential.helper \"1password --erase=true\"\n```\n\nYou can also add a `--prefix` argument, to prefix all item names with a specific string. (i.e. use `--prefix=\"Git: \"` to\nuse `Git: gitlab.com` as the item name instead of `gitlab.com`).\n\n```bash\ngit config --global credential.helper \"1password --prefix='Git: '\"\n```\n\nIn case you want to use a different field name for the username or password, you can use the `--username-field` and\n`--password-field` arguments.\n\n```bash\ngit config --global credential.helper \"1password --username-field='email' --password-field='pass'\"\n```\n\nSince providers might require a personal access token instead of a password, you can use the `--password-field` argument\nto access the token.\n\nE.g., [GitHub requires a personal access token](https://docs.github.com/en/get-started/git-basics/about-remote-repositories#cloning-with-https-urls)\ninstead of a password since [August 2021](https://github.blog/changelog/2021-08-12-git-password-authentication-is-shutting-down/).\n\nIn case your `op` binary is not in the PATH, you can use the `--op-path` argument to specify the path to the `op` binary.\n\n```bash\ngit config --global credential.helper \"1password --op-path='/usr/local/bin/op'\"\n```\n\n*Note: On Windows, you must use forward slashes `/` in the path, e.g., `C:/temp/op.exe`, for Git to provide it to the credential helper.*\n\n## How items in 1Password items are selected\n\n### Reading credentials\n\nThe helper looks for items\n\n- in the selected Vault and Account\n- AND that have the tag `git-credential-1password`\n- AND that match protocol and host of the requested URL in the `url` field\n\n### Storing credentials\n\n- When the helper can find an item according to the rules above, it will update the `username` and `password` fields of the item if they changed.\n- Otherwise, it will create a new item with `url`, `username`, `password` fields, a `git-credential-1password` tag.\n\n## 🌳 Collaboration\n\nFeel free to open issues or pull requests.\n\n## 💌 Inspiration\n\nThis project was inspired by [git-credential-oauth](https://github.com/hickford/git-credential-oauth)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethrgeist%2Fgit-credential-1password","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethrgeist%2Fgit-credential-1password","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethrgeist%2Fgit-credential-1password/lists"}