#!/bin/sh # Installs the nokeyvideo CLI (nkv) on Linux/macOS. # # curl -fsSL https://get.nokey.video | sh # # Windows users: irm https://get.nokey.video/install.ps1 | iex set -eu BASE_URL="https://s3.eu-central-003.backblazeb2.com/moonshade-ci-artifacts/nokeyvideo/cli/latest" INSTALL_DIR="${NKV_INSTALL_DIR:-$HOME/.local/bin}" err() { echo "error: $*" >&2 exit 1 } command -v curl >/dev/null 2>&1 || err "curl is required" OS="$(uname -s)" ARCH="$(uname -m)" case "$OS" in Linux) case "$ARCH" in x86_64) ASSET="nkv-linux-x64" ;; *) err "unsupported architecture on Linux: $ARCH (only x86_64 builds are published)" ;; esac ;; Darwin) case "$ARCH" in x86_64) ASSET="nkv-mac-x64" ;; arm64) ASSET="nkv-mac-arm64" ;; *) err "unsupported architecture on macOS: $ARCH" ;; esac ;; *) err "unsupported OS: $OS (Windows users: irm https://get.nokey.video/install.ps1 | iex)" ;; esac URL="${BASE_URL}/${ASSET}" mkdir -p "$INSTALL_DIR" TMP="$(mktemp)" trap 'rm -f "$TMP"' EXIT echo "Downloading nkv ($ASSET)..." curl -fsSL "$URL" -o "$TMP" chmod +x "$TMP" mv "$TMP" "$INSTALL_DIR/nkv" trap - EXIT echo "Installed nkv to $INSTALL_DIR/nkv" case ":$PATH:" in *":$INSTALL_DIR:"*) ;; *) echo echo "Note: $INSTALL_DIR is not on your PATH. Add it, e.g.:" echo " export PATH=\"$INSTALL_DIR:\$PATH\"" ;; esac if ! command -v ffmpeg >/dev/null 2>&1 || ! command -v ffprobe >/dev/null 2>&1; then echo echo "Note: nkv also requires ffmpeg/ffprobe on PATH (not installed by this script)." fi echo "$INSTALL_DIR/nkv" --version 2>/dev/null || true