#!/bin/bash # Ralph Enable - Interactive Wizard for Existing Projects # Adds Ralph configuration to an existing codebase # # Usage: # ralph enable # Interactive wizard # ralph enable --from beads # With specific task source # ralph enable --force # Overwrite existing .ralph/ # ralph enable --skip-tasks # Skip task import # # Version: 0.11.0 set -e # Get script directory for library loading SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Try to load libraries from global installation first, then local RALPH_HOME="${RALPH_HOME:-$HOME/.ralph}" if [[ -f "$RALPH_HOME/lib/enable_core.sh" ]]; then LIB_DIR="$RALPH_HOME/lib" elif [[ -f "$SCRIPT_DIR/lib/enable_core.sh" ]]; then LIB_DIR="$SCRIPT_DIR/lib" else echo "Error: Cannot find Ralph libraries" echo "Please run ./install.sh first or ensure RALPH_HOME is set correctly" exit 1 fi # Source libraries source "$LIB_DIR/enable_core.sh" source "$LIB_DIR/wizard_utils.sh" source "$LIB_DIR/task_sources.sh" # ============================================================================= # CONFIGURATION # ============================================================================= # Command line options FORCE_OVERWRITE=false SKIP_TASKS=false TASK_SOURCE="" PRD_FILE="" GITHUB_LABEL="" NON_INTERACTIVE=false SHOW_HELP=false # Version VERSION="0.11.0" # ============================================================================= # HELP # ============================================================================= show_help() { cat << EOF Ralph Enable - Add Ralph to Existing Projects Usage: ralph enable [OPTIONS] Options: --from Import tasks from: beads, github, prd --prd PRD file to convert (when --from prd) --label