#!/bin/bash # Install Piped SDK files to ~/.local/bin # This script downloads the SDK files and makes them available in your PATH set -euo pipefail INSTALL_DIR="$HOME/.local/bin" SDK_BASE_URL="https://piped.sh/sdk" echo "Installing Piped SDK files to $INSTALL_DIR..." # Create install directory if it doesn't exist mkdir -p "$INSTALL_DIR" # Download and install each SDK file echo "Downloading piped.sh..." curl -sSL "${SDK_BASE_URL}/piped.sh" -o "${INSTALL_DIR}/piped.sh" chmod +x "${INSTALL_DIR}/piped.sh" echo "Downloading piped.rb..." curl -sSL "${SDK_BASE_URL}/piped.rb" -o "${INSTALL_DIR}/piped.rb" chmod +x "${INSTALL_DIR}/piped.rb" echo "Downloading piped.js..." curl -sSL "${SDK_BASE_URL}/piped.js" -o "${INSTALL_DIR}/piped.js" chmod +x "${INSTALL_DIR}/piped.js" echo "Downloading piped.py..." curl -sSL "${SDK_BASE_URL}/piped.py" -o "${INSTALL_DIR}/piped.py" chmod +x "${INSTALL_DIR}/piped.py" echo "" echo "✅ SDK files installed successfully!" echo "" echo "To use the SDK files, add $INSTALL_DIR to your PATH:" echo "" echo " # For bash/zsh (add to ~/.bashrc or ~/.zshrc):" echo " export PATH=\"\$HOME/.local/bin:\$PATH\"" echo "" echo " # For fish (add to ~/.config/fish/config.fish):" echo " set -gx PATH \$HOME/.local/bin \$PATH" echo "" echo "After adding to PATH, restart your terminal or run:" echo " source ~/.bashrc # or source ~/.zshrc" echo "" echo "Then you can use the SDK files:" echo " piped.sh \"cat example.com | wc -l\"" echo " ruby piped.rb \"cat example.com | wc -l\" \"pk_your_api_key\"" echo " node piped.js \"cat example.com | wc -l\" \"pk_your_api_key\"" echo " python3 piped.py \"cat example.com | wc -l\" \"pk_your_api_key\""