项目作者: KennethanCeyer

项目描述 :
:lock: ssh key manager written in go
高级语言: Go
项目地址: git://github.com/KennethanCeyer/gowap.git
创建时间: 2017-11-27T21:47:00Z
项目社区:https://github.com/KennethanCeyer/gowap

开源协议:Apache License 2.0

下载




Github Release



Build Status
Test Coverage
Coverage Status



Go Report Card
codebeat badge

Maintainability

:warning: Notice

This project is working in progress project

If you follow the below installation guide, you may not get the intended result

But you can express your interest by clicking star on this project.

The more star in this repository, the more nervous the maintainer will be and will focus more on this project than any other project.

:clap:for those who are suffering from managing multiple ssh keys

the goal of this project is quite simple

  • ssh-key changes must be simple and quick
  • you can set an alias name for each of the ssh keys
  • it could be nice, if this cli can support to register your ssh-key to github by using api

:triangular_ruler: Blueprint

rules

  • it must follows cleancode rule
  • proceed with TDD-based development
  • minimize dependence
  • support all popular os

usage

  1. generate ssh key for test
  1. $ ssh-keygen
  1. add ~/.ssh/id_rsa ~/.ssh/id_rsa as home
  1. $ gowap add home
  2. enter file in which to add the private key (~/.ssh/id_rsa):
  3. enter file in which to add the public key (~/.ssh/id_rsa.pub):
  4. ...
  5. your ssh key is added as `home`
  1. hiding current ssh key for generate new ssh key
  1. $ gowap archive
  2. ssh key is archived *home -> archive
  1. generate new ssh key
  1. $ ssh-keygen
  1. add ~/.ssh/id_rsa ~/.ssh/id_rsa as company
  1. $ gowap add company
  2. enter file in which to add the private key (~/.ssh/id_rsa):
  3. enter file in which to add the public key (~/.ssh/id_rsa.pub):
  4. ...
  5. your ssh key is added as 'company'
  1. list all keys
  1. $ gowap list
  2. * company
  3. home
  1. situation: you clone your company’s private repository with company ssh-key
  1. $ git clone git@github.com:nickname/some-awesome-project.git
  1. you can edit and push because company ssh key has a permission for that
  1. $ touch some-changes
  2. $ git add some-changes
  3. $ git commit -m "add some-changes"
  4. $ git push origin master
  1. but you need to update your personal repository
  1. $ git clone git@github.com:personal-nickname/personal-project.git
  1. you can’t clone this repository bacause company ssh key hasn’t any permissions for access
  1. Permission denied (publickey).
  1. you can checkout your personal ssh key home
  1. $ gowap checkout home
  2. your now key is 'home'
  1. you can clone now
  1. $ git clone git@github.com:personal-nickname/personal-project.git

features

add

add without nuts name

this case, default nuts name set to home

  1. gowap add
  1. # output
  2. ? enter file in which to add the private key /Users/user/.ssh/id_rsa
  3. ? enter file in which to add the public key /Users/user/.ssh/id_rsa.pub
  4. ? `home` is already defined, Do you want to overwrite it? Yes
  5. INFO[0000] try to overwrite to `home` overwrite=true
  6. INFO[0000] new nuts has been added nuts=home

add with nuts name

  1. gowap add {:name}
  1. # output
  2. ? enter file in which to add the private key /Users/user/.ssh/id_rsa
  3. ? enter file in which to add the public key /Users/user/.ssh/id_rsa.pub
  4. INFO[0000] new nuts has been added nuts={:name}

add with git config

  1. gowap add --with git
  1. # output
  2. ? enter file in which to add the private key /Users/user/.ssh/id_rsa
  3. ? enter file in which to add the public key /Users/user/.ssh/id_rsa.pub
  4. INFO[0000] with git configuration git={"user": "xxx", "mail": "xxx", "autoSign": true, "signKey": "xxx"}
  5. INFO[0000] new nuts has been added nuts={:name}

remove

remove without nuts name

this case, default nuts name set to home

  1. gowap remove
  1. # output:
  2. ? are you sure? Yes
  3. INFO[0000] `home` nuts has been removed nuts=home

remove with nuts name

  1. gowap remove {:name}
  1. # output:
  2. ? are you sure? Yes
  3. INFO[0000] `{:name}` nuts has been removed nuts={:name}

list

show list of nuts

  1. gowap list
  1. # output
  2. * home
  3. company
  4. temporary
  5. user2

search list with keyword

keyword will include follows:

  • git config values
  • alias name
  • nuts name
  1. gowap list --keyword {:keyword}
  1. # output
  2. company | git user.name "kenneth ceyer"
  3. temporary | alias name "kenneth"

version

show current gowap version

  1. gowap version
  1. # output
  2. gowap version 0.0.1

:package: Installation

:yellow_heart: go

  1. $ go get github.com/KennethanCeyer/gowap
  2. $ gowap -v
  3. NAME:
  4. gowap - simple ssh swap tool
  5. USAGE:
  6. gowap.exe [global options] command [command options] [arguments...]
  7. VERSION:
  8. x.x.x
  9. AUTHOR:
  10. kenneth ceyer <https://github.com/KennethanCeyer>
  11. COMMANDS:
  12. add a add ssh profile
  13. remove, r . remove ssh profile
  14. list, l show list ssh profiles
  15. archive h archive ssh profile
  16. help, h show a list of commands or help for one command
  17. version, v show current gowap version
  18. ...
  19. GLOBAL OPTIONS:
  20. --help, -h show help
  21. --version, -v print the version
  22. ...

:broken_heart: linux (still yet not supported)

  1. $ apt-get install gowap

:broken_heart: Mac (still yet not supported)

  1. $ brew install gowap

:broken_heart: Windows (still yet not supported)

  1. $ choco install gowap

:mag: License

gowap is under Apache 2.0 license

you can, of course. download it, use it, modify it

FOSSA Status