Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kennethanceyer/gowap

:lock: ssh key manager written in go
https://github.com/kennethanceyer/gowap

cli golang ssh ssh-key ssh-manager

Last synced: about 6 hours ago
JSON representation

:lock: ssh key manager written in go

Awesome Lists containing this project

README

        



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](https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29)
- proceed with TDD-based development
- minimize dependence
- support all popular os

#### usage

1. generate ssh key for test

```bash
$ ssh-keygen
```

2. add `~/.ssh/id_rsa` `~/.ssh/id_rsa` as `home`

```bash
$ 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`
```

3. hiding current ssh key for generate new ssh key

```bash
$ gowap archive
ssh key is archived *home -> archive
```

4. generate new ssh key

```bash
$ ssh-keygen
```

5. add `~/.ssh/id_rsa` `~/.ssh/id_rsa` as `company`

```bash
$ 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'
```

6. list all keys

```bash
$ gowap list
* company
home
```

7. situation: you clone your company's private repository with company ssh-key

```bash
$ git clone [email protected]:nickname/some-awesome-project.git
```

8. you can edit and push because company ssh key has a permission for that

```bash
$ touch some-changes
$ git add some-changes
$ git commit -m "add some-changes"
$ git push origin master
```

9. but you need to update your personal repository

```bash
$ git clone [email protected]:personal-nickname/personal-project.git
```

10. you can't clone this repository bacause company ssh key hasn't any permissions for access

```bash
Permission denied (publickey).
```

11. you can checkout your personal ssh key `home`

```bash
$ gowap checkout home
your now key is 'home'
```

12. you can clone now

```bash
$ git clone [email protected]:personal-nickname/personal-project.git
```

#### features

**add**

add without nuts name

> this case, default nuts name set to `home`

```bash
gowap add
```

```bash
# 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

```bash
gowap add {:name}
```

```bash
# 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

```bash
gowap add --with git
```

```bash
# 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`

```bash
gowap remove
```

```bash
# output:
? are you sure? Yes
INFO[0000] `home` nuts has been removed nuts=home
```

remove with nuts name

```bash
gowap remove {:name}
```

```bash
# output:
? are you sure? Yes
INFO[0000] `{:name}` nuts has been removed nuts={:name}
```

**list**

show list of nuts

```bash
gowap list
```

```bash
# output
* home
company
temporary
user2
```

search list with keyword

> keyword will include follows:
> - git config values
> - alias name
> - nuts name

```bash
gowap list --keyword {:keyword}
```

```bash
# output
company | git user.name "kenneth ceyer"
temporary | alias name "kenneth"
```

**version**

show current gowap version

```bash
gowap version
```

```bash
# output
gowap version 0.0.1
```

## :package: Installation

#### :yellow_heart: go

```bash
$ 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

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
...
```

#### :broken_heart: linux (still yet not supported)

```bash
$ apt-get install gowap
```

#### :broken_heart: Mac (still yet not supported)

```bash
$ brew install gowap
```

#### :broken_heart: Windows (still yet not supported)

```bash
$ choco install gowap
```

## :mag: License

gowap is under Apache 2.0 license

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

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FKennethanCeyer%2Fgowap.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FKennethanCeyer%2Fgowap?ref=badge_large)