Upload Files from Terminal

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

> Quick Upload: Use this command to upload a single file:

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.

> Save this as a file called warpbox and make it executable to use it as a 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 the Command

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

> Install Steps:

  1. Make the script executable: chmod +x ./warpbox
  2. Install to system path: sudo install -m 755 ./warpbox /usr/local/bin/warpbox
  3. Use it: 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.

> Function Version: Add this function to your shell profile (like ~/.bashrc or ~/.zshrc):

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.

> Examples:

Set retention period for one upload:

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

Add password protection to a specific upload:

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