A standalone CLI for ZeroBin and PrivateBin v2 instances. Encrypts content client-side with AES-256-GCM, uploads only ciphertext, and prints a share URL whose decryption key lives in the URL fragment.
Zero runtime dependencies. Node.js 18+.
Run via npx (no install):
npx zerobin-cli --helpOr install globally:
npm install -g zerobin-cli
zerobin --helpzerobin create [options] # Reads stdin or --file, prints share URL
zerobin read <url> [options] # Decrypts and prints plaintext
zerobin delete <url> <token> # Deletes a paste
echo "secret note" | zerobin create
# → https://zerobin.cc/?abc123def4567890#3F4xK...
# stderr: Delete token: d7e694f8...The share URL is printed to stdout, the delete token to stderr. Use --json for both in one structured payload:
echo "data" | zerobin create --jsonzerobin read "https://zerobin.cc/?abc...#key..."zerobin delete "https://zerobin.cc/?abc...#key..." <deletetoken>| Flag | Default | Description |
|---|---|---|
--server <url> |
$ZEROBIN_SERVER or https://zerobin.cc |
Target server |
--json |
off | Structured output |
--help |
Show help | |
--version |
Print version |
| Flag | Default | Description |
|---|---|---|
--file <path> |
stdin | Read content from file |
--expire <when> |
1week |
5min / 10min / 1hour / 1day / 1week / 1month / 1year / never |
--burn |
off | Self-destruct on first read |
--discussion |
off | Enable encrypted comments |
--password <pass> |
none | Add password protection |
--format <fmt> |
plaintext |
plaintext / syntaxhighlighting / markdown |
| Flag | Description |
|---|---|
--password <pass> |
Required if paste is password-protected |
| Env var | Effect |
|---|---|
ZEROBIN_SERVER |
Default server URL (overridden by --server) |
Burn-after-reading with custom expiry:
echo "one-time secret" | zerobin create --burn --expire 1hourPipe a command's output:
git diff | zerobin create --format syntaxhighlighting
kubectl logs my-pod 2>&1 | zerobin create --expire 1hourCapture URL and delete token:
result=$(echo "data" | zerobin create --json)
url=$(echo "$result" | jq -r .url)
token=$(echo "$result" | jq -r .deletetoken)Custom server:
echo "internal" | zerobin create --server https://paste.example.com- A 256-bit key is generated locally with
crypto.getRandomValuesand Base58-encoded into the URL fragment. Browsers do not transmit URL fragments in HTTP requests, so the server never receives the key. - Encryption uses AES-256-GCM with a key derived via PBKDF2-SHA256 (100,000 iterations). The
adataarray (cipher params, formatter, flags) is bound as authenticated additional data. - Anyone with the full URL (including
#key) can decrypt. Treat the URL like a password. --passwordadds a second factor: even if the URL leaks, the password is still required.--burnis best-effort: the server deletes after the first successful read, but a recipient could screenshot the result before the burn completes.
Wire-compatible with the PrivateBin v2 API. Pastes created with this CLI are readable in any PrivateBin or ZeroBin browser frontend, and vice versa.
npm install
npm run build
npm testApache-2.0