Crates.io | yayo |
lib.rs | yayo |
version | 0.2.6 |
source | src |
created_at | 2020-11-01 21:16:13.863279 |
updated_at | 2024-03-30 17:20:02.132886 |
description | Manage and generate OTP (one time password) codes |
homepage | https://github.com/nickjer/yayo |
repository | https://github.com/nickjer/yayo |
max_upload_size | |
id | 307654 |
size | 68,184 |
A command line interface (CLI) used to manage and generate OTP (one time password) codes for your various accounts.
Install using cargo:
cargo install yayo
An alternative method is to download and run the pre-compiled binaries:
https://github.com/nickjer/yayo/releases
Check the help (--help
) for details on using this tool:
Manage and generate OTP (one time password) codes
Usage: yayo <COMMAND>
Commands:
add Add a new account
completion Output shell completion
delete Delete an account
list List all accounts
view View the code for an account
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
The add
subcommand is used to add an account:
Add a new account
Usage: yayo add [OPTIONS] <ACCOUNT> <SECRET>
Arguments:
<ACCOUNT> Name of the account
<SECRET> Secret key used to generate code
Options:
-a, --algorithm <ALGORITHM> Algorithm used to generate code [env: YAYO_ALGORITHM=] [default: SHA1] [possible values: SHA1, SHA256, SHA512]
-d, --digits <DIGITS> Number of digits composing code [env: YAYO_DIGITS=] [default: 6]
-s, --step <STEP> Duration in seconds of step [env: YAYO_STEP=] [default: 30]
-h, --help Print help
Note: For added security it stores all secrets in your operating system's local keyring.
Example: Add your GitHub account with provided secret (XXXXXXX
):
yayo add github XXXXXXX
Although it is not recommended, you can alter any of the arguments used in the
OTP code generation (algorithm
, digits
, and step
) as command line options
or through environment variables.
The delete
subcommand is used to delete a previously added account:
Delete an account
Usage: yayo delete <ACCOUNT>
Arguments:
<ACCOUNT> Name of the account
Options:
-h, --help Print help
Example: Delete the previously added GitHub account:
yayo delete github
The list
subcommand is used to list all available accounts and their provided
configurations:
List all accounts
Usage: yayo list
Options:
-h, --help Print help
The view
subcommand is used to output the OTP code generated for the
requested account:
View the code for an account
Usage: yayo view <ACCOUNT>
Arguments:
<ACCOUNT> Name of the account
Options:
-h, --help Print help
Example: View the OTP for the GitHub account:
$ yayo view github
389200
The completion
subcommand is used to output a shell script used to support
command completion for this binary:
Output shell completion
Usage: yayo completion <SHELL>
Arguments:
<SHELL> Name of the shell [possible values: bash, elvish, fish, powershell, zsh]
Options:
-h, --help Print help
Example: Output command completion for the fish shell:
yayo completion fish | source
Now you can use tab-completion with yayo
.
This is a simple walkthough on setting up the F12 key to populate the clipboard with the OTP code. This makes logging into GitHub or any other service as simple as pushing F12 and pasting the contents of the clipboard into the 2FA input.
You will need xsel
or some other CLI that can read the contents of STDOUT
to the clipboard:
sudo apt install -y xsel
If using Gnome 3 you can just open the control center and navigate to the "Keyboard Shortcuts" with:
gnome-control-center
Scroll to the bottom and set a "Custom" keyboard shortcut with the following options:
Name: OTP (GitHub) Command:
sh -c '~/bin/yayo view github | xsel --primary'
Shortcut: F12