Every team has the same leak. Someone needs a database password, an API key or a .env file, and it goes into Slack or email, where it stays searchable for years in a system you don't control.

A one-time secret link fixes most of that: the recipient opens the link once, reads the secret, and the link stops working. This post shows how to do it from the terminal with the LinkPilot CLI, and why the encryption happens on your machine rather than on a server.

Install and sign in

npm install -g linkpilot linkpilot login 

login stores your API key in your OS config directory with 0600 permissions. In CI, use the LINKPILOT_API_KEY environment variable instead. linkpilot whoami shows a masked key and your plan; the full key is never printed.

Share a secret

Pipe it in:

echo 'db password: hunter2' | linkpilot secret --ttl 1h 

Or from a file:

linkpilot secret < credentials.txt 

Or run linkpilot secret with no arguments and type it at a hidden prompt.

You get back a link like this:

https://shrd.link/s/abcdefghij#k=… 

Send that whole link. The recipient opens it once and the secret is destroyed.

Why you should pipe it, not pass it

This works, but don't:

linkpilot secret 'hunter2' 

An argument lands in your shell history and is visible to other users on the machine through ps while the command runs. The CLI prints a warning when you do it. Piping or the hidden prompt avoids both.

What the #k= part is

The decryption key is generated on your machine and placed after the # in the link. Browsers never send the fragment to a server, so the key never leaves the people holding the link. LinkPilot's API refuses plaintext outright: POST /secrets only accepts ciphertext, so any client has to encrypt before it sends.

Two consequences worth knowing:

  • Nobody at LinkPilot can read the secret, including if its database leaks.
  • If you lose the printed link, the secret is gone. There is no recovery, by design.

Useful options

linkpilot secret --ttl 30m # expire after 30 minutes (also 2h, 7d, or seconds) linkpilot secret --passphrase # recipient also needs a passphrase you share separately linkpilot secret --no-burn # allow more than one view linkpilot secret --quiet # print only the URL 

--quiet makes it scriptable. For example, hand a short-lived token to a contractor from a script:

URL=$(echo "$TOKEN" | linkpilot secret --ttl 30m --quiet) echo "Your token (opens once, expires in 30 minutes): $URL" 

Revoke one you sent by mistake

linkpilot secrets # list your secrets (metadata only, never contents) linkpilot revoke <id> # kill the link before it's opened 

From code instead

The CLI is built on a typed SDK that does the same client-side encryption:

import { LinkPilot } from "@uselinkpilot/sdk"; const lp = new LinkPilot({ apiKey: process.env.LINKPILOT_API_KEY }); const secret = await lp.secrets.create({ secret: "db password: hunter2", ttlSeconds: 3600 }); console.log(secret.shareUrl); // send shareUrl, never secretUrl 

The SDK has no dependencies and uses only WebCrypto, so it runs on Node 20+, Deno, Bun, browsers and edge runtimes. Its test suite runs the same known-answer vectors as the LinkPilot web app, so you can check the encryption yourself with npm test.

Disclosure

I build LinkPilot. The CLI and SDK are MIT-licensed and the API is available on the free plan. Source: https://github.com/TetraCoreHQ/linkpilot-cli