#!/usr/bin/env bash set -euo pipefail echo "==========================================" echo " JimuAI Codex One-Click Setup (macOS)" echo "==========================================" echo echo "This script will:" echo "1. Check Node.js / npm" echo "2. Install Codex CLI" echo "3. Write your JimuAI Codex config" echo echo "[1/3] Checking environment..." curl -fsSL https://code.jimuxyz.com/env_deploy/codex-install.sh | bash echo echo "[2/3] Installing Codex CLI..." npm install -g @openai/codex@latest echo read -r -p "Paste your Codex API Key (sk-...) and press Enter: " JIMU_KEY if [ -z "${JIMU_KEY:-}" ]; then echo "[ERROR] API Key is required." exit 1 fi echo echo "[3/3] Writing Codex config..." curl -fsSL https://code.jimuxyz.com/env_deploy/codex-deploy.sh | bash -s -- "$JIMU_KEY" echo echo "==========================================" echo "Setup finished." echo "You can now open a new terminal and run:" echo " codex" echo "==========================================" echo read -r -p "Press Enter to close..."