Release v1.01 Enhanced: Vi Control, TUI Gen5, Core Stability

This commit is contained in:
Gemini AI
2025-12-20 01:12:45 +04:00
Unverified
parent 2407c42eb9
commit 142aaeee1e
254 changed files with 44888 additions and 31025 deletions

View File

@@ -1,154 +1,234 @@
#!/bin/bash
# ╔══════════════════════════════════════════════════════════════════╗
# OpenQode TUI - Full Auto Installer (Linux) ║
# ║ This script installs EVERYTHING needed - just run it! ║
# ║ Supports: Ubuntu/Debian, Fedora/RHEL, Arch Linux ║
# ╚══════════════════════════════════════════════════════════════════╝
# ========================================================
# OpenQode v1.01 - Automated Installer for Linux
# ========================================================
set -e
cd "$(dirname "$0")"
echo ""
echo "╔══════════════════════════════════════════════════════════════╗"
echo "║ OpenQode TUI - Linux Auto Installer ║"
echo "║ This will install all required dependencies ║"
echo "╚══════════════════════════════════════════════════════════════╝"
echo ""
# Colors for output
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
CYAN='\033[0;36m'
BOLD='\033[1m'
NC='\033[0m'
success() { echo -e "${GREEN}[✓]${NC} $1"; }
warning() { echo -e "${YELLOW}[!]${NC} $1"; }
error() { echo -e "${RED}[X]${NC} $1"; }
info() { echo -e " $1"; }
echo ""
echo -e "${CYAN}========================================================"
echo " OpenQode v1.01 - AUTOMATED INSTALLATION WIZARD"
echo -e "========================================================${NC}"
echo ""
echo " This installer will set up everything you need:"
echo " - Node.js (if not installed)"
echo " - All dependencies"
echo " - Goose Ultra IDE"
echo ""
echo " Supported: Ubuntu, Debian, Fedora, Arch, and more"
echo ""
read -p "Press Enter to start installation..."
echo ""
# Detect package manager
detect_pm() {
detect_package_manager() {
if command -v apt-get &> /dev/null; then
PM="apt"
INSTALL="sudo apt-get install -y"
PKG_MANAGER="apt"
PKG_INSTALL="sudo apt-get install -y"
PKG_UPDATE="sudo apt-get update"
elif command -v dnf &> /dev/null; then
PM="dnf"
INSTALL="sudo dnf install -y"
PKG_MANAGER="dnf"
PKG_INSTALL="sudo dnf install -y"
PKG_UPDATE="sudo dnf check-update || true"
elif command -v yum &> /dev/null; then
PM="yum"
INSTALL="sudo yum install -y"
PKG_MANAGER="yum"
PKG_INSTALL="sudo yum install -y"
PKG_UPDATE="sudo yum check-update || true"
elif command -v pacman &> /dev/null; then
PM="pacman"
INSTALL="sudo pacman -S --noconfirm"
PKG_MANAGER="pacman"
PKG_INSTALL="sudo pacman -S --noconfirm"
PKG_UPDATE="sudo pacman -Sy"
elif command -v zypper &> /dev/null; then
PKG_MANAGER="zypper"
PKG_INSTALL="sudo zypper install -y"
PKG_UPDATE="sudo zypper refresh"
else
error "Could not detect package manager. Please install Node.js manually."
exit 1
PKG_MANAGER="unknown"
fi
success "Detected package manager: $PM"
}
# Step 1: Detect package manager
echo "[1/7] Detecting package manager..."
detect_pm
detect_package_manager
echo -e "${BOLD}[INFO]${NC} Detected package manager: $PKG_MANAGER"
# Step 2: Update package lists
echo "[2/7] Updating package lists..."
case $PM in
apt) sudo apt-get update -qq ;;
dnf|yum) sudo $PM check-update || true ;;
pacman) sudo pacman -Sy ;;
esac
success "Package lists updated!"
# Step 3: Install Node.js
echo "[3/7] Checking for Node.js..."
# ========================================================
# NODE.JS CHECK AND INSTALL
# ========================================================
echo ""
echo -e "${BOLD}[STEP 1/4]${NC} Checking Node.js..."
if ! command -v node &> /dev/null; then
warning "Node.js not found. Installing..."
case $PM in
echo -e "${YELLOW}[INFO]${NC} Node.js not found. Installing..."
case $PKG_MANAGER in
apt)
# Install Node.js 20.x LTS from NodeSource
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
# Use NodeSource for latest LTS
echo -e "${YELLOW}[INFO]${NC} Setting up NodeSource repository..."
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
$PKG_INSTALL nodejs
;;
dnf|yum)
curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -
sudo $PM install -y nodejs
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
$PKG_INSTALL nodejs
;;
pacman)
sudo pacman -S --noconfirm nodejs npm
$PKG_INSTALL nodejs npm
;;
zypper)
$PKG_INSTALL nodejs npm
;;
*)
echo -e "${RED}[ERROR]${NC} Could not auto-install Node.js."
echo "Please install Node.js manually from https://nodejs.org/"
exit 1
;;
esac
success "Node.js installed!"
echo -e "${GREEN}[OK]${NC} Node.js installed"
else
success "Node.js found: $(node --version)"
NODE_VER=$(node --version)
echo -e "${GREEN}[OK]${NC} Node.js $NODE_VER detected"
fi
# Step 4: Check for npm
echo "[4/7] Checking for npm..."
# ========================================================
# NPM CHECK
# ========================================================
echo -e "${BOLD}[STEP 2/4]${NC} Checking npm..."
if ! command -v npm &> /dev/null; then
error "npm not found. Please reinstall Node.js"
exit 1
echo -e "${YELLOW}[INFO]${NC} npm not found. Installing..."
case $PKG_MANAGER in
apt)
$PKG_INSTALL npm
;;
pacman)
$PKG_INSTALL npm
;;
*)
echo -e "${RED}[ERROR]${NC} npm not found. Please install manually."
exit 1
;;
esac
fi
NPM_VER=$(npm --version)
echo -e "${GREEN}[OK]${NC} npm $NPM_VER detected"
# ========================================================
# ROOT DEPENDENCIES
# ========================================================
echo -e "${BOLD}[STEP 3/4]${NC} Installing root dependencies..."
if [ -d "node_modules" ]; then
echo -e "${GREEN}[OK]${NC} Root dependencies already installed"
else
success "npm found: $(npm --version)"
echo -e "${YELLOW}[INFO]${NC} Running npm install..."
npm install --legacy-peer-deps 2>/dev/null || npm install
echo -e "${GREEN}[OK]${NC} Root dependencies installed"
fi
# Step 5: Install Playwright dependencies (browser libs)
echo "[5/7] Installing Playwright system dependencies..."
case $PM in
# ========================================================
# GOOSE ULTRA DEPENDENCIES
# ========================================================
echo -e "${BOLD}[STEP 4/4]${NC} Installing Goose Ultra IDE dependencies..."
if [ -d "bin/goose-ultra-final/node_modules" ]; then
echo -e "${GREEN}[OK]${NC} Goose Ultra dependencies already installed"
else
pushd bin/goose-ultra-final > /dev/null
echo -e "${YELLOW}[INFO]${NC} Running npm install in Goose Ultra..."
npm install --legacy-peer-deps 2>/dev/null || npm install
# Pre-build
echo -e "${YELLOW}[INFO]${NC} Pre-building Goose Ultra..."
npm run build 2>/dev/null || true
popd > /dev/null
echo -e "${GREEN}[OK]${NC} Goose Ultra dependencies installed"
fi
# ========================================================
# MAKE SCRIPTS EXECUTABLE
# ========================================================
chmod +x OpenQode.sh 2>/dev/null || true
chmod +x install-macos.sh 2>/dev/null || true
chmod +x install.sh 2>/dev/null || true
chmod +x start.sh 2>/dev/null || true
# ========================================================
# INSTALL ELECTRON DEPENDENCIES (for GUI)
# ========================================================
echo ""
echo -e "${BOLD}[OPTIONAL]${NC} Installing Electron dependencies for GUI support..."
case $PKG_MANAGER in
apt)
# Install deps for Chromium on Debian/Ubuntu
$INSTALL libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 \
libasound2 libpango-1.0-0 libcairo2 2>/dev/null || warning "Some Playwright deps may be missing"
sudo apt-get install -y libgtk-3-0 libnotify4 libnss3 libxss1 libxtst6 xdg-utils libsecret-1-0 2>/dev/null || true
;;
dnf|yum)
$INSTALL nss nspr atk at-spi2-atk cups-libs libdrm libxkbcommon libXcomposite \
libXdamage libXfixes libXrandr mesa-libgbm alsa-lib pango cairo 2>/dev/null || warning "Some Playwright deps may be missing"
sudo $PKG_MANAGER install -y gtk3 libXScrnSaver libnotify nss 2>/dev/null || true
;;
pacman)
$INSTALL nss nspr atk at-spi2-atk libcups libdrm libxkbcommon libxcomposite \
libxdamage libxfixes libxrandr mesa alsa-lib pango cairo 2>/dev/null || warning "Some Playwright deps may be missing"
sudo pacman -S --noconfirm gtk3 libnotify nss libxss 2>/dev/null || true
;;
esac
success "System dependencies installed!"
echo -e "${GREEN}[OK]${NC} Electron dependencies checked"
# Step 6: Install Node.js dependencies
echo "[6/7] Installing Node.js dependencies..."
npm install --legacy-peer-deps
if [ $? -ne 0 ]; then
warning "Some npm packages failed. Trying with force..."
npm install --force --legacy-peer-deps
# ========================================================
# VERIFICATION
# ========================================================
echo ""
echo -e "${CYAN}========================================================"
echo " INSTALLATION COMPLETE"
echo -e "========================================================${NC}"
echo ""
echo " Checking installation..."
ERRORS=0
if command -v node &> /dev/null; then
echo -e " ${GREEN}[OK]${NC} Node.js"
else
echo -e " ${RED}[FAIL]${NC} Node.js"
((ERRORS++))
fi
# Ensure critical markdown dependencies
npm install unified remark-parse remark-gfm remark-rehype rehype-stringify ink-syntax-highlight diff --save --legacy-peer-deps
success "Node.js dependencies installed!"
# Step 7: Install Playwright
echo "[7/7] Installing Playwright browser automation..."
npm install playwright
npx playwright install chromium
if [ $? -ne 0 ]; then
warning "Playwright browser download had issues."
info "You can try: npx playwright install-deps chromium"
if command -v npm &> /dev/null; then
echo -e " ${GREEN}[OK]${NC} npm"
else
echo -e " ${RED}[FAIL]${NC} npm"
((ERRORS++))
fi
success "Playwright installed!"
# Verify installation
echo ""
echo "Checking dependencies:"
command -v node &> /dev/null && success "Node.js" || error "Node.js"
command -v npm &> /dev/null && success "npm" || error "npm"
[ -d "node_modules/playwright" ] && success "Playwright" || warning "Playwright (may need manual install)"
[ -d "node_modules/ink" ] && success "Ink (TUI framework)" || warning "Ink not found - run 'npm install'"
[ -d "node_modules/unified" ] && success "unified (markdown)" || warning "unified not found - run 'npm install'"
if [ -d "node_modules" ]; then
echo -e " ${GREEN}[OK]${NC} Root dependencies"
else
echo -e " ${RED}[FAIL]${NC} Root dependencies"
((ERRORS++))
fi
if [ -d "bin/goose-ultra-final/node_modules" ]; then
echo -e " ${GREEN}[OK]${NC} Goose Ultra dependencies"
else
echo -e " ${RED}[FAIL]${NC} Goose Ultra dependencies"
((ERRORS++))
fi
echo ""
echo "══════════════════════════════════════════════════════════════════"
echo " Installation Complete!"
echo ""
echo " To start OpenQode TUI, run:"
echo " node bin/opencode-ink.mjs"
echo ""
echo " Or use the shortcut:"
echo " npm start"
echo "══════════════════════════════════════════════════════════════════"
echo ""
if [ $ERRORS -eq 0 ]; then
echo -e " ${GREEN}==========================================="
echo " ALL CHECKS PASSED! Ready to launch."
echo -e " ===========================================${NC}"
echo ""
echo " Run ./OpenQode.sh to start the application!"
echo ""
else
echo -e " ${RED}==========================================="
echo " SOME CHECKS FAILED ($ERRORS errors)"
echo -e " ===========================================${NC}"
echo ""
echo " Try running this installer again."
echo ""
fi
exit $ERRORS