Secret Share Share a secret

Share secrets from the terminal

Quick start

  1. Send — the secret is read from stdin and encrypted before anything leaves your machine:
    cat id_ed25519 | npx shareasecret@0.1.5 send --ttl 2h
    You get a share code like XKQ2-M7PT-tiger-ocean-cable-ruby-drum and a link. Speak the code over a call or send the link over any channel. (Examples pin the version — see why; check npm for the latest.)
  2. Receive — run it without the code and it prompts with input hidden, keeping the code out of your shell history; --output writes the file with 0600 permissions from the first byte:
    npx shareasecret@0.1.5 receive --output id_ed25519
  3. Sent the wrong thing? Burn it before anyone reads it — npx shareasecret@0.1.5 revoke prompts for the code the same way.

Sending

Receiving

Scripting

Exit codes are stable, so automation can branch on what happened:

CodeMeaning
0Success
1Network or unexpected error
2Usage error (bad flag, malformed code, empty stdin)
3Wrong code words — the error reports attempts left before the drop burns
4No drop at that code (expired, revoked, or never existed)
5Already read or burned
6Secret exceeds 10 KB

A typical handoff: generate a credential, send it, and post the code — never the credential — to the channel where your teammate is waiting. The $(…) capture keeps the code out of the job log provided shell tracing (set -x) is off; the final echo then discloses it only to the delivery channel, deliberately:

TOKEN=$(create-scoped-token --expires 7d)
CODE=$(printf '%s' "$TOKEN" | npx shareasecret@0.1.5 send --ttl 2h)
echo "Your token: shareasecret.io/r#$CODE (single read, dead in 2h)"

One caveat that can't be engineered away: whatever channel you post the code to can read the secret once. That's the read-once design — interception is a visible race, not a silent copy — but choose the channel accordingly.

What the CLI does and doesn't do

No terminal on the other end? The code you send works right here in the browser too.

Share a secret →