diff --git a/README.md b/README.md index 5a0674f..b286507 100644 --- a/README.md +++ b/README.md @@ -170,13 +170,11 @@ All knowledge flows through the **Semantic Knowledge Base** (SQLite + sqlite-vec ## 💻 Installation & Setup -> **Note:** The `install.sh` script currently supports macOS only. Linux and Windows support coming soon. - ### Prerequisites **Required:** -- macOS (for `install.sh`) +- macOS or Linux (Ubuntu, Debian, Fedora, RHEL, Arch) - Python 3.11 or 3.12 (`python3 --version`) - **Note:** Python 3.13+ not yet supported due to dependency constraints - Git (`git --version`) @@ -186,6 +184,8 @@ All knowledge flows through the **Semantic Knowledge Base** (SQLite + sqlite-vec - Node.js 16+ (for React UI) - Ollama (for local AI) or OpenAI API key +> **Note:** Windows support coming soon. + ### Quick Installation ```bash @@ -797,7 +797,7 @@ Each project has `.claude-os/config.json`: ### Installation & Setup -#### `./install.sh` - Quick Setup (macOS only) +#### `./install.sh` - Quick Setup (macOS & Linux) ```bash ./install.sh @@ -811,6 +811,8 @@ Each project has `.claude-os/config.json`: - ✅ Installs dependencies - ✅ Configures MCP server +**Supported Linux distros:** Ubuntu, Debian, Fedora, RHEL, Arch + #### `./setup.sh` - Full Setup (with Ollama + Redis) ```bash @@ -819,11 +821,13 @@ Each project has `.claude-os/config.json`: **Complete installation:** -- ✅ Installs Ollama + Redis (if needed) +- ✅ Installs Ollama + Redis (if not already installed) - ✅ Downloads LLM models (~5-10 GB) - ✅ Sets up Python environment - ✅ Creates database +**Linux package managers supported:** apt (Debian/Ubuntu), dnf (Fedora), yum (RHEL), pacman (Arch) + ### Service Management #### `./start.sh` or `./start_all_services.sh` - Start Everything diff --git a/install.sh b/install.sh index 15ae26a..feda834 100755 --- a/install.sh +++ b/install.sh @@ -80,6 +80,8 @@ elif command -v python3 &> /dev/null; then echo "Please install Python 3.11 or 3.12:" echo " • macOS with Homebrew: brew install python@3.12" echo " • Ubuntu/Debian: sudo apt install python3.12" + echo " • Fedora/RHEL: sudo dnf install python3.12" + echo " • Arch Linux: sudo pacman -S python" echo " • Or download from: https://www.python.org/downloads/" echo "" INSTALL_STATUS="FAILED" @@ -88,7 +90,14 @@ elif command -v python3 &> /dev/null; then fi else log_error "Python 3 is not installed" - echo " Please install Python 3.11 or 3.12 and try again" + echo "" + echo "Please install Python 3.11 or 3.12:" + echo " • macOS with Homebrew: brew install python@3.12" + echo " • Ubuntu/Debian: sudo apt install python3.12" + echo " • Fedora/RHEL: sudo dnf install python3.12" + echo " • Arch Linux: sudo pacman -S python" + echo " • Or download from: https://www.python.org/downloads/" + echo "" INSTALL_STATUS="FAILED" skip_to_summary=true fi diff --git a/setup.sh b/setup.sh index 484f71e..b39cf83 100755 --- a/setup.sh +++ b/setup.sh @@ -9,6 +9,32 @@ BLUE='\033[0;34m' CYAN='\033[0;36m' NC='\033[0m' # No Color +# Detect OS and package manager +detect_os() { + if [[ "$OSTYPE" == "darwin"* ]]; then + OS="macos" + PKG_MANAGER="brew" + elif [[ "$OSTYPE" == "linux-gnu"* ]]; then + OS="linux" + if command -v apt-get &> /dev/null; then + PKG_MANAGER="apt" + elif command -v dnf &> /dev/null; then + PKG_MANAGER="dnf" + elif command -v yum &> /dev/null; then + PKG_MANAGER="yum" + elif command -v pacman &> /dev/null; then + PKG_MANAGER="pacman" + else + PKG_MANAGER="unknown" + fi + else + OS="unknown" + PKG_MANAGER="unknown" + fi +} + +detect_os + # Banner clear echo -e "${CYAN}" @@ -99,11 +125,13 @@ echo -e "${BLUE}═════════════════════ echo -e "${BLUE}Step 4: Setting Up Ollama (LLM Engine)${NC}" echo -e "${BLUE}═══════════════════════════════════════════════════════════${NC}\n" -if ! command -v ollama &> /dev/null; then +if command -v ollama &> /dev/null; then + echo -e "${GREEN}✅ Ollama already installed${NC}" +else echo -e "${YELLOW}⚠️ Ollama not found${NC}" echo "Installing Ollama..." - if [[ "$OSTYPE" == "darwin"* ]]; then + if [[ "$OS" == "macos" ]]; then # macOS if ! command -v brew &> /dev/null; then echo -e "${RED}❌ Homebrew not found (required for macOS)${NC}" @@ -111,26 +139,28 @@ if ! command -v ollama &> /dev/null; then exit 1 fi brew install ollama - elif [[ "$OSTYPE" == "linux-gnu"* ]]; then - # Linux + elif [[ "$OS" == "linux" ]]; then + # Linux - use universal installer (works on all distros) curl -fsSL https://ollama.ai/install.sh | sh else echo -e "${RED}❌ Unsupported OS${NC}" echo "Please install Ollama manually from https://ollama.ai" exit 1 fi + echo -e "${GREEN}✅ Ollama installed${NC}" fi -echo -e "${GREEN}✅ Ollama is available${NC}" - echo "Checking if Ollama is running..." if curl -s http://localhost:11434/api/tags &> /dev/null; then echo -e "${GREEN}✅ Ollama is running${NC}" else echo -e "${YELLOW}⚠️ Ollama is not running${NC}" echo "Starting Ollama..." - if [[ "$OSTYPE" == "darwin"* ]]; then + if [[ "$OS" == "macos" ]]; then brew services start ollama &> /dev/null || true + elif [[ "$OS" == "linux" ]]; then + # Start ollama directly (no sudo needed) + ollama serve &> /dev/null & else ollama serve &> /dev/null & fi @@ -163,31 +193,53 @@ echo -e "${BLUE}═════════════════════ echo -e "${BLUE}Step 5: Setting Up Redis (Cache & Queue System)${NC}" echo -e "${BLUE}═══════════════════════════════════════════════════════════${NC}\n" -if ! command -v redis-cli &> /dev/null; then +if command -v redis-cli &> /dev/null; then + echo -e "${GREEN}✅ Redis already installed${NC}" +else echo -e "${YELLOW}⚠️ Redis not found${NC}" echo "Installing Redis..." - if [[ "$OSTYPE" == "darwin"* ]]; then + if [[ "$OS" == "macos" ]]; then brew install redis - elif [[ "$OSTYPE" == "linux-gnu"* ]]; then - sudo apt-get install -y redis-server + elif [[ "$OS" == "linux" ]]; then + case "$PKG_MANAGER" in + apt) + sudo apt-get update && sudo apt-get install -y redis-server + ;; + dnf) + sudo dnf install -y redis + ;; + yum) + sudo yum install -y redis + ;; + pacman) + sudo pacman -S --noconfirm redis + ;; + *) + echo -e "${RED}❌ Unknown package manager${NC}" + echo "Please install Redis manually from https://redis.io" + exit 1 + ;; + esac else echo -e "${RED}❌ Unsupported OS${NC}" echo "Please install Redis manually from https://redis.io" exit 1 fi + echo -e "${GREEN}✅ Redis installed${NC}" fi -echo -e "${GREEN}✅ Redis is available${NC}" - echo "Checking if Redis is running..." if redis-cli ping &> /dev/null; then echo -e "${GREEN}✅ Redis is running${NC}" else echo -e "${YELLOW}⚠️ Redis is not running${NC}" echo "Starting Redis..." - if [[ "$OSTYPE" == "darwin"* ]]; then + if [[ "$OS" == "macos" ]]; then brew services start redis > /dev/null 2>&1 || true + elif [[ "$OS" == "linux" ]]; then + # Start redis directly (no sudo needed) + redis-server --daemonize yes > /dev/null 2>&1 || true else redis-server --daemonize yes > /dev/null 2>&1 || true fi diff --git a/start_all_services.sh b/start_all_services.sh index 2ed5d01..06e9bf0 100755 --- a/start_all_services.sh +++ b/start_all_services.sh @@ -8,6 +8,15 @@ YELLOW='\033[1;33m' BLUE='\033[0;34m' NC='\033[0m' # No Color +# Detect OS +if [[ "$OSTYPE" == "darwin"* ]]; then + OS="macos" +elif [[ "$OSTYPE" == "linux-gnu"* ]]; then + OS="linux" +else + OS="unknown" +fi + echo -e "${BLUE}==================================================" echo "🚀 Claude OS - Starting All Services" echo "=================================================${NC}" @@ -55,7 +64,14 @@ if check_port 11434; then echo -e " ${GREEN}✓ Ollama is running on port 11434${NC}" else echo -e " ${YELLOW}⚠ Ollama is not running, attempting to start...${NC}" - brew services start ollama > /dev/null 2>&1 || true + if [[ "$OS" == "macos" ]]; then + brew services start ollama > /dev/null 2>&1 || true + elif [[ "$OS" == "linux" ]]; then + # Try direct execution first (no sudo needed), fall back to user systemctl + ollama serve > /dev/null 2>&1 & + else + ollama serve > /dev/null 2>&1 & + fi echo -n " Waiting for Ollama to start" if wait_for_port 11434 "Ollama"; then : @@ -108,11 +124,23 @@ echo "" # ===== 4. Check Redis ===== echo -e "${YELLOW}4. Checking Redis...${NC}" -if redis-cli ping &> /dev/null; then +if ! command -v redis-server &> /dev/null; then + echo -e " ${YELLOW}⚠ Redis is not installed${NC}" + if [[ "$OS" == "macos" ]]; then + echo " Install with: brew install redis" + elif [[ "$OS" == "linux" ]]; then + echo " Install with: sudo apt install redis-server (or dnf/pacman)" + fi + echo " Or run ./setup.sh for full installation" +elif redis-cli ping &> /dev/null; then echo -e " ${GREEN}✓ Redis is running${NC}" else echo -e " ${YELLOW}⚠ Redis is not running, attempting to start...${NC}" - brew services start redis > /dev/null 2>&1 || redis-server --daemonize yes > /dev/null 2>&1 || true + if [[ "$OS" == "macos" ]]; then + brew services start redis > /dev/null 2>&1 || redis-server --daemonize yes > /dev/null 2>&1 || true + else + redis-server --daemonize yes > /dev/null 2>&1 || true + fi sleep 2 if redis-cli ping &> /dev/null; then echo -e " ${GREEN}✓ Redis started successfully${NC}"