{"id":16060520,"url":"https://github.com/savaryna/git-add-account","last_synced_at":"2026-02-01T16:01:19.499Z","repository":{"id":65986862,"uuid":"603538303","full_name":"savaryna/git-add-account","owner":"savaryna","description":"🔐 A small CLI app that allows you to easily add multiple Git accounts on one machine. It switches between accounts automatically based on the workspace you are in.","archived":false,"fork":false,"pushed_at":"2026-01-13T20:30:36.000Z","size":115,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-16T13:20:21.502Z","etag":null,"topics":["accounts","commits","git","machine","multiple","npm","one","signed","ssh","tags"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@savaryna/git-add-account","language":"TypeScript","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/savaryna.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":"2023-02-18T20:17:00.000Z","updated_at":"2026-01-13T20:30:38.000Z","dependencies_parsed_at":"2024-11-18T06:15:15.277Z","dependency_job_id":null,"html_url":"https://github.com/savaryna/git-add-account","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.09090909090909094,"last_synced_commit":"4a261b1d9de79a85532917efdead0ffea4d08ec4"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/savaryna/git-add-account","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savaryna%2Fgit-add-account","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savaryna%2Fgit-add-account/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savaryna%2Fgit-add-account/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savaryna%2Fgit-add-account/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/savaryna","download_url":"https://codeload.github.com/savaryna/git-add-account/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/savaryna%2Fgit-add-account/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28981893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T15:35:50.179Z","status":"ssl_error","status_checked_at":"2026-02-01T15:35:38.075Z","response_time":56,"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":["accounts","commits","git","machine","multiple","npm","one","signed","ssh","tags"],"created_at":"2024-10-09T04:05:05.936Z","updated_at":"2026-02-01T16:01:19.494Z","avatar_url":"https://github.com/savaryna.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @savaryna/add-git-account\n\n🔐 A small CLI app that allows you to easily add multiple Git accounts on one machine. It switches between accounts automatically based on the workspace you are in.\n\n## Agent usage (skill)\n\nAdd the skill using\n\n```shell\nnpx skills add savaryna/git-add-account\n```\n\nand ask your agent to \"add a new git account\".\n\n## CLI usage\n\nRun the command direcly with\n\n```shell\nnpx @savaryna/git-add-account\n```\n\nor if you installed it globally with\n\n```shell\nnpm i -g @savaryna/git-add-account\n```\n\nthen you can run it using\n\n```shell\ngit-add-account\n# or the shorter version\ngaa\n```\n\nFor usage and command details run it with the `--help` option.\n\nAfter going through all the steps, you will be presented with your public SSH key so you can copy, and add it to your Git provider. For example GitHub[^1]:\n\n1. Copy the public SSH key.\n1. Go to the [SSH keys settings page](https://github.com/settings/keys).\n1. Click on `New SSH key`.\n1. Add the key as an `Authentication Key`.\n1. Click on `Add SSH key`.\n1. Add the same key again as a `Signing Key` if you chose to sign your work[^2].\n\nDone! Any `git` command you run from the workspace you chose **(and its subdirectories)**, will now use this new account automatically.\n\n## How it works\n\nA simple way to use multiple Git accounts on one machine is to use different SSH configs based on the directory you are in. The way [@savaryna/add-git-account](https://www.npmjs.com/package/@savaryna/git-add-account) works is, it asks you for some basic information and then it creates files under `.config/` in the workspace directory you specified.\n\n1. It creates a private/public `ed25519` SSH keypair using `ssh-keygen` ([see code](https://github.com/savaryna/git-add-account/blob/main/src/helpers/config.ts#L28-L29)).\n1. It creates a `sshconfig` file based on this [template](https://github.com/savaryna/git-add-account/blob/main/src/templates/sshconfig.mustache).\n1. It creates a `gitconfig` file based on this [template](https://github.com/savaryna/git-add-account/blob/main/src/templates/gitconfig.mustache).\n1. It appends a conditional include to your global Git config based on this [template](https://github.com/savaryna/git-add-account/blob/main/src/templates/gitconfig.global.mustache). This makes sure that any `git` command you run from the workspace you chose **(and its subdirectories)**, will now use this new account automatically[^3].\n1. Finally, it presents you with your public SSH key so you can copy, and add it to your Git provider.\n\n## License\n\n[MIT](LICENSE) \u0026copy; [Alex Tofan](https://github.com/savaryna)\n\n[^1]: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account?tool=webui\n[^2]: https://docs.github.com/en/authentication/managing-commit-signature-verification\n[^3]: https://git-scm.com/docs/git-config#_conditional_includes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavaryna%2Fgit-add-account","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsavaryna%2Fgit-add-account","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsavaryna%2Fgit-add-account/lists"}