Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/47ng/otpublish
CLI to generate OTP codes to publish on NPM with 2FA
https://github.com/47ng/otpublish
2fa npm-publish otp totp
Last synced: about 2 months ago
JSON representation
CLI to generate OTP codes to publish on NPM with 2FA
- Host: GitHub
- URL: https://github.com/47ng/otpublish
- Owner: 47ng
- License: mit
- Created: 2019-06-12T11:22:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-12T11:55:20.000Z (over 5 years ago)
- Last Synced: 2024-11-05T05:49:05.015Z (about 2 months ago)
- Topics: 2fa, npm-publish, otp, totp
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ⏱️🔐 `otpublish`
Generate a OTP token to publish on NPM with 2FA protection.
It will read the OTP secret key from the `OTP_SECRET_KEY` environment
variable, and print the generated OTP token to the standard output.## Installation
```shell
$ yarn global add otpublish
# or
$ npm i -g otpublish
```## Usage with `npm publish`
```shell
$ npm publish --otp $(otpublish)
```## Security
⚠️ Keep your 2FA OTP secret key safe ! Don't store it unencrypted, and beware of shell history.
You can use some [native tools](https://stackoverflow.com/questions/749544/pipe-to-from-the-clipboard-in-bash-script)
to paste from the clipboard when running in interactive mode to avoid
it showing on the command history, and if using it on a CI server, make
sure they encrypt your secret environment variables. If they don't, you
should probably look for another service.