4b24368be2
Scaffolds a reproducible, idempotent installer that stands up the four native launchd core services (soul :7770, engram :8742, mcp-wrapper :17779, mcp-proxy :7779), seeds a fresh engram with the genesis identity via forge, and installs the Claude Code config (neuron agent + core hooks + local MCP). Fully templated to the invoking user's $HOME; Anthropic key prompted and stored in Keychain; no secrets committed. Personal automations and synapse-dependent hooks excluded from core.
57 lines
2.7 KiB
Bash
Executable File
57 lines
2.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# neuron-dev-setup / uninstall.sh
|
|
# Tears down the CORE dev stack this installer created. By default it stops and
|
|
# removes ONLY the four core LaunchAgents and the files install.sh laid down.
|
|
# It NEVER deletes your engram data unless you pass --purge-data.
|
|
#
|
|
# ./uninstall.sh # stop + remove core LaunchAgents and wrapper script
|
|
# ./uninstall.sh --purge-data # ALSO delete ~/.neuron/engram (destroys the brain!)
|
|
# ./uninstall.sh --keep-claude # leave ~/.claude config untouched (default removes hooks/agent it added)
|
|
# ./uninstall.sh --dry-run
|
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
if [ -f "${SCRIPT_DIR}/config.env" ]; then source "${SCRIPT_DIR}/config.env"
|
|
elif [ -f "${SCRIPT_DIR}/config.env.example" ]; then source "${SCRIPT_DIR}/config.env.example"; fi
|
|
: "${NEURON_HOME:=${HOME}/.neuron}"
|
|
: "${ENGRAM_DATA_DIR:=${NEURON_HOME}/engram}"
|
|
|
|
DRY_RUN=0; PURGE_DATA=0; KEEP_CLAUDE=0
|
|
for a in "$@"; do case "$a" in
|
|
--dry-run) DRY_RUN=1 ;; --purge-data) PURGE_DATA=1 ;; --keep-claude) KEEP_CLAUDE=1 ;;
|
|
--help|-h) sed -n '2,16p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'; exit 0 ;;
|
|
*) echo "unknown flag: $a" >&2; exit 2 ;;
|
|
esac; done
|
|
run() { if [ "$DRY_RUN" = 1 ]; then echo "[dry-run] $*"; else eval "$*"; fi; }
|
|
|
|
LAUNCHAGENTS="${HOME}/Library/LaunchAgents"
|
|
CORE_AGENTS=(ai.neuron.mcp-proxy ai.neuron.mcp-wrapper ai.neuron.soul ai.neuron.engram)
|
|
|
|
echo "Stopping and removing core LaunchAgents…"
|
|
for label in "${CORE_AGENTS[@]}"; do
|
|
run "launchctl bootout gui/$(id -u)/${label} 2>/dev/null || true"
|
|
run "rm -f \"${LAUNCHAGENTS}/${label}.plist\""
|
|
echo " removed ${label}"
|
|
done
|
|
|
|
echo "Removing generated ~/.neuron/bin/soul-wrapper.sh…"
|
|
run "rm -f \"${NEURON_HOME}/bin/soul-wrapper.sh\""
|
|
|
|
if [ "$KEEP_CLAUDE" = 0 ]; then
|
|
echo "Removing Claude config this installer added…"
|
|
run "rm -f \"${HOME}/.claude/hooks/neuron-self-load.sh\" \"${HOME}/.claude/hooks/neuron-agent-preamble.sh\" \"${HOME}/.claude/hooks/pre-compact.sh\""
|
|
run "rm -f \"${HOME}/.claude/mcp.json.neuron\" \"${HOME}/.claude/settings.core.json\""
|
|
echo " (left ~/.claude/settings.json and ~/.claude/mcp.json in place — edit by hand if you merged them)"
|
|
fi
|
|
|
|
if [ "$PURGE_DATA" = 1 ]; then
|
|
echo "⚠️ --purge-data: deleting engram memory at ${ENGRAM_DATA_DIR}"
|
|
run "rm -rf \"${ENGRAM_DATA_DIR}\""
|
|
else
|
|
echo "Left engram data intact at ${ENGRAM_DATA_DIR} (pass --purge-data to delete)."
|
|
fi
|
|
|
|
echo "Done. Source repos under your DEV_ROOT were left untouched."
|