> DOCS_

Add to .bashrc / .zshrc:

vershare() {
  local BASE="https://vershare.uk"
  if [ -f "$1" ]; then
    local mime=$(file -b --mime-type "$1")
    local type="file"
    [[ "$mime" == image/* ]] && type="image"
    curl -s -X POST "$BASE/api/shares" \
      -F "type=$type" -F "file=@$1" | jq -r '.url'
  elif [ -n "$1" ]; then
    curl -s -X POST "$BASE/api/shares" \
      -H 'Content-Type: application/json' \
      -d "$(jq -nc --arg c "$1" '{type:"text",content:$c}')" | jq -r '.url'
  else
    local content=$(cat)
    curl -s -X POST "$BASE/api/shares" \
      -H 'Content-Type: application/json' \
      -d "$(jq -nc --arg c "$content" '{type:"text",content:$c}')" | jq -r '.url'
  fi
}

EXAMPLES

# Share a filevershare report.pdf
# Share an imagevershare screenshot.png
# Share textvershare "hello world"
# Pipe stdinecho "data" | vershare
# Clipboard (macOS)pbpaste | vershare
# Share & copy linkvershare notes.md | pbcopy

Requires curl + jq. Install: brew install jq or apt install jq