Skip to main content

A simple TOTP CLI

Project description

simple-totp

A simple TOTP CLI

Tired of fumbling around with Google Authenticator just to generate a simple TOTP token? Well, simple-totp is the simplest TOTP CLI you will ever need. Just set it up once, and you are ready to go. simple-totp offers nothing fancy beyond printing out TOTP tokens on the terminal.

Demonstration

demonstration

Installation

It should be quite easy to install simple-totp, provided you have python >= 3.

pip install simple-totp

Usage

Running simple-totp cannot be simpler.

otp

Configuration

simple-totp reads from the configuration file in ~/.otp.yml to generate TOTP tokens. All secrets are stored there as plain text, so just be mindful about it.

Here is the minimal configuration needed to verify that simple-totp is working properly:

totp:
  - secret: 7TO66UM5PZ2M5CB2GWZMYZX5YAVWATQX

To generate multiple TOTP tokens with proper namespacing:

totp:
  - issuer: google
    name: test@example.com
    secret: 7TO66UM5PZ2M5CB2GWZMYZX5YAVWATQX
  - issuer: facebook
    name: test@example.com
    secret: HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ

By default, otp generates 6-digit TOTP tokens where the refresh interval is every 30 seconds. If you need to override this behavior, you may try the following:

totp:
  - issuer: google
    name: test@example.com
    secret: 7TO66UM5PZ2M5CB2GWZMYZX5YAVWATQX
    digits: 10
    interval: 60

Development

Before developing, make sure just is installed. This project uses just as the command runner instead of the usual make.

Start a virtualenv if needed. It is highly recommended for development.

Install the dependencies for the project:

just setup

After that, install simple-totp in editable mode:

just install

Now, you can start developing. You can run the CLI directly:

otp

Distribution can be done with:

just publish

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple-totp-1.1.0.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

simple_totp-1.1.0-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page