sharerare
Send files between devices on the same network, from the terminal. The files go directly from one device to the other over an encrypted WebRTC link. They never touch a server.
It works together with the web app at sharerare.live: a terminal running sharerare shows up as a device in the browser, and sees what browsers share.
npx sharerare send report.pdf
Requires Node.js 22 or newer. Prebuilt for macOS, Linux and Windows (x64 and ARM); nothing to compile.
Commands
sharerare send report.pdf photos.zip # share until Ctrl+C
sharerare send ~/Pictures/Holiday # a whole folder, with its subfolders
sharerare note "https://example.com" # share a note or a link
echo "build 4512 is green" | sharerare note
sharerare ls # devices nearby and what they share
sharerare get # pick from a list (arrow keys, space, Enter)
sharerare get report.pdf # download by name, or part of a name
sharerare get --all --from iPhone -o ~/Downloads
sharerare get --all --zip # everything as one .zip
sharerare cat notes.md # print a shared text file or note
A bare get opens a list of everything shared nearby, grouped by device and folder. Use ↑ ↓ to move, Space to tick a file or a whole folder, a for everything, / to filter, Enter to download and q to quit. With nothing ticked, Enter takes the highlighted row.
Shared folders keep their structure: get recreates the same folders under the output folder, and --zip keeps them inside the archive. Hidden files (names starting with a dot) are left out, and one run shares at most 500 files.
get writes each file as name.part and renames it when it is complete. An existing file is never overwritten: a second report.pdf is saved as report (1).pdf.
cat prints to the terminal and refuses binary files there; redirect it instead (sharerare cat photo.jpg > photo.jpg), or use get.
When a device doesn't show up
Devices that reach the internet through the same router find each other by themselves. When they don't (a phone on mobile data, a VPN, a guest network), pair them:
sharerare send report.pdf --pair
This draws a QR code in the terminal. Scan it with a phone and the page opens already paired. You can also type the six-character code into "Pair a device" on the other device, or join another device's code from the terminal:
sharerare get --all --code K7M2QX
--hidden keeps the terminal off the network so only paired devices see it.
Over the internet (opt-in)
By default links only form on the local network: no STUN or TURN server is used, so a device can't be reached from outside it. With --internet, a device you paired with that has "Allow links over the internet" turned on can link to you directly across networks. Each side then learns the other's public IP address. Devices you paired with are told, through the pairing service, whether --internet is on and which network label this machine has, so a phone can say what is missing instead of only failing. A linked device is also told the name of this machine's provider, as the pairing service reports it, so a page can name this network on its route line. Bytes still go device to device; there is no relay, so this fails on networks that block direct connections (common on mobile data).
Faster between two terminals
When both ends run sharerare, files go over a direct TLS socket instead of WebRTC, several times faster (1 GB in about 2.5 s instead of 14 s on one machine). It is just as private. The key is made fresh for each file, sent inside the encrypted WebRTC link, and works once. The socket is TLS 1.2 ECDHE-PSK (mutual, forward-secret). It only goes to the address the WebRTC link already uses, so the local-network and --internet rules stay the same. If it can't connect, the file goes over WebRTC as before.
Options
| Option |
|
--pair |
send/note: show a QR code and a code for pairing |
--code <CODE> |
Join another device's pairing code |
--hidden |
Don't appear on the network; only paired devices see you |
--internet |
Allow direct links over the internet with paired devices that allow it too |
--from <device> |
get/cat: only from this device |
-o, --out <dir> |
get: folder to save into |
--zip [name.zip] |
get: save as one .zip (a folder per device when there are several) |
--name <name> |
How this device appears to others (default: host name) |
--url <url> |
Use another Sharerare site (or set SHARERARE_URL) |
--wait <seconds> |
How long to look for devices (default 15) |
--port <port> |
get: port for the fast path to listen on (default: any free port) |
--webrtc-only |
Don't use the fast path between two terminals |
--json |
ls: machine-readable output |
What the pairing service sees
The site at sharerare.live introduces devices to each other. It sees your public IP address (to group devices on the same network), a random id per run, and WebRTC connection setup data. It never sees file names, file contents, notes or device names: those travel only over the direct link.
Licence
MIT. Includes uqr (MIT) for the QR code.