# Command-line tool

Upload from your terminal. One command, JSON output for scripts, resumable multipart for huge files. Source on [GitHub](https://github.com/storageto/cli).

macOS · Linux · Windows · Open source · Go

## Install

### Homebrew (macOS & Linux)

```sh
$ brew install storageto/tap/storageto
```

### Go

```sh
$ go install github.com/storageto/cli/cmd/storageto@latest
```

Make sure `~/go/bin` is in your `PATH`.

### Pre-built binaries

Download the appropriate tarball from [GitHub Releases](https://github.com/storageto/cli/releases) (macOS ARM/Intel, Linux ARM/Intel).

- [View on GitHub](https://github.com/storageto/cli)
- [GitHub Releases](https://github.com/storageto/cli/releases)

## Usage

### Single file

```sh
$ storageto upload photo.jpg

URL:     https://storage.to/FQxyz1234
Size:    2.1 MB
Expires: 2026-04-15T12:00:00Z
```

### Multiple files

Pass multiple paths or a glob - they're auto-grouped into a collection:

```sh
$ storageto upload file1.txt file2.txt file3.txt
$ storageto upload *.log
$ storageto upload src/**/*.go
```

### Large files

Files over 5 GB are automatically chunked and uploaded in parallel with resumable multipart. Progress is printed inline:

```
1.2 GB / 10.0 GB (12.0%)
```

Press `Ctrl+C` to cancel - partial uploads are cleaned up on the server automatically.

## Flags

| Flag | Description |
| --- | --- |
| `-c`, `--collection` | Force a collection even for a single file. |
| `-v`, `--verbose` | Show detailed progress output. |
| `--json` | Emit JSON result (machine-readable, great for scripts). |
| `--no-token` | Upload fully anonymously - don't read or write the identity token file. |
| `--api <url>` | Override the API endpoint (defaults to `https://storage.to`). |
| `-h`, `--help` | Show help. |

## JSON output

```sh
$ storageto upload photo.jpg --json
{
  "url": "https://storage.to/FQxyz1234",
  "filename": "photo.jpg",
  "size": 2202009,
  "human_size": "2.1 MB",
  "expires_at": "2026-04-15T12:00:00Z"
}
```

## Identity token

The CLI stores a random *visitor token* on first use so repeat uploads from the same machine share quota and attribution. It's not an account login - it's just a per-machine identifier.

| OS | Path |
| --- | --- |
| macOS | `~/Library/Application Support/storageto/token` |
| Linux | `~/.config/storageto/token` |
| Windows | `%AppData%\storageto\token` |

Pass `--no-token` to skip the token file entirely.

> **Tip**: Anonymous CLI uploads are capped at 50 files a day and expire after 3 days. [Use a free account token](https://storage.to/account/api-tokens) to remove the caps, or a paid one to keep files forever.

## Scripting

Pipe `--json` output into `jq` to extract the URL:

```sh
URL=$(storageto upload build.zip --json | jq -r '.url')
echo "Uploaded to $URL"
```

## Version & updates

```sh
$ storageto version
```

Homebrew users: `brew upgrade storageto`. Go users: re-run `go install` with the latest tag.
