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.
- 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
- it must follows cleancode rule
- proceed with TDD-based development
- minimize dependence
- support all popular os
- generate ssh key for test
$ ssh-keygen
- add
~/.ssh/id_rsa
~/.ssh/id_rsa
ashome
$ gowap add home
enter file in which to add the private key (~/.ssh/id_rsa):
enter file in which to add the public key (~/.ssh/id_rsa.pub):
...
your ssh key is added as `home`
- hiding current ssh key for generate new ssh key
$ gowap archive
ssh key is archived *home -> archive
- generate new ssh key
$ ssh-keygen
- add
~/.ssh/id_rsa
~/.ssh/id_rsa
ascompany
$ gowap add company
enter file in which to add the private key (~/.ssh/id_rsa):
enter file in which to add the public key (~/.ssh/id_rsa.pub):
...
your ssh key is added as 'company'
- list all keys
$ gowap list
* company
home
- situation: you clone your company's private repository with company ssh-key
$ git clone git@github.com:nickname/some-awesome-project.git
- you can edit and push because company ssh key has a permission for that
$ touch some-changes
$ git add some-changes
$ git commit -m "add some-changes"
$ git push origin master
- but you need to update your personal repository
$ git clone git@github.com:personal-nickname/personal-project.git
- you can't clone this repository bacause company ssh key hasn't any permissions for access
Permission denied (publickey).
- you can checkout your personal ssh key
home
$ gowap checkout home
your now key is 'home'
- you can clone now
$ git clone git@github.com:personal-nickname/personal-project.git
add
add without nuts name
this case, default nuts name set to
home
gowap add
# output
? enter file in which to add the private key /Users/user/.ssh/id_rsa
? enter file in which to add the public key /Users/user/.ssh/id_rsa.pub
? `home` is already defined, Do you want to overwrite it? Yes
INFO[0000] try to overwrite to `home` overwrite=true
INFO[0000] new nuts has been added nuts=home
add with nuts name
gowap add {:name}
# output
? enter file in which to add the private key /Users/user/.ssh/id_rsa
? enter file in which to add the public key /Users/user/.ssh/id_rsa.pub
INFO[0000] new nuts has been added nuts={:name}
add with git config
gowap add --with git
# output
? enter file in which to add the private key /Users/user/.ssh/id_rsa
? enter file in which to add the public key /Users/user/.ssh/id_rsa.pub
INFO[0000] with git configuration git={"user": "xxx", "mail": "xxx", "autoSign": true, "signKey": "xxx"}
INFO[0000] new nuts has been added nuts={:name}
remove
remove without nuts name
this case, default nuts name set to
home
gowap remove
# output:
? are you sure? Yes
INFO[0000] `home` nuts has been removed nuts=home
remove with nuts name
gowap remove {:name}
# output:
? are you sure? Yes
INFO[0000] `{:name}` nuts has been removed nuts={:name}
list
show list of nuts
gowap list
# output
* home
company
temporary
user2
search list with keyword
keyword will include follows:
- git config values
- alias name
- nuts name
gowap list --keyword {:keyword}
# output
company | git user.name "kenneth ceyer"
temporary | alias name "kenneth"
version
show current gowap version
gowap version
# output
gowap version 0.0.1
$ go get github.com/KennethanCeyer/gowap
$ gowap -v
NAME:
gowap - simple ssh swap tool
USAGE:
gowap.exe [global options] command [command options] [arguments...]
VERSION:
x.x.x
AUTHOR:
kenneth ceyer <https://github.com/KennethanCeyer>
COMMANDS:
add a add ssh profile
remove, r . remove ssh profile
list, l show list ssh profiles
archive h archive ssh profile
help, h show a list of commands or help for one command
version, v show current gowap version
...
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
...
$ apt-get install gowap
$ brew install gowap
$ choco install gowap
gowap is under Apache 2.0 license
you can, of course. download it, use it, modify it