#totp #password #secret #time #clipboard #otp #stoken

bin+lib otpcli

A simple one-time-password CLI, with support for TOTP and STOKEN

35 releases (1 stable)

1.0.0 Jul 26, 2020
0.5.5-beta.1 May 3, 2020
0.5.4 Apr 2, 2020
0.5.4-rc.1 Mar 8, 2020
0.3.0 Sep 15, 2018

#752 in Authentication

Download history 105/week @ 2024-02-22 53/week @ 2024-02-29 1/week @ 2024-03-07 2/week @ 2024-03-14

161 downloads per month

MIT license

29KB
598 lines

OTP Cli

Crates.io Build Status

A one time password library and CLI tool for generating time-based one time passwords. Also supports RSA Secure tokens (using the rust stoken library)

Installing

You can install with cargo

cargo install otpcli

Features

  • [DEFAULT] copy: build with copy to clipboard support. Adds a --copy cli option.
  • [DEFAULT] keychain: build with secure secret storage support using keyring.
  • rsa_stoken: add in stoken support using the stoken crate.

The copy feature uses clipboard and that requires a X11 on linux to access the clipboard

CLI

A simple one-time-password CLI, with support for TOTP and STOKEN.

USAGE:
    otpcli [FLAGS] [name] [SUBCOMMAND]

FLAGS:
        --copy       Copies the generated token to the clipboard
    -n, --newline    Adds a newline printed at the end out output
    -h, --help       Prints help information
    -V, --version    Prints version information
    -v, --verbose

ARGS:
    <name>    The name of the totp token to generate

SUBCOMMANDS:
    add                    Add/Update a new TOTP secret
    delete                 Add/Update a new TOTP secret
    generate               Generate a token
    help                   Prints this message or the help of the given subcommand(s)
    import                 Import an RSAToken into otpcli (if built with the stoken flag)
    list                   Add/Update a new TOTP secret
    migrate-to-keychain    Migrate secrets stored in the config to be stored in the keychain

Release process

Releases of otpcli are fully automated using GitHub Actions and initiated from cargo-release. To trigger a new release, run cargo release <version_change> where <version_change> is one of the support cargo release options:

  • alpha
  • beta
  • rc
  • patch
  • minor
  • major

Dependencies

~6–19MB
~236K SLoC