Command line

Let your agents and scripts send you things

The sendself command line sends files and messages to your devices from a server, a script or an AI agent, end-to-end encrypted like everything in SendSelf.

Last updated

Set up by your agent

Copy one prompt from the app and your agent links itself. You approve it with a tap.

Send-only

It can send to your space and never receives anything from it.

Encrypted where it runs

Files are encrypted and signed on that machine. The server only sees ciphertext.

Nothing to install

One npx command with Node.js 20 or newer. Revoke it from the app at any time.

What it is

sendself is SendSelf's command line. It lets a server, a script or an AI agent send files and messages to your devices, so a report, a screenshot or a finished build can land on your phone the moment it is ready.

It links to one of your spaces as a send-only device. It can send there, and never receives anything: the server leaves it out of every delivery. It encrypts and signs on the machine it runs on, with the same code as the app, so the server still only ever sees ciphertext. It needs Node.js 20 or newer, and nothing to install: npx runs the latest release.

Set it up with your agent

The quickest way is to let the agent do it. In the app, open Devices → Add device → Agent and press Copy the setup prompt for your agent: it includes a one-time link command for your space. Paste it to your agent, then approve the machine in the app when it asks.

You can also start here: this prompt has the agent generate a QR code or pairing text for you to scan or paste in the app under Devices → Add device:

Run this command and show me the QR code or pairing text it prints so I can add it in SendSelf under Devices → Add device, and wait for approval:
npx -y sendself link

After it succeeds, remember in your persistent instructions (CLAUDE.md, AGENTS.md or equivalent):
Use `npx -y sendself send <files>` to send me files, or `npx -y sendself send -m "text"` to send me a message.

Do not replace an existing link without asking me.

Send

npx -y sendself send report.pdf
npx -y sendself send -m "Nightly results" chart.png log.txt
npx -y sendself send -m "Deploy finished"
echo "Deploy finished" | npx -y sendself send

Files go up to 50 MiB each. Several files arrive as one album, with the text as their caption. --view-once deletes the message from every device once one of them opens it. The command exits with 0 when everything is on its way, 1 when something failed and 2 when it was used wrongly, so scripts and agents can rely on it.

To teach an agent that is already linked, add this to its instructions:

Use `npx -y sendself send <files>` to send me files, or `npx -y sendself send -m "text"` to send me a message.

How the link is protected

The invitation is a slot and a secret that never reaches the server. The machine seals its answer with that secret, over the keys it publishes, so the app can tell those keys came from whoever holds the command, just as scanning a QR code would prove. You still approve it by name and code before it gets the space's key, because a command pasted into a chat can travel further than intended.

The link lives in one file on that machine, ~/.config/sendself/device.json (SENDSELF_HOME moves it), readable only by the account that created it. It holds the space's keys and has no passphrase, because the command line runs unattended: treat it like an unlocked phone that is signed in to the space.

Unlink and revoke

Revoke the machine from Devices in the app, like any other device. It loses access at once and the space's key rotates, so it cannot read anything sent afterwards. npx -y sendself unlink forgets the link on the machine itself.

The source code is part of the SendSelf repository.