#!/bin/bash set -euo pipefail echo "============================================" echo "VisiData Installation Script" echo "============================================" echo "" echo "This script will run the following commands with sudo:" echo " - apt-get update (if pipx not installed)" echo " - apt-get install -y pipx (if needed)" echo "" read -p "Continue with installation? (y/N) " -n 1 -r echo if [[ ! $REPLY =~ ^[Yy]$ ]]; then echo "Installation cancelled." exit 0 fi echo "" echo "Starting installation (commands will be shown as they run)..." echo "" # Enable command tracing set -x # Check if python3 is available if ! command -v python3 &> /dev/null; then set +x echo "Error: python3 is not installed. Please install Python 3 first." >&2 exit 1 fi # Install pipx if not available (recommended way to install VisiData) if ! command -v pipx &> /dev/null; then sudo apt-get update sudo apt-get install -y pipx set +x pipx ensurepath set -x fi set +x # Install VisiData using pipx echo "Installing VisiData via pipx..." set -x pipx install visidata # Disable command tracing for cleaner output set +x echo "" echo "============================================" # Verify installation if command -v vd &> /dev/null; then echo "VisiData installed successfully!" vd --version echo "" echo "Note: If 'vd' command is not found, you may need to:" echo " 1. Restart your shell, or" echo " 2. Run: source ~/.bashrc" else echo "Warning: VisiData installed but 'vd' command not in PATH" >&2 echo "You may need to restart your shell or run: source ~/.bashrc" >&2 fi echo "" echo "Documentation: https://www.visidata.org/" echo "============================================"