Skip to main content

CLI Guide

How to share and download files from your terminal.

Published February 1, 2026 ยท Updated February 22, 2026

The CLI tool is written in Go so you can share and download files without opening a browser. It speaks the same protocol as the web app, so a CLI host can share to a browser viewer and vice versa - great when you need to get a file to a remote host. Runs on macOS, Linux, and Windows.

This page covers how to use it. For installation and binaries, see the CLI download page.

Quick Start

Share a file:

spectrshare share photo.jpg

This connects to the signaling server and prints a share link. Anyone with that link can download the file directly from your machine.

Download from a share:

spectrshare view daily-quit-chew-blob -o ./downloads

Replace daily-quit-chew-blob with the share code from the link. Files are saved to the output directory.

Sharing Files

Share multiple files:

spectrshare share report.pdf slides.pptx data.csv

Share an entire folder (preserves directory structure):

spectrshare share ./project-files/

Use a custom server:

spectrshare share photo.jpg --server https://your-server.com:3001

The share stays active until you press Ctrl+C or close the terminal. Recipients can connect and download at any time while it's running.

Password Protection

Add a password to restrict who can download:

spectrshare share sensitive-doc.pdf -p mysecretpassword

The viewer needs the same password to connect:

spectrshare view daily-quit-chew-blob -p mysecretpassword -o ./downloads

The password is never sent over the network. Authentication uses a challenge-response mechanism where only a salted hash is exchanged, keeping your files secure from being accessed without the password.

Resuming Downloads

If a download gets interrupted, just run the same view command again. If partial files exist in the output directory, the CLI picks up from the last confirmed byte - the hash state is preserved too, so the final integrity check still covers the whole file.

TURN Relay

TURN is enabled by default for networks where direct P2P connections fail (corporate firewalls, symmetric NAT). To disable it:

spectrshare share photo.jpg --no-turn

If your server requires TURN authentication:

export SPECTRSHARE_TURN_API_TOKEN=your-token-here
spectrshare share photo.jpg

Scripting and Automation

The CLI works in scripts too. Pass --no-tui to turn off the interactive terminal UI:

spectrshare share ./backup/ --no-tui --server https://your-server.com:3001

Verbose mode for debugging connection issues:

spectrshare share photo.jpg -v

Skip TLS verification for local development servers with self-signed certificates:

spectrshare share photo.jpg --server https://localhost:3001 -k

Mix and Match

Since the CLI and the browser speak the same protocol, you can mix them freely. Share from CLI and download in a browser, share from a browser and download with CLI, or go CLI on both ends. Handy for headless servers or machines without a desktop environment.

Give it a go.