sxzz/unotp

Automatically complete npm OTP 2FA.

★ 7Forks 0TypeScriptGitHub ↗Compare

README

unotp

npm version npm downloads Unit Test

Automatically complete npm OTP 2FA.

Installation

npm install -D unotp

Setup

1Password

  1. Install the 1Password CLI.
  2. Set the UNOTP_1PASSWORD_KEY environment variable to the name of your npm item in 1Password, or use op items list to find the item ID.

You can add this setting to your shell profile for convenience.

Bash / Zsh

export UNOTP_1PASSWORD_KEY=npm

Fish

set -gx UNOTP_1PASSWORD_KEY npm

Custom Command

You can also use a custom command to retrieve the OTP. Set the UNOTP_CUSTOM_CMD environment variable to your command.

export UNOTP_CUSTOM_CMD="echo 123456"

Usage

CLI

npx unotp <command>
# Example:
npx unotp npm publish

Add to scripts in package.json

{
  "scripts": {
    "release": "unotp npm publish"
  }
}

Sponsors

License

MIT License © 2025 Kevin Deng

Contributors

renovate[bot]sxzz

Issues