Home

Awesome

cloak

A Command Line OTP (One Time Password) Authenticator application written in Rust that generates time-based and counter-based OTP codes.

CI codecov License Crates.io version

Motivation

Example

<p align="center"> <img src="https://cdn.rawgit.com/evansmurithi/cloak/6d113aa8376b04cce12b64261962750532997e64/assets/cloak_example.svg"> </p>

Installation

To install cloak, you can do either of the following:

  1. Binaries

    You can download the binaries here. Make sure to put the path to the binary into your PATH.

    Alternatively, you can install cloak via the scoop package manager with the following command:

    scoop install cloak
    
  2. Crates.io

    Once you've installed Rust, install cloak by typing the following in the terminal:

    cargo install cloak
    

    This will download and compile cloak. After this is finished, add the Cargo bin directory to your PATH.

Usage

The sub-commands included in cloak are as follows:

$ cloak -h
cloak 0.1.0
Evans Murithi <murithievans80@gmail.com>
A Command Line OTP Authenticator application.

USAGE:
    cloak [SUBCOMMAND]

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    add               Add a new account
    delete            Delete an account
    help              Prints this message or the help of the given subcommand(s)
    list              List OTP for all accounts
    view              View the OTP for an account

To view the help of any of the subcommands below, add -h or --help, e.g. cloak add -h.

Customization

By default cloak stores your accounts and recovery codes inside a .cloak/ directory found inside your $HOME folder if you are on Linux or macOS, or inside your user profile folder if you are on Windows.

To alter this, you can use the CLOAK_ACCOUNTS_DIR environment variable to point cloak to the directory to use for storing your accounts and recovery codes:

export CLOAK_ACCOUNTS_DIR='/save/accounts/here/'  # absolute path

Contributions

If you want to contribute to cloak you will have to clone the repository on your local machine:

$ git clone https://github.com/evansmurithi/cloak.git

To build, cd into cloak/ and run:

$ cargo build

To run tests:

$ cargo test