Skip to content

Commit

Permalink
v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
taekop committed Feb 8, 2022
1 parent 0e53008 commit 1533f52
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Formula/totp.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class Totp < Formula
desc "TOTP CLI"
homepage "https://github.com/taekop/homebrew-totp"
version "1.0"

url "https://github.com/taekop/homebrew-totp/releases/download/v1.0/totp-1.0.tar.gz"
sha256 "a64b45653a3bc692d46159db3ddcb73fc45c1f63656b6e50ece2edf0e7868275"

def install
bin.install "bin/execute" => "totp"
libexec.install "libexec/main"
libexec.install "libexec/totp"
libexec.install "libexec/yaml_config"
libexec.install "libexec/pretty_print"
end
end
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,62 @@
# homebrew-totp

TOTP CLI

Support Google-Authenticator spec as default.

| Hash | Period | Digit | Key |
|:----:|:------:|:-----:|:--------------:|
| HMAC-SHA1 | 30s | 6 | Base32 encoded |

## Install

```
brew tap taekop/totp
brew install totp
```

## How to use

### Save name and key

Configuratinon file is stored at ${HOME}/.totp-config

You can give force option (-f) to overwrite.

You can assign hash algorithm (-h), period (-t), digit (-g).

For not Base32 encoded key, give pure option (-p).

(ex) MFA key for aws. Choose virtual device -> Google Authenticator.

```
totp -n aws -k <key>
totp -n aws -k <key> -f
totp -n aws -k <key> -h sha256 -r 15 -g 8
totp -n aws -k <key> -p
```

### Get otp code

```
totp -n aws
```

### See list

```
totp -l
totp -al
```

### Delete

```
totp -d -n <name>
```

### For more details

```
totp
```

0 comments on commit 1533f52

Please sign in to comment.