Command-line tool

Share a secret straight from your terminal. The otp CLI encrypts the secret on your machine using the same zero-knowledge crypto as the website, then prints a one-time, self-destructing link. The server only ever receives ciphertext — the decryption key rides in the link's #fragment and never reaches us.

Requirements

Node.js 18 or newer (20/22 recommended). No packages to install — the script uses Node's built-in WebCrypto and fetch.

Install

Grab the single file and you're done:

curl -fsSL https://onetimepass.app/otp.mjs -o otp.mjs

Prefer to read it first? It's ~180 lines of plain JavaScript — open it before you run it.

Usage

# A secret as an argument
node otp.mjs "hunter2 is my prod DB password"

# ...or piped on stdin (handy for files and command output)
echo "$API_KEY" | node otp.mjs

# Expiry + how many times it can be opened
node otp.mjs --ttl 1h --views 2 "read me twice within the hour"

# Require a passphrase as a second factor (shared out of band)
node otp.mjs --pass "correct horse battery" "extra-protected secret"

# Attach a file alongside the message
node otp.mjs --file ./id_ed25519 "your new deploy key"

# Point at a self-hosted instance
node otp.mjs --host https://secrets.example.com "internal only"

Each run prints the shareable link, for example:

https://onetimepass.app/s/Yb3k…9fQ#R2t7…k1A

Options

--ttl
Lifetime: 10m, 1h, 1d (default), 7d, 30d, 90d.
--views
Number of times it can be opened, 1–10 (default 1).
--pass
Require this passphrase to open, mixed into the key (never sent to the server).
--file
Attach a file; encrypted with the same key as the message.
--host
Instance base URL (default https://onetimepass.app).
-h, --help
Show usage.

How it stays zero-knowledge

The CLI generates a random 256-bit key, encrypts your secret with AES-256-GCM locally, and uploads only the ciphertext. The key is placed after the # in the link, which browsers never send over the network — so neither we nor anyone reading our logs can decrypt your secret. It's the exact same scheme the website uses, so links created with the CLI open in any browser, and vice-versa.