#!/bin/bash set -e echo "Installing YouTube CLI system-wide..." cd "$(dirname "$0")" # Install the package system-wide pip3 install --user --break-system-packages -e . # Add Python user bin to PATH if not already present PYTHON_BIN_DIR="$HOME/Library/Python/3.14/bin" if ! grep -q "Library/Python/3.14" ~/.zshrc 2>/dev/null; then echo 'export PATH="$HOME/Library/Python/3.14/bin:$PATH"' >> ~/.zshrc export PATH="$PYTHON_BIN_DIR:$PATH" echo "Added Python user bin to ~/.zshrc and current PATH" else # Update PATH for current session anyway export PATH="$PYTHON_BIN_DIR:$PATH" fi # Verify installation if command -v youtube-cli &> /dev/null; then echo "YouTube CLI installed successfully!" echo "Run 'youtube-cli --help' to verify." else echo "YouTube CLI installed but not in PATH yet." echo "Run 'source ~/.zshrc' to reload your shell or add this to your ~/.zshrc:" echo ' export PATH="$HOME/Library/Python/3.14/bin:$PATH"' fi