Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chunkhang/simple-totp
A simple TOTP CLI
https://github.com/chunkhang/simple-totp
cli otp python totp
Last synced: 11 days ago
JSON representation
A simple TOTP CLI
- Host: GitHub
- URL: https://github.com/chunkhang/simple-totp
- Owner: chunkhang
- License: mit
- Created: 2021-02-21T15:51:01.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-13T16:40:06.000Z (3 months ago)
- Last Synced: 2024-10-19T11:31:31.027Z (3 months ago)
- Topics: cli, otp, python, totp
- Language: Python
- Homepage: https://pypi.org/project/simple-totp/
- Size: 82 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# simple-totp
> A simple TOTP CLI
Tired of fumbling around with Google Authenticator just to generate a simple
[TOTP](https://en.wikipedia.org/wiki/Time-based_One-Time_Password) 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](./img/demo.gif)
## 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:```yaml
totp:
- secret: 7TO66UM5PZ2M5CB2GWZMYZX5YAVWATQX
```To generate multiple TOTP tokens with proper namespacing:
```yaml
totp:
- issuer: google
name: [email protected]
secret: 7TO66UM5PZ2M5CB2GWZMYZX5YAVWATQX
- issuer: facebook
name: [email protected]
secret: HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ
```By default, `simple-totp` 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:```yaml
totp:
- issuer: google
name: [email protected]
secret: 7TO66UM5PZ2M5CB2GWZMYZX5YAVWATQX
digits: 10
interval: 60
```## Development
Before developing, make sure [just](https://github.com/casey/just) is
installed. This project uses `just` as the command runner instead of the
usual `make`.Start a [virtualenv](https://pypi.org/project/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
```