Upload from a terminal

WarpBox accepts normal multipart uploads at /upload. The server returns JSON with a box_url you can open or share.

curl \
  -F 'files=@./my-file.zip' \
  -F 'retention=1h' \
  {{ origin }}/upload

Reusable shell wrapper

This version is small, portable, and works well as a personal warpbox command.

#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -lt 1 ]; then
  echo "Usage: warpbox FILE [FILE ...]" >&2
  exit 64
fi

endpoint="${WARPBOX_URL:-{{ origin }}}/upload"
retention="${WARPBOX_RETENTION:-1h}"

args=(-F "retention=${retention}")
for file in "$@"; do
  args+=(-F "files=@${file}")
done

curl --fail-with-body "${args[@]}" "${endpoint}"

Install it

Put the wrapper somewhere on your PATH, then call it with one or more files.

chmod +x ./warpbox
sudo install -m 755 ./warpbox /usr/local/bin/warpbox
warpbox ./photo.png ./archive.zip

Print only the share URL

If jq is installed, this variant extracts the returned link and expands it to a full URL.

warpbox() {
  local endpoint="${WARPBOX_URL:-{{ origin }}}/upload"
  local retention="${WARPBOX_RETENTION:-1h}"
  local args=(-F "retention=${retention}")

  for file in "$@"; do
    args+=(-F "files=@${file}")
  done

  curl --fail-with-body -sS "${args[@]}" "${endpoint}" |
    jq -r --arg origin "${WARPBOX_URL:-{{ origin }}}" '"\($origin)\(.box_url)"'
}

Add password or retention

You can keep the wrapper simple and pass fixed options through environment variables or extra form fields.

WARPBOX_RETENTION=24h warpbox ./release.tar.gz

curl \
  -F 'files=@./private.zip' \
  -F 'retention=1h' \
  -F 'password=correct-horse-battery-staple' \
  {{ origin }}/upload