Moved 25 files from root to organized subdirectories while keeping essential scripts (install.sh, setup.sh, start*.sh, stop*.sh) in root. ## Changes: ### New Directory Structure: - Created `/scripts/` for utility scripts - Created `/docs/guides/` for user guides - Created `/docs/development/` for dev documentation - Created `/docs/archive/` for historical/legacy docs ### Moved Files: **To `/scripts/` (7 files):** - backup_claude_os.sh - restore_claude_os.sh - run_tests.sh - setup_native.sh - start_mcp_server.sh - start_redis_workers.sh - entrypoint.sh **To `/docs/guides/` (7 files):** - AUTH_SETUP.md - BACKUP_RESTORE_GUIDE.md - HOOK_SETUP_QUICK_START.md - SHARING_GUIDE.md - START_SCRIPTS_GUIDE.md - PORTS_GUIDE.md - WHAT_IS_CLAUDE_OS.md **To `/docs/development/` (4 files):** - COMPREHENSIVE_REVIEW.md - SECURITY_FIXES.md - CLAUDE_OS_DEVELOPER_GUIDE.md - PROJECT_SETUP_AND_COMMANDS.md **To `/docs/archive/` (10 files):** - HYBRID_INDEXING_COMPLETE.md - INITIALIZE_PROJECT_HOOKS_FIX.md - INSTALL_ENHANCEMENTS.md - INSTALL_FIXES.md - PISTN_TEST_RESULTS.md - SESSION_SUMMARY.md - TEST_COVERAGE.md - TEST_RESULTS.md - TESTING_STATUS.md - README_TESTING.md ### Updated References: **Fixed broken documentation links in:** - docs/QUICK_REFERENCE.md - docs/PRODUCTION_DEPLOYMENT.md - docs/SCRIPTS_GUIDE.md - docs/development/SECURITY_FIXES.md - docs/guides/BACKUP_RESTORE_GUIDE.md - docs/development/CLAUDE_OS_DEVELOPER_GUIDE.md - tests/TESTING_GUIDE.md - tests/TEST_COVERAGE.md **Script references updated to:** - `./scripts/backup_claude_os.sh` - `./scripts/restore_claude_os.sh` - `./scripts/run_tests.sh` - `./scripts/setup_native.sh` - `./scripts/start_mcp_server.sh` - `./scripts/start_redis_workers.sh` ### Remaining in Root (9 essential files): - install.sh - setup.sh - start.sh - start_all_services.sh - stop_all_services.sh - restart_services.sh - README.md - CLAUDE.md - requirements.txt (+ GEMINI_DIAGRAM_PROMPT.md) ## Benefits: ✅ Cleaner root directory (9 files vs 34 files) ✅ Organized documentation by purpose ✅ Scripts grouped in dedicated directory ✅ Essential startup commands still in root ✅ All references updated and verified ✅ No broken links Version: 2.0.2
168 lines
4.4 KiB
Bash
Executable file
168 lines
4.4 KiB
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
echo "🚀 Claude OS Setup - NATIVE (SQLite + Ollama)"
|
|
echo "=================================================="
|
|
echo ""
|
|
|
|
# Step 1: Check if we're on macOS
|
|
if [[ "$OSTYPE" != "darwin"* ]]; then
|
|
echo "❌ This script is for macOS only"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Step 1: Checking Ollama installation..."
|
|
if ! command -v ollama &> /dev/null; then
|
|
echo " ❌ Ollama not found. Please install it first:"
|
|
echo ""
|
|
echo " Option A: Via Homebrew (recommended)"
|
|
echo " brew install ollama"
|
|
echo " brew services start ollama"
|
|
echo ""
|
|
echo " Option B: Download from https://ollama.ai"
|
|
echo ""
|
|
exit 1
|
|
fi
|
|
|
|
OLLAMA_VERSION=$(ollama --version 2>/dev/null | cut -d' ' -f2)
|
|
echo " ✅ Ollama found"
|
|
|
|
# Check if Ollama is running
|
|
echo " Checking if Ollama is running..."
|
|
if ! curl -s http://localhost:11434/api/tags &> /dev/null; then
|
|
echo " ⚠️ Ollama is not running. Starting..."
|
|
brew services start ollama 2>/dev/null || true
|
|
sleep 3
|
|
fi
|
|
|
|
if curl -s http://localhost:11434/api/tags &> /dev/null; then
|
|
echo " ✅ Ollama is running on port 11434"
|
|
else
|
|
echo " ⚠️ Could not verify Ollama is running"
|
|
fi
|
|
|
|
echo ""
|
|
echo "Step 2: Pulling required models..."
|
|
echo " This may take a few minutes (first time only)..."
|
|
|
|
# Pull llama3.1 model
|
|
if ! ollama list | grep -q "llama3.1"; then
|
|
echo " 📥 Pulling llama3.1:latest (8B model)..."
|
|
ollama pull llama3.1:latest
|
|
else
|
|
echo " ✅ llama3.1:latest already available"
|
|
fi
|
|
|
|
# Pull embedding model
|
|
if ! ollama list | grep -q "nomic-embed-text"; then
|
|
echo " 📥 Pulling nomic-embed-text (embeddings)..."
|
|
ollama pull nomic-embed-text:latest
|
|
else
|
|
echo " ✅ nomic-embed-text already available"
|
|
fi
|
|
|
|
echo " ✅ Models ready"
|
|
|
|
echo ""
|
|
echo "Step 3: Setting up Python environment..."
|
|
|
|
# Check Python version
|
|
if ! command -v python3 &> /dev/null; then
|
|
echo " ❌ Python 3 not found. Please install Python 3.11+ first"
|
|
exit 1
|
|
fi
|
|
|
|
PYTHON_VERSION=$(python3 --version | cut -d' ' -f2)
|
|
echo " ✅ Python $PYTHON_VERSION found"
|
|
|
|
# Create virtual environment if needed
|
|
if [ ! -d "venv" ]; then
|
|
echo " Creating virtual environment..."
|
|
python3 -m venv venv
|
|
fi
|
|
|
|
# Activate venv
|
|
source venv/bin/activate
|
|
|
|
echo " Installing Python dependencies..."
|
|
pip install -q --upgrade pip setuptools wheel
|
|
pip install -q -r requirements.txt
|
|
|
|
echo " ✅ Python environment ready"
|
|
|
|
echo ""
|
|
echo "Step 4: Creating data directory..."
|
|
|
|
# Create data directory for SQLite database
|
|
if [ ! -d "data" ]; then
|
|
mkdir -p data
|
|
echo " ✅ Created data/ directory"
|
|
else
|
|
echo " ✅ data/ directory already exists"
|
|
fi
|
|
|
|
# Create logs directory
|
|
if [ ! -d "logs" ]; then
|
|
mkdir -p logs
|
|
echo " ✅ Created logs/ directory"
|
|
else
|
|
echo " ✅ logs/ directory already exists"
|
|
fi
|
|
|
|
echo ""
|
|
echo "Step 5: Initializing SQLite database..."
|
|
|
|
# The database will be created automatically on first run
|
|
# But we can verify the schema will be set up
|
|
if [ -f "app/db/schema.sqlite" ]; then
|
|
echo " ✅ SQLite schema file found"
|
|
echo " 💾 Database will be created at: data/claude-os.db"
|
|
else
|
|
echo " ⚠️ Schema file not found, but database will auto-initialize"
|
|
fi
|
|
|
|
echo ""
|
|
echo "Step 6: Setting up Node.js frontend..."
|
|
|
|
# Check if Node is installed
|
|
if ! command -v node &> /dev/null; then
|
|
echo " ⚠️ Node.js not found. Install from https://nodejs.org"
|
|
echo " Frontend setup skipped (you can set it up later)"
|
|
else
|
|
NODE_VERSION=$(node --version)
|
|
echo " ✅ Node.js $NODE_VERSION found"
|
|
|
|
if [ -d "frontend" ]; then
|
|
echo " Installing frontend dependencies..."
|
|
cd frontend
|
|
npm install > /dev/null 2>&1 || true
|
|
cd ..
|
|
echo " ✅ Frontend dependencies ready"
|
|
fi
|
|
fi
|
|
|
|
echo ""
|
|
echo "=================================================="
|
|
echo "✅ Claude OS Setup Complete!"
|
|
echo "=================================================="
|
|
echo ""
|
|
echo "🎯 Next Steps:"
|
|
echo ""
|
|
echo "1. Start Claude OS:"
|
|
echo " ./start_all_services.sh"
|
|
echo ""
|
|
echo "2. Access the UI:"
|
|
echo " Frontend: http://localhost:5173"
|
|
echo " API: http://localhost:8051"
|
|
echo ""
|
|
echo "3. Manage services:"
|
|
echo " Restart: ./restart_services.sh"
|
|
echo " Stop: ./stop_all_services.sh"
|
|
echo ""
|
|
echo "📚 Database:"
|
|
echo " Type: SQLite (single file)"
|
|
echo " Location: data/claude-os.db"
|
|
echo " Backup: cp data/claude-os.db data/claude-os.db.backup"
|
|
echo ""
|
|
echo "🚀 You're all set! Let's build something amazing!"
|
|
echo ""
|