The burnthesecret CLI
npm v0.1.1Share passwords, API keys and other secrets as one-time, self-destructing links, straight from your terminal. Pipe a secret in, get a link out. The secret is encrypted on your machine, so nobody at Burn the Secret can read it.
printf '%s' "$DB_PASSWORD" | npx burnthesecret@0.1.1
# https://burnthesecret.com/secret/K7fq…#key=…- End-to-end encrypted. AES-256-GCM, done locally before anything is sent.
- Self-destructing. One view and 24 hours by default; you choose.
- No install needed. Run it with npx. Zero runtime dependencies, Node.js 18+.
- Scriptable. One line of output, or
--jsonfor pipelines.
Install
Run it on demand with npx, or install it globally. It works on macOS, Linux and Windows.
# run without installing
npx burnthesecret@0.1.1 --help
# or install once
npm install -g burnthesecret
burnthesecret --helpUsage
The CLI prints a single URL. Share that link. Once it has been viewed, or once it expires, the secret is gone.
# from stdin (recommended: keeps the secret out of shell history and ps)
printf '%s' "$DB_PASSWORD" | burnthesecret
# from a file
burnthesecret < token.txt
# as an argument (convenient, but it lands in your shell history; the CLI warns)
burnthesecret "hunter2"
# expire after 1 hour, allow 3 views, require a passphrase
BURNTHESECRET_PASSPHRASE="over-the-phone" burnthesecret --ttl 3600 --views 3 < token.txt
# one link for a whole team: stop any one recipient from burning it early
echo "wifi: hunter2" | burnthesecret --views 10 --no-burnOptions
| Flag | Default | Description |
|---|---|---|
| -t, --ttl <seconds> | 86400 (24h) | Expiry in seconds. Minimum 1800 (30 minutes). |
| -v, --views <n> | 1 | Views before the secret self-destructs, or unlimited. |
| -p, --passphrase <pass> | $BURNTHESECRET_PASSPHRASE | Require a passphrase to view (8 to 256 characters). Prefer the environment variable so it stays out of your shell history and process list. |
| --no-burn | burning allowed | Hide the Burn button so recipients can't destroy the secret early. Useful when one link goes to several people. |
| --api-key <key> | $BURNTHESECRET_API_KEY | A bts_live_… key (older ks_live_… keys also work) that attributes the secret to your account and unlocks signed-in limits. |
| --api-url <url> | https://burnthesecret.com | Base URL of the server. Must be https:// (plain http is only allowed for localhost). |
| --json | off | Print a JSON object instead of the bare link. See JSON output. |
| -h, --help | Show help. | |
| --version | Print the version. |
Signed-in accounts get higher limits (larger secrets, longer expiry, more views). Pass an API key to use them.
Environment variables
| BURNTHESECRET_API_KEY | Your API key. Create one under API Access after signing in. Optional. |
| BURNTHESECRET_PASSPHRASE | Passphrase the recipient must enter. Same as --passphrase, but kept out of argv. |
JSON output
With --json the CLI prints an object instead of the bare link. receiptUrl is your private status page for the secret, where you can see whether it has been opened. Errors go to stderr with a non-zero exit code, so set -e scripts stop on failure.
$ echo "token" | burnthesecret --json
{
"url": "https://burnthesecret.com/secret/K7fq…#key=…",
"receiptUrl": "https://burnthesecret.com/receipt/9xQ2…",
"expiresAt": "2026-11-04T09:30:00.000Z",
"maxViews": 1,
"hasPassphrase": false
}CI and scripts
Pin an exact version in automation (burnthesecret@0.1.1) so a future release can never change what your pipeline runs with your secrets.
GitHub Actions
Pass the secret through env, never inline in the script, and mask the link before it can reach the log.
# .github/workflows/hand-off-credential.yml
- name: Create a one-time link for the new credential
id: secret
env:
SECRET: ${{ secrets.DEPLOY_TOKEN }}
BURNTHESECRET_API_KEY: ${{ secrets.BURNTHESECRET_API_KEY }} # optional
run: |
url=$(printf '%s' "$SECRET" | npx --yes burnthesecret@0.1.1 --ttl 3600 --views 1)
echo "::add-mask::$url"
echo "url=$url" >> "$GITHUB_OUTPUT"
- name: Send the link
run: ./notify.sh "${{ steps.secret.outputs.url }}" # Slack, email, ticket…Any shell script
#!/usr/bin/env bash
# Generate a temporary password and hand it over as a one-time link.
set -euo pipefail
PASSWORD=$(openssl rand -base64 24)
# ...set it on the account you're provisioning...
LINK=$(printf '%s' "$PASSWORD" | npx burnthesecret@0.1.1 --ttl 1800 --views 1)
echo "Send this to the new starter: $LINK"How it works
- The CLI generates a random 256-bit key and encrypts your secret locally with AES-256-GCM.
- It uploads only the ciphertext and IV, along with the expiry, view limit and passphrase setting.
- It prints a link whose
#key=fragment holds the decryption key. Fragments are never sent in HTTP requests, so the server never sees the key. - The recipient's browser fetches the ciphertext and decrypts it locally. Once the view limit is reached, the ciphertext is deleted.
It's the same scheme the website uses, which is why CLI links open in any browser. To do this from another language, see the API reference.
Security notes
- Anyone with the full link can read the secret. Treat the link like the secret, and send any passphrase over a different channel.
- The passphrase is checked by the server (salted KDF) before it releases the ciphertext. It protects against someone who has the link; it is not mixed into the encryption key.
- Pipe secrets through stdin and use
BURNTHESECRET_PASSPHRASEandBURNTHESECRET_API_KEY, so nothing sensitive ends up in shell history or the process list. - The CLI refuses plain
http://API URLs and warns if TLS verification is turned off.
More background: One-time links, explained and How secure are one-time links?