Share.Ninja

The command line

sninja sends and receives shares from a terminal. Same links, same encryption, same account as the apps: files are encrypted on your machine before anything leaves it, and a link made here opens in any browser. Source available at github.com/ShareNinjaHQ/share.ninja.

Install

macOS 13 or later on Apple silicon, with Homebrew. First, add the Share.Ninja tap:

brew tap shareninjahq/sninja

Then install the command line:

brew install shareninjahq/sninja/sninja

Windows: coming soon.

Check the install with sninja --version.

Send a link

sninja put report.pdf photos/

Uploads the files, encrypted, and prints the link. Send the link anywhere; it opens in any browser, no app and no account on the other side.

A directory name shares the directory itself. A trailing slash, or a glob, shares only what is inside it:

sninja put build # a folder named build sninja put build/ # the contents of build

Options:

-d "Q3 slides"
Gives the share a description, shown to whoever opens it.
--validity 12h
How long the link lives: seconds, or 90s, 15m, 12h, 7d, 2w. 0 means as long as you keep it. The default is seven days. Anything longer than your plan allows is cut to the plan's maximum, and the command says so.
--streams 1
Uploads one file at a time; the default is five in parallel.

Receive

Look before you download:

sninja list 'https://share.ninja/#…' --tree

--table shows sizes and dates instead, --path docs starts inside a folder, --non-recursive lists one level. Then:

sninja get 'https://share.ninja/#…' -o ~/Downloads

The share lands under the output directory, which defaults to the current one. Quote the link: the # means something to the shell.

--filter 'docs/**/*.pdf'
Downloads only the files whose path matches.
--force
Lands a file whose name is taken next to it, as "Name 1", instead of stopping.

An interrupted download picks up where it left off: run the same get again.

A link that uploads nothing

sninja direct build/ --ttl 3600

Prints a link at once and serves the files from this machine, live, for as long as the command runs. Nothing is uploaded. Stop it with Ctrl+C, or let --ttl end it after that many seconds; either way there is nothing left to download afterwards. That is the point.

Your account

Everything above works without an account. Sign in when you want your shares to follow you to your other devices:

sninja auth login

Opens the browser to sign in. The session is kept in the system keychain; sninja auth status shows it, sninja auth logout removes it.

A new device gets in only when one you already trust approves it. That includes this terminal:

sninja vault join --wait

Prints the device's fingerprint and waits. Approve the request on a device you already trust, checking the fingerprint matches, and the command finishes signed in. Without --wait it returns at once; sninja vault status tells you where things stand.

Signed in:

sninja links
Lists your links, or this device's when not signed in.
sninja link <token>
Shows one link in detail. --mint prints a fresh, copy-ready link for the same share.

To stop sharing a link, use the app or share.ninja; the command line has no stop-sharing command yet.

Scripting

Progress and status go to stdout as well, so take the link from the last lines rather than from the whole output. list, link and links write machine-readable output with --json <file>. Logs go to stderr; --verbose adds detail.