sharefiles CLI

Upload files to sharefiles.eu from your terminal. Get a 1-hour download link back for each file.

Download

Download the single binary for your platform โ€” no runtime required.

Need Windows or another build? See all platforms on the downloads page.

Install

Make the binary executable and move it onto your PATH:

# Linux x86_64
curl -fsSL https://sharefiles.eu/downloads/sharefiles-linux-x64 -o sharefiles
chmod +x sharefiles
sudo mv sharefiles /usr/local/bin/sharefiles

# Linux ARM64
curl -fsSL https://sharefiles.eu/downloads/sharefiles-linux-arm64 -o sharefiles
chmod +x sharefiles
sudo mv sharefiles /usr/local/bin/sharefiles

# macOS (Apple Silicon)
curl -fsSL https://sharefiles.eu/downloads/sharefiles-darwin-arm64 -o sharefiles
chmod +x sharefiles
sudo mv sharefiles /usr/local/bin/sharefiles

Authentication

On first use, the CLI opens a browser so you can log in. Your credentials are saved to ~/.sharefiles/credentials.json.

sharefiles photo.jpg
# โ†’ Opens browser: https://sharefiles.eu/cli-auth?token=...
# โ†’ After you authorize, the upload proceeds automatically

Alternatively, paste an existing API key (useful for CI or restricted directories):

sharefiles --api-key sk_yourkey image.png

Usage

sharefiles [options] <file> [file ...]

Options:
  --dir <name>              Upload to this directory (created if needed)
  --api-key <key>           Use this API key instead of stored credentials
  --set-default-dir <name>  Save a default upload directory
  --logout                  Remove stored credentials
  -h, --help                Show help

Examples

Upload one or more files:

sharefiles report.pdf image.png video.mp4

Upload to a specific directory:

sharefiles --dir my-project build.tar.gz

Set a default directory (used when --dir is omitted):

sharefiles --set-default-dir releases
sharefiles v2.0.tar.gz   # goes to "releases"

Output โ€” one direct link per file, valid for 1 hour:

$ sharefiles screenshot.png
Uploading to directory "uploads"...

  screenshot.png  (142.3 KB)  โ†’  https://sharefiles.eu/direct/abc123xyz

End-to-end encryption

The CLI encrypts and decrypts on your machine with the same code as the web app and the mobile app (AES-256-GCM per file, the content key wrapped with RSA-OAEP for every recipient key). The server only ever stores ciphertext; private keys stay in ~/.config/sharefiles/keys/ (mode 0600) and are never uploaded. Run sharefiles help e2ee for the full guide.

# keys
sharefiles keys generate               # new key here, public half registered on your account
sharefiles keys receive                # or pull your existing key from the web/app (transfer code)
sharefiles keys import key.pem         # or import a PEM file (chmod 600 it first)
sharefiles keys list | export <id> -o file | remove <id>

# "End-to-end encrypted for members" links
sharefiles link create projects/q3 --e2ee --writable --expires 7d
sharefiles link members <url>
sharefiles link add-member <url> --email jan@example.com

# send / receive through a link (yours or someone else's, signed in or not)
sharefiles put report.pdf photos/ --recursive <url>/inbox
sharefiles ls <url>                    # โœ“ readable / ๐Ÿ”’ locked per file, uploader fingerprint
sharefiles get <url>/inbox/report.pdf -o ~/Downloads/
sharefiles get <url> --recursive -o ./q3   # locked files: asks for access, waits, then downloads
sharefiles get projects/q3 --recursive     # an encrypted folder in your account works the same way

# access to files you can't open yet (get does this by itself; --no-wait exits 5, --no-request exits 3)
sharefiles access request <url> [--file /inbox/report.pdf]   # prints your code, e.g. 9c9bยทa41f
sharefiles invite accept '<invite URL with #invite=โ€ฆ>' [--wait]
sharefiles access list [<url>]
sharefiles access approve <requestId> --expect-fingerprint 9c9bยทa41f   # "12 of 14 โ€” 2 need another member"
sharefiles access approve --all --link <url> --expect-email jan@example.com
sharefiles access watch <url> --expect-email jan@example.com [--once] [--interval 10s] [--timeout 1h]
sharefiles access reject <requestId>
sharefiles invite create <url> --label "for Jan" --expires 7d
sharefiles link members <url>          # who is a member (email, or key code)

Typical flow: a script uploads a secret, an admin gets access

# on the server / in CI โ€” no account needed
sharefiles put db-password.txt <url>
#   ๐Ÿ”‘ Save your key โ€” made this machine's link key (code 7e41ยท0c2d)
#      Back it up:  sharefiles keys export lv_โ€ฆ -o sharefiles-link-key.pem

# the admin, signed in
sharefiles access request <url>          # โ†’ Code: 9c9bยทa41f  (sent to the server's owner over chat)

# back on the server: approve only that code (anything else โ†’ exit 6, nothing approved)
sharefiles access list <url>
sharefiles access approve <requestId> --expect-fingerprint 9c9bยทa41f
#   unattended: sharefiles access watch <url> --expect-email admin@example.com --once

# the admin
sharefiles get <url>/db-password.txt

Without an account, put creates this machine's link key (in ~/.config/sharefiles/keys/, mode 0600) and every later command on the link โ€” get, ls, access โ€ฆ, invite โ€ฆ โ€” uses it: the CLI proves it holds the key, so it can list and approve requests and create invites without signing in. Once the admin has access, they can approve others and invite from the CLI or the web just the same. Without a terminal, access approve refuses (exit 2) unless you pass --expect-fingerprint, --expect-email or --yes; secrets (private keys, invite links) are never printed except the invite URL by invite create, once. Every read command takes --json.

Not signed in yet? Any command that needs your account starts the browser sign-in itself (on a server without a browser it prints the URL to open elsewhere) and then carries on; a machine without a key is offered keys generate (or pass --yes). Locked files trigger one access request to the people who can open them; get waits for the approval (30 min on a terminal, --wait in CI) and finishes the download. Rejected: exit code 4; an --expect-โ€ฆ that doesn't match: exit code 6.

Encrypted folders in your account work too: sharefiles send and sharefiles sync encrypt for the folder's recipients (and for machines that require encryption) and decrypt on download with your keys. Large files stream with bounded memory; interrupted transfers are retried.

Revoking Access

To remove CLI credentials from your machine:

sharefiles --logout

To also revoke the API key on the server, go to Settings โ†’ API Keys and delete the sharefiles CLI key.